Defend disputes in bulk
Submit the same evidence documents for several open disputes in one request with POST /v1/disputes/bulk_defend.
Send POST /v1/disputes/bulk_defend
to submit the same documents and text as evidence for several disputes in one
request. Use it when one set of files answers many disputes, for example a
delivery report that covers a batch of orders, or the terms of service your
customers accepted.
Requirements
Before you send the request, check each dispute and each document:
- Every dispute has the status
openorpre_arbitration. - Every document is a dispute evidence document with the status
active. See Upload a document. - Every document is within the limits of every dispute's processor. The request applies the strictest limit among the disputes you send. See Limits.
Defend the disputes
Upload the files once, then send their IDs with the disputes they answer.
- 1
Upload the documents
Create a document for each file with
POST /v1/documents, upload the file, and wait for thedocument.activeevent. A document can be used in any number of bulk requests. - 2
Send the bulk defend request
Send
disputes(thedspt_IDs),documents(1 to 10doc_IDs), and an optionaltext. The same documents and text are submitted for every dispute.curl -X POST https://api.sandbox.pay.com/v1/disputes/bulk_defend \ -u ':sk-pay-com-sandbox-…' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: 4f6c2a1e-8d3b-4b8e-9a51-0c2f7d9e6b13' \ --data '{ "disputes": [ "dspt_692434889303132160", "dspt_692434901147842560" ], "documents": ["doc_692435112204787712"], "text": "Signed delivery confirmations for both orders." }'HTTP/1.1 204 No ContentA
204means Pay.com accepted the whole request and is submitting the evidence in the background. - 3
Follow each dispute
Pay.com submits the evidence for each dispute on its own. Each dispute moves to
evidence_under_reviewwhen its evidence is processed, and Pay.com sends adispute.evidence_under_reviewevent for it. One dispute can fail while the others succeed, so check each dispute's status. To check one, retrieve it withGET /v1/disputes/{dispute_id}.
How the request is checked
The API checks the whole request before it submits anything. If any check fails, it returns an error and submits no evidence for any dispute.
| Problem | Response |
|---|---|
| A dispute doesn't exist | 400 |
| A document doesn't exist | 404 |
A dispute isn't open or pre_arbitration | 400 |
A document isn't an active dispute evidence document | 400 |
| A document is over the strictest limit among the disputes' processors | 400 |
| More than 10 documents, or no documents | 400 |
A request with the same idempotency-key is still running | 409 |
Fix the problem and send the request again. Because nothing was submitted, you can resend the same disputes. There's no limit on the number of disputes in one request.
Bulk and single submissions compared
A bulk request submits the same evidence as
POST /v1/disputes/{dispute_id}/evidences,
with a few differences:
| Single dispute | Bulk | |
|---|---|---|
| Disputes per request | 1 | 1 or more |
| Documents | document, or up to 10 in documents | 1 to 10 in documents |
text | Required, and can be empty | Optional |
type | Optional, defaults to additional_evidence | Not accepted. Stored as additional_evidence |
| Response | 201 with the dispute object | 204 with no body |
Next steps
- Dispute evidence: Evidence types, file limits, and how to upload documents.
- Dispute lifecycle and statuses: What happens after the evidence is submitted.
- Bulk defend disputes API: The full endpoint reference.