PUT {{domain}}/api/v1/transactions/:id/cancel
Overview
This endpoint allows you to attempt to cancel an in progress e-transfer transaction. Note that the cancellation request will fail if the recipient has already deposited the funds, and successful cancellation using this endpoint will incur an Interac network cancellation fee.
Request & Response
Request Path Variable
PATH VARIABLE | Type | Description |
---|---|---|
id | string, required | Transaction id |
Response
Field | Type | Description |
---|---|---|
id | alphanumeric | Transaction id |
status | string | Current status of transaction |
currency | string | The currency of the transaction amount |
amount | integer | The amount of the transaction |
network | string | Name of the network used |
type | string | Type of transaction |
gateway_codes | array | Codes returned from the gateway. Each code is an object that includes a code and message field. |
updated_at | string | Time the transaction was updated |
SAMPLE REQUEST & RESPONSE
Request
PUT {{domain}}/api/v1/transactions/6ecdfce3-ecac-4d96-8cc4-c921f88eddaf/cancel
Responses
Successful Cancellation
{
"amount": 199,
"currency": "CAD",
"gateway_codes": [
{
"code": "action_code_not_found",
"message": "No action code found"
}
],
"id": "6ecdfce3-ecac-4d96-8cc4-c921f88eddaf",
"network": "etransfer",
"status": "cancelled",
"type": "push",
"updated_at": "2022-08-16T08:40:24"
}
Failed Cancellation - Due to e-transfer was already successful
{
"error": {
"code": "completed_transaction",
"message": "Transaction ID 6ecdfce3-ecac-4d96-8cc4-c921f88eddaf is completed and can no longer be cancelled."
}
}
Non e-transfer cancellation
{
"error": {
"code": "not_implemented",
"message": "Cancellation not available for network type"
}
}