API Reference
Attach Payout Document [POST]

Attach Payout Document

https://sandboxapi.onbrails.com/api/v2/wallets/payout/file/upload/{transaction_id} (opens in a new tab)

Upload an invoice, contract or receipt and attach it to an initialized payout transaction in one call.

📘

Call this after Initiate Payout returns the transaction ID and before Finalize Payout. A payout document is required for every business transaction (B2B, B2C, C2B) and for China bank payouts and India payouts from a business sender. If you already uploaded the file with Upload Document, pass its key as receiptRef when initiating instead of calling this endpoint. See Documents & Compliance.

Body Parameters

This endpoint accepts multipart/form-data with a single file part.

ParameterTypeRequiredDescription
filefile✅The document. pdf, jpg, jpeg or png recommended, under 5 MB (10 MB hard limit).
📘

The request must be sent with Content-Type: multipart/form-data instead of application/json since it involves file upload.

Request

Payouts/Attach Payout Document [POST]
curl --location \
     --url 'https://sandboxapi.onbrails.com/api/v2/wallets/payout/file/upload/14c52854-46b5-4c98-81cc-89b92288b1c3' \
    --header 'Authorization: Bearer sk.xxxxxxxxxxxx' \
    --form 'file=@"/Users/files/Downloads/PROFORMAL INVOICE.pdf"'

Responses

🟢 200 - Result example
{
  "status": true,
  "message": "Document uploaded successfully",
  "data": {
      "documentType": "invoice",
      "documentUrl": "https://brails-documents.s3.amazonaws.com/payout-document/45422f21-9a0e-479e-9e10-615556448a78/7b1c6e2a-3f0d-4c8e-9a51-2d6f8e4b9c10.pdf"
  }
}

Errors

StatusMessageWhat to do
400file is requiredSend the file in the file multipart part.
400Transaction has no payout to attach a document toInitialize the payout first; only payout transactions accept documents.
403Document does not belong to this companyThe transaction or document belongs to another business.
404Transaction not foundCheck the transaction ID.
413file exceeds the maximum allowed sizeReduce the file below 10 MB and retry.