- Money Transfer
- Inbound
- /transaction/cancel
Inbound transactions represent money arriving from external sources into the system.
Cancels a pending inbound transaction.
Use this endpoint when you need to:
- Void an inbound transaction within the allowed time window (automatic if
is_voidflag is active) - Cancel an inbound transaction that is still in process (status I)
- Cancel an inbound transaction that is on hold (status H)
- Submit a cancelation request with a reason for transactions that require approval
After a successful cancellation request:
- Void flow: The transaction is immediately voided. Status changes to VOID. No further action is required.
- Cancelation Request flow: A cancellation request is submitted for approval. The transaction remains in its current status until an administrator approves or rejects the request. Once approved, the transaction status changes to CANCEL.
Requires x-client-id and x-secret-key headers for partner authentication.
The system determines the cancellation flow based on the is_void flag in the transaction details:
| Condition | Flow | Response cancelFlow |
|---|---|---|
is_void = true | Void | "void" |
is_void = false | Cancelation Request | "cancelation-request" |
Immediate cancellation within the allowed time window. The transaction is voided directly without requiring approval.
Submits a cancellation request with a reason for approval. The transaction remains active until the request is approved.
- Only transactions with
id_flag_receiver=I(in process) orH(on hold) can be cancelled. - Transactions with status CANCEL, PAID, VOID, or RETURNED are considered terminal and cannot be cancelled.
- A transaction that already has a pending cancellation request cannot be cancelled again.
- The
branchIdmust have permission to cancel the transaction. - The
reasonNameandreasonIdfields are required for the cancelation-request flow (not required for void). - The
transactionContextobject withbranchIdis required. - If the transaction has
is_void = true, the void flow is executed automatically regardless of other fields. - Before calling this endpoint, retrieve available cancellation reasons from: Catalogs Endpoint Cancel Reasons
- 400000 - Invalid JSON format
- 400001 - Missing or invalid required fields
- 400417 - Branch ID does not have permission to cancel this transaction
- 401000 - Invalid credentials (verify x-client-id and x-secret-key headers)
- 403001 - Partner not authorized for this endpoint
- 404001 - Transaction not found
- 422001 - Transaction cannot be cancelled due to its current status
- 422002 - Transaction already has a pending cancellation request
- 422003 - Inbound transaction can only be cancelled when status is I or H
- 502001 - External API error during cancellation
- 500000 - Internal server error
Unique identifier of the transaction to cancel.
Cancellation reason text. Required for cancelation-request flow. Available reasons can be retrieved from Cancel Reasons Catalog.
Cancellation reason ID. Required for cancelation-request flow. Available reasons can be retrieved from Cancel Reasons Catalog.
- Void flow (is_void=true, within time window)
- Cancelation Request flow (with reason)
curl -i -X DELETE \
https://sandbox-viablocks.viamericas.io/transaction/cancel \
-H 'Content-Type: application/json' \
-H 'x-client-id: xxxx123456789' \
-H 'x-secret-key: xxxx987654321xxs' \
-d '{
"uuid": "b9e59b4a-0540-453a-86ca-cb6efa062b96",
"transactionContext": {
"branchId": "I99984",
"cashierId": "ADMIN"
}
}'Transaction cancelled successfully. The cancelFlow field indicates which cancellation path was used.
Unique identifier of the cancelled transaction.
Cancellation flow used:
void: Transaction was voided immediately (is_void=true)cancelation-request: Cancellation request submitted for approval
- Inbound — Void flow
- Inbound — Cancelation Request
{ "status": "success", "transaction_uuid": "b9e59b4a-0540-453a-86ca-cb6efa062b96", "cancelFlow": "void", "message": "Transaction voided successfully" }