A supporting document of a payout, and the statuses it moves through.
The Document is a supporting document of a payout, for example a commercial invoice. You create the document, upload its file, and then send its referenceNo in the documents of one payout. payout.documents of the Fetch Corridor Requirements API lists the document types that a payout on the corridor accepts.
A payout can use only an uploaded documentAfter you create the document, its status is
pending_upload. Send the document in a payout only when its status isuploaded.
Document fields
The Upload Document API, the Fetch Document by ID API and the Fetch Documents API return this resource. No endpoint returns the file content.
| Field | Type | Description |
|---|---|---|
referenceNo | string | The document referenceNo from Durianpay, for example doc_4fj2k9. Send it in the documents of the payout. |
partnerReferenceNo | string | Your own reference for the document, 1–64 characters. |
status | enum | pending_upload, uploaded or attached. See the status table below. |
documentType | enum | A code of the enum type document_type. Use the documentType of an item in payout.documents. |
fileName | string | The original file name. |
contentType | enum | application/pdf, image/jpeg or image/png. |
sizeBytes | number | The size of the file in bytes. Only after the file is uploaded. |
attachedToType | enum | payout. Only when the status is attached. |
attachedToReferenceNo | string | The referenceNo of the payout that uses the document. Only when the status is attached. |
uploadUrl | string | The link for the file upload. Only in the response of step 1 of the Upload Document API, while the status is pending_upload. |
uploadUrlExpiresAt | timestamp | The time limit of uploadUrl. Only together with uploadUrl. |
createdAt | timestamp | The time when the document was created, in ISO 8601 UTC. |
{
"responseCode": "2000000",
"responseMessage": "Successful",
"referenceNo": "doc_4fj2k9",
"partnerReferenceNo": "inv-2026-0612",
"status": "uploaded",
"documentType": "COMMERCIAL_INVOICE",
"fileName": "inv-2026-0612.pdf",
"contentType": "application/pdf",
"sizeBytes": 248310,
"createdAt": "2026-06-10T03:19:30Z"
}Document status
A document goes from pending_upload to uploaded, and then to attached.
| Status | Definition |
|---|---|
| pending_upload | Durianpay has the details of the document, but not the file. Send the file to the uploadUrl. |
| uploaded | Durianpay has the file. The file cannot change after the upload. No payout uses the document. You can send its referenceNo in the documents of a payout. |
| attached | A payout uses the document. No other payout can use the document. |
Status Definition gives your next step for each status.
The upload link
- Keep the
uploadUrlsecret. Do not write it to logs, and do not share it. - The link works for one successful upload, until
uploadUrlExpiresAt. - To get a new link, send the step 1 request of the Upload Document API again, with the same
partnerReferenceNoand the same request body. You can do this only while the status ispending_upload. The response has a newuploadUrlandadditionalInfo.replayed: true. The earlier link stops working. - The Fetch Document by ID API does not return an
uploadUrl.
Use the document in a payout
- Upload the documents before you create the payout. You can also upload them before you create the quote. A document that is not attached does not expire.
- Each document belongs to your merchant account. Send its
referenceNoindocumentswhen you call the Create Payout API. You can send up to five documents in one payout. - You can use a document in one payout only. After a payout uses a document, no other payout can use it, even when the status of that payout is
failed. - When you create a new payout after a failure, upload the file again as a new document, with a new
partnerReferenceNo. - After the upload, you cannot change the file of a document. To send a different file, upload a new document with a new
partnerReferenceNo.
