---
updatedAt: 2026-02-10T11:44:00.000Z
---

# Initiate refund

This function allows a merchant to refund payments that were already acknowledged as received and processed successfully

This function allows a merchant to refund payments that were already acknowledged as received and processed successfully

> 📘 Live Endpoint
>
> <https://api.tingg.africa/v3/checkout-api/refund/request>

| **Key**                   | **Value Type** | **Required** | **Description**                                                                                             |
| ------------------------- | -------------- | ------------ | ----------------------------------------------------------------------------------------------------------- |
| `currency_code`           | String         | No           | 3 letter currency code for the transaction                                                                  |
| `merchant_transaction_id` | String         | Yes          | Unique transaction ID identifying the transaction as given by the merchant. (Has a limit of 100 characters) |
| `refund_type`             | String         | Yes          | A flag indicating the type of refund to be done; can either be `Full` or `Partial`.                         |
| `amount`                  | Double         | Yes          | Amount to be refunded. Compulsory for partial                                                               |
| `refund_narration`        | String         | Yes          | A reason for the refund. (Has a limit of 100 characters)                                                    |
| `refund_reference`        | String         | Yes          | Reference number for the transaction. (Has a limit of 100 characters)                                       |
| `service_code`            | String         | Yes          | The merchant's service code.                                                                                |
| `payment_id`              | String         | No           | Unique internal CPG transaction ID.                                                                         |

## Response Status Codes

| **Status Code** | **Description**                                                                                       |
| --------------- | ----------------------------------------------------------------------------------------------------- |
| 200             | Success. Refund request successfully logged in the checkout platform.                                 |
| 500             | Failure. Generic failure occurred. Could be as a result of a system failure on the checkout platform. |
| 400             | Bad request - a parameter is missing or empty                                                         |
| 422             | Invalid 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 code | Description                                                                        | Available from                                                    |
| :------------------ | :--------------------------------------------------------------------------------- | :---------------------------------------------------------------- |
| 184                 | This is indicates that a refund of part of the request amount has been initiated.  | [Query request status](https://docs.tingg.africa/cellulant/reference/query-status)                          |
| 185                 | This is indicates that full refund the request amount has been initiated.          | [Query request status](https://docs.tingg.africa/cellulant/reference/query-status)                          |
| 186                 | This is indicates that the part refund for the request was successfully processed. | [Query request status](https://docs.tingg.africa/cellulant/reference/query-status)  and Refund Notification |
| 187                 | This is indicates that the full refund for the request was successfully processed. | [Query request status](https://docs.tingg.africa/cellulant/reference/query-status)  and Refund Notification |
| 191                 | Refund Expired                                                                     | [Query request status](https://docs.tingg.africa/cellulant/reference/query-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.

[block:image]{"images":[{"image":["https://files.readme.io/ca85e7b1b389731b52408da1fb47f0346f0d31028a7c05ed54ac85ce7f5d1c6d-image_20.png","",""],"align":"center"}]}[/block]

> ### Refund Notification Request
>
> | Key                   | Value Type | Description                                                                 |
> | :-------------------- | :--------- | :-------------------------------------------------------------------------- |
> | amount                | double     | the refunded amount                                                         |
> | statusCode            | int        | the status of the refund                                                    |
> | refundReference       | String     | Reference number for the transaction (sent when initiating a refund)        |
> | merchantTransactionId | String     | Unique transaction ID identifying the transaction as given by the merchant. |
>
> ## Sample Refund Notification Request
>
> ```json Refund Notification
> {
>   "amount":30.5,
>   "statusCode":186,
>   "refundReference":"536772882hhd",
>   "merchantTransactionID":"tywvbb63778383"
> }
> ```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "checkout-apis-2",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://api-approval.tingg.africa"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/v3/checkout-api/refund/request": {
      "post": {
        "summary": "Initiate refund",
        "description": "This function allows a merchant to refund payments that were already acknowledged as received and processed successfully",
        "operationId": "refund",
        "parameters": [
          {
            "name": "apikey",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "pscPbgj27sEYaPBdxYoHSshEDdt5Pivq"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer Token"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "currency_code",
                  "merchant_transaction_id",
                  "refund_type",
                  "amount",
                  "refund_narration",
                  "refund_reference",
                  "service_code"
                ],
                "properties": {
                  "currency_code": {
                    "type": "string",
                    "default": "KES"
                  },
                  "merchant_transaction_id": {
                    "type": "string",
                    "default": "787867001614"
                  },
                  "refund_type": {
                    "type": "string",
                    "description": "Full or Partial",
                    "default": "FULL"
                  },
                  "amount": {
                    "type": "number",
                    "default": 100,
                    "format": "double"
                  },
                  "refund_narration": {
                    "type": "string",
                    "default": "User refunded from portal"
                  },
                  "refund_reference": {
                    "type": "string",
                    "default": "PRF0018"
                  },
                  "service_code": {
                    "type": "string",
                    "default": "TINGGTEST"
                  },
                  "payment_id": {
                    "type": "string",
                    "default": "12345"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"status\": {\n        \"status_code\": 200,\n        \"status_description\": \"Reversal request was successful.\"\n    },\n    \"results\": {\n        \"checkout_request_id\": 119486,\n        \"merchant_transaction_id\": \"transRefNo3048Iioo5695iUI\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "integer",
                          "example": 200,
                          "default": 0
                        },
                        "status_description": {
                          "type": "string",
                          "example": "Reversal request was successful."
                        }
                      }
                    },
                    "results": {
                      "type": "object",
                      "properties": {
                        "checkout_request_id": {
                          "type": "integer",
                          "example": 119486,
                          "default": 0
                        },
                        "merchant_transaction_id": {
                          "type": "string",
                          "example": "transRefNo3048Iioo5695iUI"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Bad Request": {
                    "value": " {\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 400,\n    \"errorMessage\": \"Bad Request - country_code is empty\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Bad Request - country_code is empty"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Unauthorized": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 401,\n    \"errorMessage\": \"Unauthorized - InvalidAPIKey\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 401,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Unauthorized - InvalidAPIKey"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "examples": {
                  "Forbidden": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 403,\n    \"errorMessage\": \"Forbidden\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 403,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Forbidden"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Not found": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": \"404\",\n    \"errorMessage\": \"Resource not found\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "string",
                      "example": "404"
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "405",
            "content": {
              "application/json": {
                "examples": {
                  "Method Not Allowed": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 405,\n    \"errorMessage\": \"{request.verb} Method Not Allowed\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 405,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "{request.verb} Method Not Allowed"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "examples": {
                  "Too Many Requests": {
                    "value": "{\n    \"requestId\": \"cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 429,\n    \"errorMessage\": \"Quota limit Exceeded\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 429,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Quota limit Exceeded"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "502",
            "content": {
              "application/json": {
                "examples": {
                  "Bad Gateway": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 502,\n    \"errorMessage\": \"Your request timed out\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 502,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Your request timed out"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "examples": {
                  "Service Unavailable": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 503,\n    \"errorMessage\": \"Server could not process your request. Try later\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 503,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Server could not process your request. Try later"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "504",
            "content": {
              "application/json": {
                "examples": {
                  "Gateway Timeout": {
                    "value": "{\n    \"requestId\": \"CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d\",\n    \"errorCode\": 504,\n    \"errorMessage\": \"Request timed out\",\n    \"timestamp\": \"20221201150245\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "CEL-cc7c1d27-1cfc-4e20-bd16-75d07436331d"
                    },
                    "errorCode": {
                      "type": "integer",
                      "example": 504,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Request timed out"
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "20221201150245"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```