> **Base URL:** `https://payment.sa-by-dee.com`
> **Version:** v1 (current)
> **Auth:** Server-to-server Bearer token
> **Fee:** 5.5% platform fee (THB → THB local route)
> **Payout mode:** Manual admin gate (withdrawal within 24 hours)
Contact admin to receive:
Never expose this token in client-side code.** All calls must be server-to-server.
Every request must include the token in one of two ways:
# Preferred: X-EZ-Payout-Token header X-EZ-Payout-Token: <your_token> # Alternative: Authorization Bearer Authorization: Bearer <your_token>
Merchant ID can be passed as:
GET /api/ez-payout/balances?merchant_id=1
Response (200):
{
"ok": true,
"merchant_id": 1,
"balances": [
{
"currency": "THB",
"available_amount": 1865.00,
"pending_amount": 0.00,
"locked_amount": 0.00,
"updated_at": "2026-06-14 22:04:26"
}
]
}
Get a fee quote before submitting. Quotes expire after 30 minutes.
POST /api/ez-payout/quote
Content-Type: application/json
{
"merchant_id": 1,
"gross_amount": 1000,
"source_currency": "THB",
"payout_currency": "THB"
}
Response (200):
{
"ok": true,
"quote": {
"quote_id": "Q_abc123",
"quote_expires_at": "2026-06-16T13:30:00Z",
"source_currency": "THB",
"payout_currency": "THB",
"gross_amount": 1000.00,
"platform_fee_rate": 0.055,
"platform_fee_amount": 55.00,
"net_source_amount": 945.00,
"payout_amount": 945.00
}
}
Lock your balance and create a withdrawal request. This is **idempotent** — use the same `idempotency_key` to safely retry.
POST /api/ez-payout/request
Content-Type: application/json
{
"merchant_id": 1,
"gross_amount": 1000,
"source_currency": "THB",
"payout_currency": "THB",
"idempotency_key": "order-12345-withdraw-1",
"quote_id": "Q_abc123",
"destination": {
"bank_code": "SCB",
"account_number": "1234567890",
"account_name": "Somchai Jaidee"
}
}
Response (201):
{
"ok": true,
"request": {
"request_id": "WD_abc123",
"status": "requested",
"quote": { ... },
"destination": { ... }
}
}
If duplicate (200):
{
"ok": true,
"duplicate": true,
"request_id": "WD_abc123",
"status": "requested"
}
Minimum withdrawal:** 100 THB gross
GET /api/ez-payout/status?merchant_id=1&id=WD_abc123
Response (200):
{
"ok": true,
"request": {
"request_id": "WD_abc123",
"status": "submitted",
"source_currency": "THB",
"payout_currency": "THB",
"gross_amount": 1000.00,
"payout_amount": 945.00,
"submit_mode": "manual_admin_gate",
"created_at": "2026-06-16 10:00:00",
"updated_at": "2026-06-16 10:05:00"
}
}
GET /api/ez-payout/requests?merchant_id=1 GET /api/ez-payout/requests?merchant_id=1&status=completed
Response (200):
{
"ok": true,
"merchant_id": 1,
"requests": [ ... ]
}
requested → submitted → completed
↓ ↓
failed ←──────┘ (rejected)
1. [Your Server] GET /api/ez-payout/balances → check available THB 2. [Your Server] POST /api/ez-payout/quote → get fee breakdown 3. [Your Server] POST /api/ez-payout/request → lock balance + create request 4. [Admin] Reviews & approves request 5. [Admin] Transfers money manually (bank/P2P) 6. [Admin] POST /api/ez-payout/admin/complete → mark as completed 7. [Your Server] GET /api/ez-payout/status → confirm completion
Expected timeline:** Withdrawal within 24 hours (manual admin gate).
All withdrawal requests are idempotent by `idempotency_key`.
Generate a unique key per logical request (e.g., `order-{orderId}-withdraw-{attempt}`).
Retrying with the same key returns the original result — safe for network failures.
For token issuance, balance questions, or withdrawal issues:
Contact admin via the EZ Setup dashboard or LINE OA.