Skip to main content
Migo Docs

Cancel a Terminal Transaction

There is no dedicated void or refund sub-resource for terminal payments. Cancellations and reversals are expressed by updating the terminal payment's status via PATCH /terminal-payment/{id}.

Update the status​

curl -X PATCH https://api.ali.app/rest/terminal-payment/{id} \
-H "Authorization: Bearer <token>" \
-H "x-application-id: YOUR_APP_ID" \
-H "Content-Type: application/json" \
-d '{ "status": "cancelled" }'

The body is { externalId?, totalAmount?, status?, additionalData? }, where status is a CardTransfersStatus value:

StatusMeaning
createdInitial state
approvedApproved
processedProcessed
deniedDenied
reversedReversed
refundedRefunded
cancelledCancelled
in_progressIn progress
liquidatedLiquidated / settled

To cancel, set status to cancelled (or reversed). To mark a refund, set status to refunded. The response is the standard CustomResponse:

{
"success": true,
"data": { }
}
note

There is no action, reason, or reasonDetail field. If you need to attach contextual notes, use the free-form additionalData object on the terminal payment.

Device queries for transactions​

Retrieve past transactions on a specific device (useful for end-of-day reconciliation). The list covers the device's transactions for the last 180 days; there is no date filter.

# All transactions on a device (last 180 days)
curl "https://api.ali.app/rest/devices/{deviceId}/transactions" \
-H "Authorization: Bearer <token>"

# A specific transaction (numeric transactionId)
curl https://api.ali.app/rest/devices/{deviceId}/transactions/{transactionId} \
-H "Authorization: Bearer <token>"

deviceId is a string (e.g. device-abc123) and transactionId is a numeric integer id (e.g. 12345).

Webhooks​

Outbound terminal_payment.* webhooks are not available.