Skip to content
API documentationP2P EasyPay

Payout ​

LIVE payout: approval to payment result
  1. Create with a verified beneficiary
    POST /v1/pay/withdrawals
    Existing beneficiary_id + saved Idempotency-Key. Available balance must cover principal + fee.
  2. 201 · pending_approval
    Funds locked; approval required
    total_locked_minor
    The LIVE profile waits for two authorized staff approvals before matching.
  3. Match and receive transfers
    open → partially_filled or settled
    Several deposits may fill one withdrawal. A partial fill is not completion.
  4. Read the current withdrawal
    GET /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.
  5. Apply the version guard
    settled + remaining_minor = 0
    Withdrawal complete
    Use the current filled_minor and remaining_minor totals.
    OR
    Any other result
    Read status and totals together
    Keep waiting while active. Expiry or cancellation can follow a partial fill; retain the paid and refunded totals.
201 confirms creation, not payment. An unverified beneficiary (409) or insufficient available balance including fees (402) does not create an order.

POST /v1/pay/withdrawals

js
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.rebuild(storedRequest).send() 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.

ResultNext step
402 insufficient_balanceAvailable balance must cover the amount plus fee. No order was created.
409 beneficiary_not_verifiedCheck the verified beneficiary in the back office.
Timeout / retryable 503Keep the original body and Idempotency-Key. Do not create another request.
Read the result, PHP, and further details
js
const latest = await client.prepare('GET', `/v1/pay/withdrawals/${result.data.id}`).send();
php
$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.

เอกสารชุดนี้อิงสัญญา API เวอร์ชัน 2026-08-01