POST
/v1/transactions/:id/refundRefund transaction
Initiates a full or partial refund for a completed payment.
Authentication
Secret Key — send Authorization: Bearer YOUR_KEY header.
Feature required
Requires refunds enabled on your API app.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | No | Partial refund amount; omit for full refund |
reason | string | No | Internal refund reason |
Response fields
| Field | Type | Description |
|---|---|---|
refund_id | string | Refund transaction ID |
status | string | pending | completed | failed |
amount | string | Refunded amount |
Code examples
bash
curl -X POST https://api.watenga.africa/v1/transactions/txn_01HQXYZ/refund \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Customer request"
}'Response example
json
{
"success": true,
"data": {
"refund_id": "txn_refund_01HQ",
"status": "pending",
"amount": "25.00"
}
}