POST/v1/transactions/:id/refund

Refund 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

ParameterTypeRequiredDescription
amountstringNoPartial refund amount; omit for full refund
reasonstringNoInternal refund reason

Response fields

FieldTypeDescription
refund_idstringRefund transaction ID
statusstringpending | completed | failed
amountstringRefunded 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"
  }
}