Initiate Refund

Allows a merchant to refund payments that were already acknowledged and processed successsfully.

POST https://online.sandbox.tingg.africa/approval/checkout-translation-service/custom/requests/initiate-refund
POST https://checkout.tingg.africa/checkout-translation-service/custom/requests/initiate-refund

This request is used by merchants to initiate a refund request for a transactions that was initially accepted and a product or service was fulfilled.

This can only be used after the merchant has acknowledged the payments as accepted for a transaction in 2 ways:

  1. Invoking the POST acknowledge endpoint.
  2. Returning the acknowledgment status on the webhook callback response.

The initiate refunds request achieves the following:

  1. Validates that a refund can be initiated to the customer based on the amount to refund, the payment channels that were used to make the payment and the details provided to make the refund.
  2. Log the refund request and forward it for processing. A response will immediately be provided as to whether the validation and logging of the request was successful.

Header Parameters

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

Request Parameters

Parameter NameTypeDescriptionRequired
checkoutRequestIDintegerUnique transaction ID identifying the transaction as provided by the Tingg checkout platform.TRUE
merchantTransactionIDstringUnique transaction ID identifying the transaction as given by the merchant.TRUE
refundTypestringA flag indicating the type of refund to be done; can either be full​or partial.TRUE
refundAmountdoubleThe amount to be refunded. This value is optional if the refundType​ is full.FALSE
currencyCodestringA three letter ISO Code for currency the refund amount currency. If not provided, the original request currency will be used.TRUE
narrationstringA reason for the refund. (Has a limit of 100 characters)FALSE
extraDetailsstringA JSON string to provide extra details about the refund e.g. customer bank details for some channels.FALSE

Example

Full Refund

{
    "merchantTransactionID":"MTX5057010",
    "checkoutRequestID":"407271",
    "refundType":"full" ,
    "refundAmount":0,
    "currencyCode":"",
    "narration":"",
    "extraDetails":""
}

Partial Refund

{
    "merchantTransactionID":"MTX5057010",
    "checkoutRequestID":"407271",
    "refundType":"partial" ,
    "refundAmount":1000,
    "currencyCode":"KES",
    "narration":"Partial refund for undelivered service",
    "extraDetails":""
}

Response Parameters

Parameter NameTypeDescription
statusJSON Object
status.statusCodeintegerA status indicating the result of payment processing.
200 - Refund initiated successfully.
3 - Service sent is invalid.
422 - Missing field / no payments found to refund / invalid currency Code / Refund Failed due to merchant balance issue.
400 - Refund amount exceeds payment amount / Request was already fully refunded.
174 - Exception while initiating refund externally.
500 - Exception while initiating refund internally.
status.statusDescriptionstringA description of the status provided above.
resultsJSON Object
results.checkoutRequestIDintegerUnique transaction ID identifying the transaction as provided by the Tingg checkout platform.
results.merchantTransactionIDstringUnique transaction ID identifying the transaction as given by the merchant.
results.requestStatusCodeintegerStatus of the payment received
results.paymentsJSON ArrayAn array of the payments made.

The payments array holds a list of payments that have been made for the current request.

Parameter NameTypeDescription
paymentIDintegerUnique payment reference on the Cellulant Payment Gateway
payerTransactionIDstringUnique payment reference provided by the payment option ie MPESA reference
MSISDNstringMobile number used to complete the payment
accountNumberstringReference presented to complete a payment
customerNamestringCustomer names. NB: Provided only when available
amountPaiddoubleAmount paid / authorized by the customer
payerClientCodestringUnique code of the payment option on the Tingg checkout platform
clientNamestringMerchants name on the Tingg checkout platform
paymentDatestringDate when the payment was completed by the customer
currencyCodestringCurrency code which the customer was charged in by the payment option
refundAmountintegerThe total amount that the customer is going to pay.

Example
Successful Response

{
    "status": {
        "statusCode": 200,
        "statusDescription": "Refund initiated successfully"
    },
    "results": {
        "checkoutRequestID": "716003",
        "merchantTransactionID": "unique_transaction_id07",
        "refundAmount": 100,
        "refundCurrency": "KES",
        "payments": [
            {
                "payerTransactionID": null,
                "MSISDN": null,
                "accountNumber": null,
                "customerName": null,
                "amountPaid": null,
                "payerClientCode": null,
                "paymentDate": null,
                "clientName": null,
                "currencyCode": null,
                "paymentID": null,
                "refundAmount": null
            }
        ]
    }
}

Failure Response

{
    "status": {
        "statusCode": 400,
        "statusDescription": "No payment available for refund"
    },
    "results": null
}

Authentication Failure Response

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

Response Status Codes

Status CodeDescription
200Success. Refund request successfully logged in the checkout platform.
500Failure. Generic failure occurred. Could be as a result of a system failure on the checkout platform.
400Bad request - a parameter is missing or empty
422Invalid request - returned when a refund initiation is not processed successfully

Refund status codes

These request status codes indicate the status of a refund when a query status or a refund notification is processed.

Request status codeDescriptionAvailable from
184This is indicates that a refund of part of the request amount has been initiated.Query request status
185This is indicates that full refund the request amount has been initiated.Query request status
186This is indicates that the part refund for the request was successfully processed.Query request status and Refund Notification
187This is indicates that the full refund for the request was successfully processed.Query request status and Refund Notification
191Refund ExpiredQuery request status and Refund Notification
📘

Refund Notification

Notifications are done for final refund status codes 186, 187, and 191.
Refund notification is configurable. To receive a final status notification on refund, configure a Refund Notification Url for the service under Service Settings on the gateway portal as shown below.

Refund Notification Request

KeyValue TypeDescription
amountdoublethe refunded amount
statusCodeintthe status of the refund
refundReferenceStringReference number for the transaction (sent when initiating a refund)
merchantTransactionIdStringUnique transaction ID identifying the transaction as given by the merchant.

Sample Refund Notification Request

{
  "amount":30.5,
  "statusCode":186,
  "refundReference":"536772882hhd",
  "merchantTransactionID":"tywvbb63778383"
}

Did this page help you?