Skip to content

Create purchase dispute

Request

Creates a new purchase dispute. Purchases in authorized status may not be disputed. They must first be written to the ledger by changing the status of the purchase or creating a new purchase object in pending or settled status. Once one of those steps have been taken, the purchase may be disputed.

Security
oauth2(Required scopes: purchase.dispute:create) or bearerAuth or apiKeyHeader
Path
personIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

A Borrower's unique identifier, tied to a person or a business. Can be Peach or a lender's external identifier.

loanIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

The unique identifier of the Loan we wish to retrieve. Can be Peach or lender's external identifier.

drawIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

The draw identifier.

purchaseIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

The purchase identifier.

Bodyapplication/jsonrequired
externalIdstring or null, [ 1 .. 200 ] characters

A lender's identifier for an object.

After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object.

To fetch the object using externalId you need to add ext- to the URL.

Note: Don't add ext- to the identifier value. For example: if the external identifier is ABCDE, then pass externalId=ABCDE and NOT ext-ABCDE when creating the object.

caseIdstring

Peach identifier of the case. The case object contains more details about the dispute, e.g. evidence information such as supporting documents.

disputedAmountnumber, (float)required

The disputed amount. Can be less than the original purchase amount. Sum of disputed amounts cannot exceed the original purchase amounts (regardless of disputes outcomes).

metadataobject
repostedPurchaseIdstring

The identifier of the reposted purchase. When a borrower loses a dispute, the lender normally creates a new purchase in the amount of the dispute.

statusstring

The status of the dispute. unsubmitted is the only valid status for a new purchase dispute.

unsubmitted - The dispute is pending submission to a processor/network.

submitted - The dispute has been submitted to a processor/network.

expired - The dispute has expired.

won - The dispute is won.

lost - The dispute is lost.

canceled - The dispute was canceled. Only unsubmitted disputes can be canceled.

Default:"unsubmitted"
Enum:"unsubmitted""submitted""expired""won""lost""canceled"
createDisputeCaseboolean

If true, the system will automatically create a Purchase Dispute case object and return the case identifier in caseId attribute. Alternatively, you can create the case object, pass createDisputeCase=false and the case identifier in the caseId attribute.

Default:true
POST
/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "externalId": "string",
    "caseId": "string",
    "disputedAmount": 0.1,
    "metadata": {},
    "repostedPurchaseId": "string",
    "status": "unsubmitted",
    "createDisputeCase": true
  }'

Responses

Success

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataobject(PurchaseDispute)
Response
{ "message": "string", "status": 0, "data": { "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "externalId": "string", "cardId": "string", "caseId": "string", "companyId": "string", "disputedAmount": 0.1, "metadata": {}, "repostedPurchaseId": "string", "status": "unsubmitted", "timestamps": { … } } }