Payin upload slip
- Use this order’s returned capabilitySlipUploadCapabilityCREATE 201: use nested slip_upload. After CREATE 202 becomes payable: backend sends empty-body slip-token + required Idempotency-Key before revealing instructions; use the top-level 200 response. Check max_bytes and content_types.
- Upload to the exact returned URLPOST upload_urlUse upload_url and token from that capability, plus a saved Idempotency-Key. Do not send the merchant key or PG-* headers; do not construct the upload host.
- 202 · accepted + receipt_idEvidence received; verification follows202 confirms durable intake, not a credit or a successful bank verification.
- Read status with backoffGET /
v1/ pay/ deposits/ { id} Respect Retry-After/retry_ after_ seconds and the current expires_at. Stop polling on completion or expiry; elapsed time does not prove payment. - Current snapshotstatus = settledApply the accepted amount onceamount_received_minorVerify webhooks and use a version guard.OROther statusesShow the actual stateNo credit from accepted, slip_processing or under_review. Follow current status and is_terminal.
Use the upload capability for this order: nested slip_upload from CREATE 201, or the top-level SlipUploadCapability from slip-token 200 after CREATE 202 becomes payable. Send the image to its upload_url using its token. Do not send your Merchant API key or PG-* headers here.
import { readFile } from 'node:fs/promises';
import { clientFromEnv } from './client.mjs';
const client = clientFromEnv();
// upload is order.slip_upload (CREATE 201) or tokenResult.data (slip-token 200).
const file = new Blob([await readFile('/secure-upload/slip.png')], { type: 'image/png' });
const request = client.uploadSlip(upload, file, 'order-1001-slip-1');
const result = await request.send();
// Retry the same prepared request, image, and key.Use JPEG/PNG/WebP listed in content_types, within the returned max_bytes. The server checks the real file type and evidence. Upload only for the order whose instructions the payer actually used.
Result
202 with a receipt_id means evidence was accepted. On LIVE, poll GET / with backoff until the current expires_at: 3 → 5 → 10 → 30 seconds between reads, never sooner than Retry-After/retry_after_seconds. Stop on a terminal result or the deadline. Confirm funds only at settled. A passed deadline does not prove payment; pending verification is not a reason to ask the payer to transfer again.
An initial LIVE 202 awaiting_liquidity has no upload token. Poll GET as described in Payin. Once it reports awaiting_payment, your backend requests POST / with an empty body and required Idempotency-Key before revealing payment instructions. PayPage obtains this capability for you.
LIVE emits only deposit.settled, deposit.canceled, withdrawal.created, withdrawal.partial_fill, and withdrawal.terminal. There is no webhook for matching, under_review, rejected, or expired; see the Live P2P profile.
Sandbox 201 has no real transfer instructions, upload capability, or slip-token. Use POST / and whole baht from THB 1 to 10,000,000 (100–1000000000 minor units). See Sandbox payments for amount ranges and outcomes. Do not send real funds or slips.
| Problem | Next step |
|---|---|
503 or network timeout | Honor Retry-After; retry the original evidence and key. |
409 idempotency_key_reused | The key was used with different evidence. Check the request; do not use new keys to resubmit the same slip as a new order. |
410 | Follow the response's support path, or contact support with the order ID and real slip. |
PHP and additional requirements
$prepared = $client->uploadSlip($upload, '/secure-upload/slip.png', $persistedSlipKey);
$result = $client->send($prepared);
// Retry with the same prepared request and unchanged file.Never log the token/image or put the token in a URL. Use the returned upload URL exactly; do not construct a host yourself. This capability is separate from your Merchant API key. Do not set multipart Content-Type yourself: the client supplies its boundary.