The following endpoint creates a supporting document for a payout. Then you upload the file to the uploadUrl in the response.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
You upload a supporting document in two steps:
- Step 1: Create the document. Call this endpoint with the details of the file. The response gives the document
referenceNo,status: pending_uploadand anuploadUrl. - Step 2: Upload the file. Send the file to the
uploadUrlwithPUT. The status of the document then becomesuploaded.
Both steps go to the Global Payout API host. You do not call other storage.
The document is not ready after step 1After step 1, the status of the document is
pending_upload. If you send this document to the Create Payout API, the API refuses the request. Send a document in a payout only when its status isuploaded.
Step 1: Create the document
- Get the document types from
payout.documentsof the Fetch Corridor Requirements API.payout.documentslists every document type that a payout on the corridor accepts.required: truemarks the documents that the payout needs. - Send each document with its
documentType. - This request has no file. You send the file in step 2.
contentTypeisapplication/pdf,image/jpegorimage/png. In step 2, you send the file with thisContent-Type.uploadUrlis the link for step 2. It holds a one-time token. Its host is the host of the environment that you call.uploadUrlExpiresAtis the time limit of the link. Send the file before this time.- If you send the same
partnerReferenceNoand the same request body again, the API returns the same document in its current status. The response hasadditionalInfo.replayed: true. While the status ispending_upload, the response has a newuploadUrl. - If you send the same
partnerReferenceNowith a different request body, the API returnsPARTNER_REFERENCE_NO_CONFLICT(4090001). The error includes thedocumentReferenceNo.
Step 2: Upload the file
PUT {uploadUrl}, for example PUT /v1.0/global/documents/doc_4fj2k9/content?token=upt_7Kq2mX9vR4tL8wZ3
Do not send SNAP headers or JSON in step 2The token in the
uploadUrlauthorizes this call. Do not send the SNAP access token or a signature. Send the file bytes as the request body: not in JSON and not in base64.
| Part | Required | Description |
|---|---|---|
Content-Type header | Yes | The contentType that you sent in step 1. |
| Request body | Yes | The file bytes. The file must be at most 10 MiB (10,485,760 bytes). |
PUT /v1.0/global/documents/doc_4fj2k9/content?token=upt_7Kq2mX9vR4tL8wZ3
Host: api.durianpay.id
Content-Type: application/pdf
<file bytes>{
"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"
}- In the response,
statusisuploaded. Durianpay has the file. sizeBytesis the size of the file in bytes.- The response does not return the file content.
| Error | Meaning |
|---|---|
FIELD_INVALID (4000001) | One of these three causes. The Content-Type is not the contentType of step 1. The request body is empty or larger than 10 MiB. The file content does not match its content type. |
RESOURCE_NOT_FOUND (4040001) | The document or the token is unknown. |
ACTION_NOT_ALLOWED (4050001) | The link expired, or you already uploaded a file with it. To get a new link, send the step 1 request again. See The upload link. |
Response Code Handling gives the next step for each error code.
For the use of a document in a payout, see Document Object.
Sequence diagram: supporting documents
sequenceDiagram
autonumber
participant M as Merchant server
participant API as Global Payout API
M->>API: GET /v1.0/global/corridors/{country}/{currency}/requirements
API-->>M: 200 with payout.documents
loop Each required document
M->>API: POST /v1.0/global/documents with the file details
API-->>M: 200 doc_4fj2k9, status pending_upload, uploadUrl
M->>API: PUT uploadUrl with the file bytes
API-->>M: 200 status uploaded
end
M->>API: POST /v1.0/global/quotes
API-->>M: 200 quote
M->>API: POST /v1.0/global/payouts with documents (up to five document referenceNo values)
API-->>M: 200 payout, status processing
Note over M,API: A document attaches to one payout only