/api/withdrawalsRequest Withdrawal
Create a withdrawal to a Thai bank account. The merchant's balance is validated and the payout is queued for the specified beneficiary account.
Overview
Submit a withdrawal request with your beneficiary bank details and amount. The system validates your merchant account (via Bearer secret), ensures the merchant is active, checks your balance, resolves the Thai bank by exact name, and creates a withdrawal with status pending.
Note: The bank_name field must match one of the supported Thai bank names exactly (case-sensitive). Withdrawals remain pending until processed.
How It Works
- Merchant sends POST request
- System validates merchant (ACTIVE), balance, and bank name
- Withdrawal created with status pending
- Response returns withdrawal details
Request Body
bank_account – Beneficiary bank account number
account_name – Account holder name
bank_name – Must exactly match supported Thai banks
amount – Minimum 100 THB, must not exceed balance
Numeric strings for amount are accepted and converted
Extra fields are ignored
Supported Thai Banks
Code Examples
curl -X POST "https://api.1401.com/api/withdrawals" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"bank_account": "1234567890",
"account_name": "John Doe",
"bank_name": "Bangkok Bank Public Company Limited",
"amount": 500
}'Response
Status Codes
{
"bank_account": "1234567890",
"account_name": "John Doe",
"amount": 500,
"bank_code": "BBL",
"bank_name": "Bangkok Bank Public Company Limited",
"payment_id": "cm1htmcgm0021u0ji1rtn2tzr"
}{
"statusCode": 401,
"message": "MERCHANT_SECRET_REQUIRED",
"error": "Unauthorized"
}Error Examples
{
"statusCode": 400,
"message": "INSUFFICIENT_BALANCE",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "amount must not be less than 100",
"error": "Bad Request"
}{
"statusCode": 404,
"message": "BANK_NOT_FOUND",
"error": "Not Found"
}{
"statusCode": 404,
"message": "MERCHANT_NOT_FOUND",
"error": "Not Found"
}{
"statusCode": 401,
"message": "INVALID_MERCHANT_SECRET",
"error": "Unauthorized"
}Withdrawal Flow
- Request validated (merchant must be ACTIVE)
- Withdrawal created (pending)
- Platform processes payout
Best Practices
- Keep Bearer token secure
- Use exact bank names (case-sensitive)
- Check balance before request
- Store response for tracking
Related Endpoints
Use merchant panel or contact support to check withdrawal status. A GET withdrawal endpoint may be added later.