๐ 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
Header | Type | Required | Description |
---|---|---|---|
api-key | string | โ Yes | Your Transactpay secret API key |
Content-Type | string | โ Yes | Must be application/json |
๐ฆ Sample Request Payload
{
"reference": "{{orderreference}}",
"reason": "Customer requested a refund",
"amount": "5000"
}
๐งพ Request Body Parameters
Key | Type | Required | Description |
---|---|---|---|
reference | string | โ Yes | Unique identifier for the original order |
reason | string | โ No | Reason for the refund (optional, but recommended) |
amount | string | โ No | Refund 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"
}
}
NoteRefunds may take a short time to complete depending on the payment method used.
{
"reference": "{{orderreference}}",
"Reason": "",
"Amount": ""
}