The Payment Company Logo

RefundApi

Refund API

The Refund API allows you to submit a refund for a specific transaction by using the `transaction_id`. This endpoint processes the refund request and returns real-time confirmation of the refund status.

SectionRefundApi
Topics04
PathrefundApi

API Endpoint

Live APIProduction environment
POSThttps://api.thepayment.company/api/v1/live/refund
Test APISandbox environment
POSThttps://api.thepayment.company/api/v1/test/refund

Request Fields

ParameterTypeRequiredDescription
transaction_idStringYesUnique ID of the transaction that should be refunded.
reasonStringYesReason provided for the refund request.

Headers

Header NameDescription
Content-TypeDefines the content type. Always use application/json.
AuthorizationBearer token used for authentication.

Sample Responses

{
"status": "SUCCESS",
"message": "Transaction marked as refunded.",
"data": {
  "amount": 10,
  "currency": "USD",
  "order_id": null,
  "transaction_id": "TPC5098432548233125",
  "customer": {
    "first_name": "Aryan",
    "last_name": "Trivedi",
    "email": "test@gmail.com"
  },
  "refund": {
    "status": true,
    "refund_date": "2025-03-29T10:02:16.525Z"
  },
  "chargeback": {
    "status": false,
    "chargeback_date": null
  }
}
}

On this page