Skip to content
API documentationP2P EasyPay

Payin cancel ​

POST /v1/pay/deposits/{id}/cancel

js
import { clientFromEnv } from './client.mjs';
const client = clientFromEnv();
const request = client.cancelPayin(
  'dep_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
  'Customer canceled before payment instructions were issued',
  'order-1001-cancel',
);
const result = await request.send();

200 with status: canceled confirms cancellation. Before the first send, store rawBody as text/bytea, not JSONB, with method/path/query/idempotencyKey/apiVersion. Retry the original prepared request; after restarting use client.rebuild(storedRequest).send() as shown in Get started.

Eligibility ​

ModeRequired conditions
LIVEYour own awaiting_liquidity order, with no historical account/QR/transfer instruction or accepted evidence.
SandboxYour pending simulated awaiting_payment order in the active run.

A LIVE awaiting_payment order, or an order that has ever issued transfer instructions, returns 409 deposit_not_cancelable, even without a slip. Do not mark it canceled unless the API confirms cancellation.

PHP and request body
php
$prepared = $client->cancelPayin($depositId, 'Customer canceled before instructions', $persistedCancelKey);
$result = $client->send($prepared);

The body contains only { "reason": "Customer canceled before instructions" }, with 1–500 Unicode codepoints and no control characters. This operation does not refund funds. See the full conditions and errors.

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