Skip to main content
Migo Docs

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 /payments hit its own TTL.
  • Order on the merchant side was cancelled before the customer paid.
  • A long-running IN_PROGRESS push 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 statusOutcomeResponse shape
CREATED, USEDSet to DISMISSED, no upstream call200 OK (plain text OK)
IN_PROGRESS (processor with a dedicated cancel hook)Set to CANCELLED, processor cancel hook executedJSON { message, transaction: { uid, status: "CANCELLED" } }
IN_PROGRESS (processor with a generic upstream cancel)Set to DISMISSED, upstream cancel call executed200 OK (plain text OK)
IN_PROGRESS (processor lacks any cancel hook)Rejected405 con error.code 4021
APPROVED, DENIED, EXPIRED, DISMISSEDRejected (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 statusOutcomeResponse
pendingSet to cancelled in Migo only; the provider does not support cancellation200, message Transaction cancelled locally and providerCancellation: false
cancelledNo change200, message Transaction already cancelled
Any other, including QR generation in progressRejected409, message Invalid status to cancel transaction
Another operation closed the transaction at the same time200 if it ended cancelled; otherwise rejected409, message Transaction state changed before cancellation
Dismiss not enabled for the methodRejected405, message Processor not allowed to dismiss transaction
Cancelled, but the follow-up notification failedStays cancelled; Migo completes it500, 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​

HTTPerror.codeCause
4005000Missing transactionId
4042000Transaction not found
4054021Processor does not allow dismiss (no cancel hook) for an IN_PROGRESS transaction
4094020Transaction 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.