MegTrustDevelopers

Cancel a payout

Withdraw a payout request before anyone approves it.

POST /api/v1/withdrawals/{id}/cancel cancels a payout that is still pending_approval.

  • No body and no idempotency key. Send no Idempotency-Key header. The canonical string hashes empty bytes and ends with an empty fifth line, exactly like a GET (see Sign a request).
  • Safe to repeat. Calling it again on a cancelled payout returns the same 200 with the payout unchanged.
  • Only payouts in your key's workspace can be found; anything else is 404 withdrawal_not_found.
const result = await api.request("POST", `/api/v1/withdrawals/${withdrawalId}/cancel`);

Results

ResponseMeaningWhat to do
200The payout, with status cancelled. Nothing was sent. A repeat call returns the same 200.Done.
409 withdrawal_not_cancellableAn approver has already acted, or the payout is past pending_approval (received, approved, processing, or a final status).The payout continues: follow it with GET /api/v1/withdrawals/{id}.
404 withdrawal_not_foundNo such payout in your workspace.Check the id and the key's workspace.
503 service_unavailableThe outcome isn't known yet.Retry the same call — it is safe to repeat.

The 200 body is a standard withdrawal:

200
{
  "data": {
    "id": "5f0c2a9e-7d1b-4c3a-9e2f-6b8d4a1c3e57",
    "status": "cancelled",
    "wallet_id": "acct_7f3a…",
    "asset": "ETH",
    "amount": "0.25",
    "destination": "0x03a6c1f2b7e94d58a0c3e1f6b2d4a7c9e8f081b9",
    "network": "ethereum",
    "tx_hash": null,
    "created_at": "2026-09-15T09:02:11.004Z",
    "updated_at": "2026-09-15T09:05:40.120Z"
  },
  "meta": {}
}

When cancel loses a race

An approver may act at the same moment you cancel. If the approval lands first, cancel returns 409 withdrawal_not_cancellable and the payout carries on. Re-read GET /api/v1/withdrawals/{id} for its real state — never assume a 409 means nothing will be sent.

After a cancel

  • cancelled is terminal. To pay again, request a new payout with a new idempotency key.
  • A withdrawal.status_changed webhook fires with status cancelled if you have webhooks configured.

On this page