Login

Cancel Request

Allows a merchant to cancel a checkout request that was initiated earlier and is still active.

📘

A request can only be cancelled if:

  1. It has not expired yet.
  2. Full payment has not yet been received for the request i.e. no payment has been received or a partial payment has been received
POST https://developer.tingg.africa/checkout/v2/custom/requests/cancel

The cancel request function does the following:

  1. Changes the status of the request to the one provided by the merchant.
  2. Updates any payments tied to the request to a rejected state. This will result in further action i.e. reversal of the rejected payment(s) to the customer.

Header Parameters

HeaderValueRequired
AuthorizationBearer <Bearer_Token> generated during authenticate request in step 1.YES
Content-Typeapplication/jsonYES

Request Parameters

Parameter NameTypeDescriptionRequired
merchantTransactionIDstringUnique transaction ID identifying the transaction as given by the merchant.TRUE
serviceCodestringUnique code identifier for the merchant's service in use as provided on the checkout platform.TRUE
checkoutRequestIDintegerUnique transaction ID identifying the transaction as provided by the checkout platform.FALSE
{
	"merchantTransactionID":"MTX5241435",
	"serviceCode":"TEST-SERVICE",
	"checkoutRequestID": 12345
}

Response Parameters

Parameter NameTypeDescription
statusCodeintegerA status indicating the result of payment processing.
133 - Request has already been cancelled
200 - Request processed successfully.
500 - Generic failure occurred. Could be as a result of a system failure on the Tingg checkout platform.
1001 - No checkout request found.
1013 - The checkout request posted was not valid JSON.
1014 - Missing merchantTransactionID.
1017 - Missing serviceCode.
statusDescriptionstringA description of the status provided above.
checkoutRequestIDin 1013tegerUnique transaction ID identifying the transaction as provided by the Tingg checkout platform.
merchantTransactionIDstringUnique transaction ID identifying the transaction as given by the merchant.
requestStatusCodeintegerStatus of the payment received
131 - The request with no partial payments was cancelled by the merchant without any payments received.
181 - The request with partial payments was cancelled by the merchant without payments received on it.

Examples

Successful Response

{
    "status": {
        "statusCode": 200,
        "statusDescription": "Successfully processed request"
    },
    "results": {
        "checkoutRequestID": 407141,
        "merchantTransactionID": "id_5241435",
        "requestStatusCode": 133
    }
}

Failure Response

{
    "status": {
        "statusCode": 1001,
        "statusDescription": "Checkout request not available"
    },
    "results": null
}

Authentication Failure Response

{
    "message": "Unauthenticated.",
    "status_code": 500
}