Payin cancel
POST /
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();1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
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. as shown in Get started.
Eligibility
| Mode | Required conditions |
|---|---|
| LIVE | Your own awaiting_liquidity order, with no historical account/QR/transfer instruction or accepted evidence. |
| Sandbox | Your 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);1
2
2
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.