Kartra API: Inbound > Actions. This article is for developers.
This will allow you to cancel a subscription inside Kartra. You can pass either the Kartra Transaction ID or the Kartra Subscription ID.
| Type | Parameters | Values |
| POST | cmd* | cancel_transaction |
| POST | transaction_id** | integer |
| POST | transaction_internal_subscription_id** | integer |
* Required fields
** Required either the transaction_id OR transaction_internal_subscription_id in order for a subscription to be correctly identified and canceled.
Example
'actions' => [
'0' => [
'cmd' => 'cancel_transaction',
'transaction_id' => 234161
]
]Success message
{
"cancel_transaction":{
"status":"Success",
"transaction_subscription_id":"I-EV375R0H61SM",
"transaction_internal_subscription_id":"14833"
}
}Result parameters
| Parameters | Values |
| transaction_subscription_id | string A unique identifier for the subscription id (PayPal transactions will return PayPal subscription id). |
| transaction_internal_subscription_id | integer A unique numeric identifier for the subscription id. |
| Type Number | Message | Cause |
| 248 | Subscription doesn’t exist |
|
| 249 | Transaction not linked to any recurring subscription |
|
| 252 | Subscription already cancelled |
|
| 253 | This type of transaction cannot be refunded or cancelled |
|
| 267 | Cancellation has failed |
|
{
"status": "Error",
"message": "Subscription already cancelled",
"type": "252"
}