Upload Document

The following endpoint creates a supporting document for a payout. Then you upload the file to the uploadUrl in the response.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

You upload a supporting document in two steps:

  1. Step 1: Create the document. Call this endpoint with the details of the file. The response gives the document referenceNo, status: pending_upload and an uploadUrl.
  2. Step 2: Upload the file. Send the file to the uploadUrl with PUT. The status of the document then becomes uploaded.

Both steps go to the Global Payout API host. You do not call other storage.

🚧

The document is not ready after step 1

After 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 is uploaded.

Step 1: Create the document

  • Get the document types from payout.documents of the Fetch Corridor Requirements API. payout.documents lists every document type that a payout on the corridor accepts. required: true marks the documents that the payout needs.
  • Send each document with its documentType.
  • This request has no file. You send the file in step 2.
  • contentType is application/pdf, image/jpeg or image/png. In step 2, you send the file with this Content-Type.
  • uploadUrl is the link for step 2. It holds a one-time token. Its host is the host of the environment that you call.
  • uploadUrlExpiresAt is the time limit of the link. Send the file before this time.
  • If you send the same partnerReferenceNo and the same request body again, the API returns the same document in its current status. The response has additionalInfo.replayed: true. While the status is pending_upload, the response has a new uploadUrl.
  • If you send the same partnerReferenceNo with a different request body, the API returns PARTNER_REFERENCE_NO_CONFLICT (4090001). The error includes the documentReferenceNo.

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 2

The token in the uploadUrl authorizes 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.

PartRequiredDescription
Content-Type headerYesThe contentType that you sent in step 1.
Request bodyYesThe 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, status is uploaded. Durianpay has the file.
  • sizeBytes is the size of the file in bytes.
  • The response does not return the file content.
ErrorMeaning
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
Body Params
string
required

Your unique reference for this document, 1–64 characters. It is the idempotency key. See Repeated requests.

string
required

A supporting-document code of enum type document_type. Use the documentType of an item in payout.documents.

string
required

The original file name.

string
required

application/pdf, image/jpeg or image/png. Step 2 sends the file with this Content-Type.

Headers
string
required

The request time, RFC 3339 with an offset.

string
required

HMAC-SHA512 of the string to sign, with your client secret as the key, in standard base64.

string
required

Your SNAP client key. It must match the token.

string
required

Required. Use a unique ID for each request. It is not an idempotency key: see Idempotency.

string
required

Required. Any non-empty value is accepted, for example 95221.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json