POST
/
disbursements
/
batch
/
addFile
cURL
curl -X POST "https://dev.api.onekhusa.com/sandbox/v1/disbursements/batch/addFile" \
  --header "Authorization: Bearer your-jwt-token" \
  --header "Content-Type: application/json" \
  --header "Accept-Language: en" \
  --header "X-Idempotency-Key: your-idempotency-key" \
 -d '{
        "merchantAccountNumber": 35253486,
        "isBatchScheduled": true,
        "scheduledDate": "2024-01-15",
        "contentType": "XLSX",
        "capturedBy": "johndoe@example.com",
        "fileContent": "UEsDBBQAAAAIAA..."
      }'
{
  "merchantAccountNumber": 35253486,
  "batchNumber": 78688,
  "BatchStatusCode": "Q"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer Token, Where accessToken is the access token used to authenticate the request.

Headers

Accept-Language
string
default:en

Preferred language for the response

X-Idempotency-Key
string

A unique key to ensure idempotent requests

Body

application/json

Request payload for uploading batch disbursement files

merchantAccountNumber
integer
required

Required string length: 8

Required range: 10000000 <= x <= 99999999
isBatchScheduled
boolean
required

Whether the batch should be scheduled for later processing

contentType
string
required

The content type of the file (e.g., "XLSX", "CSV")

Maximum string length: 4
capturedBy
string<email>
required

Email address of the user uploading the batch file

Maximum string length: 60
Example:

"johndoe@example.com"

fileContent
string
required

Base64-encoded content of the Excel or CSV file

Minimum string length: 1
scheduledDate
string<date> | null

Scheduled date for processing (required if isBatchScheduled is true)

Response

200 - application/json

Success Response (200 OK)

merchantAccountNumber
integer
Example:

35253486

batchNumber
integer
Example:

78688

BatchStatusCode
Queued

This means that OneKhusa has accepted your batch disbursements request and queued for processing but does not make it available for viewing until the whole batch is validated (This make take few seconds or more depending on batch payload sent).

Example:

"Q"