Dismiss transaction
Cancel an alternative-payment transaction the customer abandoned, or one whose payment intent expired. Idempotent for unpaid states (CREATED, USED β DISMISSED); for IN_PROGRESS transactions Migo runs the processor's cancel hook when the processor supports one β resolving to CANCELLED for processors that run a dedicated cancel hook, or to DISMISSED for processors that support a generic upstream cancel call.
POST https://mw.migopayments.com/api/v1/integrations/transactions/{transactionId}/dismiss
See the live spec entry: POST /api/v1/integrations/transactions/{transactionId}/dismiss.
When to dismissβ
- Customer closed the merchant tab without paying.
- The QR / payment button rendered for
/paymentshit its own TTL. - Order on the merchant side was cancelled before the customer paid.
- A long-running
IN_PROGRESSpush payment must be force-cancelled and the processor supports an upstream cancel.
Requestβ
curl -X POST https://mw.migopayments.com/api/v1/integrations/transactions/trx_8f3c2b1d9e7a/dismiss \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{ "reason": "user_cancelled" }'
The body is optional and its keys are not validated β supply free-form metadata for audit purposes.
Behaviour matrixβ
| Current status | Outcome | Response shape |
|---|---|---|
CREATED, USED | Set to DISMISSED, no upstream call | 200 OK (plain text OK) |
IN_PROGRESS (processor with a dedicated cancel hook) | Set to CANCELLED, processor cancel hook executed | JSON { message, transaction: { uid, status: "CANCELLED" } } |
IN_PROGRESS (processor with a generic upstream cancel) | Set to DISMISSED, upstream cancel call executed | 200 OK (plain text OK) |
IN_PROGRESS (processor lacks any cancel hook) | Rejected | 405 con error.code 4021 |
APPROVED, DENIED, EXPIRED, DISMISSED | Rejected (ineligible status) | 409 con error.code 4020 |
yoloQRβ
Once you request the payment with yoloQR, the transaction is dismissed under its own rules, even before the QR is issued. While Migo is generating the QR the transaction cannot be dismissed; once issued, it stays in pending:
| Current status | Outcome | Response |
|---|---|---|
| pending | Set to cancelled in Migo only; the provider does not support cancellation | 200, message Transaction cancelled locally and providerCancellation: false |
| cancelled | No change | 200, message Transaction already cancelled |
| Any other, including QR generation in progress | Rejected | 409, message Invalid status to cancel transaction |
| Another operation closed the transaction at the same time | 200 if it ended cancelled; otherwise rejected | 409, message Transaction state changed before cancellation |
| Dismiss not enabled for the method | Rejected | 405, message Processor not allowed to dismiss transaction |
| Cancelled, but the follow-up notification failed | Stays cancelled; Migo completes it | 500, message Transaction cancelled; finalization requires recovery |
If the transaction does not belong to your account, it returns 404. These responses carry success, message and data, without error.code.
Errorsβ
| HTTP | error.code | Cause |
|---|---|---|
| 400 | 5000 | Missing transactionId |
| 404 | 2000 | Transaction not found |
| 405 | 4021 | Processor does not allow dismiss (no cancel hook) for an IN_PROGRESS transaction |
| 409 | 4020 | Transaction status not eligible for dismiss (APPROVED, DENIED, EXPIRED, DISMISSED) |
| 500 | β | Processor configuration missing or upstream cancel call failed |
See the Error catalog for the full description of each ownCode (including 4020 and 4021) and its retry semantics.
Relatedβ
- Dismiss transaction (Payment Link) β the same endpoint from the card vertical, without the
IN_PROGRESSbranch. - Process payment β the call that leaves the transaction awaiting payment.
- How it works β where dismiss fits in the lifecycle.