Cancel a PayIn deal
Explicitly cancels a deposit (PayIn) deal before the payment is verified. Allowed only from `INITIALIZED`, `ESCROW_LOCKED` or `PAYMENT_NOTIFIED`; escrow holds are released automatically, the fee breakdown is zeroed and matches are marked `FAILED`. Re-cancelling an already-`CANCELLED` deal returns the deal unchanged (idempotent). Players cancel via the public checkout endpoint `POST /api/v1/p2p/checkout/{hash}/cancel` instead.
/api/v1/p2p/merchant/deals/{deal_id}/cancelExplicitly cancels a deposit (PayIn) deal before the payment is
verified. Allowed only from INITIALIZED, ESCROW_LOCKED or
PAYMENT_NOTIFIED; escrow holds are released automatically, the fee
breakdown is zeroed and matches are marked FAILED. Re-cancelling an
already-CANCELLED deal returns the deal unchanged (idempotent).
Players cancel via the public checkout endpoint
POST /api/v1/p2p/checkout/{hash}/cancel instead.
Authorization
MerchantToken MerchantSignature 64-character hex public merchant token assigned during onboarding.
In: header
Stripe-style HMAC-SHA256 signature.
Format: t=<unix_seconds>,v1=<hex_hmac_sha256>
where hex_hmac = HMAC-SHA256(webhook_secret, "<unix_seconds>.<raw_body>").
Replay window: 5 minutes (60s future drift tolerated).
In: header
Path Parameters
Deal UUID.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/api/v1/p2p/merchant/deals/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel" \ -H "Content-Type: application/json" \ -d '{}'{ "deal": { "deal_id": "7ac148fe-1234-5678-9abc-def012345678", "status": "CANCELLED", "amount": "150000", "currency": "RUB", "created_at": "2026-08-10T12:00:00Z", "client_id": "player_42", "deal_type": "PAYIN", "updated_at": "2026-08-10T12:04:10Z" }}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "instance": "../dictionary", "errors": [ { "field": "amount", "message": "must be greater than 0", "code": "POSITIVE_REQUIRED" } ]}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "instance": "../dictionary", "errors": [ { "field": "amount", "message": "must be greater than 0", "code": "POSITIVE_REQUIRED" } ]}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "instance": "../dictionary", "errors": [ { "field": "amount", "message": "must be greater than 0", "code": "POSITIVE_REQUIRED" } ]}Retrieve a deal by ID GET
Returns the details of a single deal scoped to the merchant.
Amend a live deal's fiat amount (operator) POST
Changes the fiat amount of a deal that has not reached `PAYMENT_VERIFIED` yet (`INITIALIZED`, `ESCROW_LOCKED`, `PAYMENT_NOTIFIED`, `SOFT_DISPUTED` — Stripe PaymentIntent canon: the amount is mutable until authorization). Atomic in one transaction: the USDT equivalent is re-quoted at the deal's own fixed rate, every escrow hold (order-level and per-match) is recreated for the new sum, an append-only audit row is written and the `deal.amount_changed` webhook event (V2 only) is staged. Idempotent by `idempotency_key` (same key + same amount → replay; same key + different amount → 409). Optimistic locking via `expected_amount_version` (If-Match): a concurrent amend refuses with 409.