Payout
- Create with a verified beneficiaryPOST /
v1/ pay/ withdrawals Existing beneficiary_id + saved Idempotency-Key. Available balance must cover principal + fee. - 201 · pending_approvalFunds locked; approval requiredtotal_locked_minorThe LIVE profile waits for two authorized staff approvals before matching.
- Match and receive transfersopen → partially_filled or settledSeveral deposits may fill one withdrawal. A partial fill is not completion.
- Read the current withdrawalGET /
v1/ pay/ withdrawals/ { id} LIVE events: withdrawal.created, withdrawal.partial_fill, withdrawal.terminal. These are business snapshots; use authenticated GET for the full current order. - Apply the version guardsettled + remaining_minor = 0Withdrawal completeUse the current filled_minor and remaining_minor totals.ORAny other resultRead status and totals togetherKeep waiting while active. Expiry or cancellation can follow a partial fill; retain the paid and refunded totals.
POST /
import { clientFromEnv } from './client.mjs';
const client = clientFromEnv();
const request = client.payout({
amount_minor: '10000', // THB 100
currency: 'THB',
merchant_reference: 'PAYOUT-1001',
end_user_ref: 'customer-1',
beneficiary_id: 'ben_92000000000040008000000000000423',
}, 'payout-1001-create');
const result = await request.send();Use your Merchant's verified beneficiary_id from the back office/service provider. The sample illustrates the ID format. The current API requires this ID; inline beneficiary account creation and automatic verification are not available.
Before the first send, store request.rawBody as text/bytea, not JSONB, with method/path/query/idempotencyKey/apiVersion. After restarting, use client. as shown in Get started. Never re-serialize it or create a new key after a timeout.
Result
201 creates the order. The current LIVE profile starts at pending_approval and waits for authorized approval under the configured policy. Wait for the outcome before reporting payout completion. total_locked_minor includes the withdrawal amount plus its fee.
| Result | Next step |
|---|---|
402 insufficient_balance | Available balance must cover the amount plus fee. No order was created. |
409 beneficiary_not_verified | Check the verified beneficiary in the back office. |
Timeout / retryable 503 | Keep the original body and Idempotency-Key. Do not create another request. |
Read the result, PHP, and further details
const latest = await client.prepare('GET', `/v1/pay/withdrawals/${result.data.id}`).send();$prepared = $client->payout($body, $persistedPayoutKey);
$result = $client->send($prepared);Use authenticated GET or the supported LIVE events for progress. One withdrawal can receive multiple fills before completion. See full Payout details, LIVE results, or Get Merchant Balance.