Refund

๐Ÿ” Initiate Refund

Use this endpoint to initiate a refund for a specific order.


๐Ÿ’ก Good to Know

  • You must include your secret API key in the request header using api-key.
  • Refunds can be full or partial depending on whether the amount is specified.

๐Ÿ“ฎ Endpoint

POST https://api.transactpay.co/refund/order

๐Ÿ” Headers

HeaderTypeRequiredDescription
api-keystringโœ… YesYour Transactpay secret API key
Content-Typestringโœ… YesMust be application/json

๐Ÿ“ฆ Sample Request Payload

{
  "reference": "{{orderreference}}",
  "reason": "Customer requested a refund",
  "amount": "5000"
}

๐Ÿงพ Request Body Parameters

KeyTypeRequiredDescription
referencestringโœ… YesUnique identifier for the original order
reasonstringโŒ NoReason for the refund (optional, but recommended)
amountstringโŒ NoRefund amount. If omitted, the full order amount is refunded automatically.

โš ๏ธ

Important Notes

  • Omitting the amount will result in a full refund.
  • To process a partial refund, simply specify the amount.

๐Ÿ“ค Sample cURL Request

curl -X POST https://api.transactpay.co/refund/order \
  -H "api-key: YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "ORD-12345",
    "reason": "Product not received",
    "amount": "2500"
}'

โœ… Sample Success Response

{
  "status": true,
  "message": "Refund has been initiated",
  "data": {
    "reference": "ORD-12345",
    "amount_refunded": "2500",
    "status": "pending"
  }
}

๐Ÿ•“

Note

Refunds may take a short time to complete depending on the payment method used.

{
    "reference": "{{orderreference}}",
    "Reason": "",
    "Amount": ""
}