Skip to main content
POST
/
refunds
Create Refund
curl --request POST \
  --url https://quickei.io/pay/sandbox/api/v1/refunds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "transaction_id": "<string>",
  "amount": 123,
  "reason": "<string>",
  "reference": "<string>",
  "idempotency_key": "<string>"
}
'

Documentation Index

Fetch the complete documentation index at: https://developer.quickei.io/llms.txt

Use this file to discover all available pages before exploring further.

Refund a completed payment, either fully or partially. The merchant wallet is debited and the user wallet is credited.

Endpoint

POST https://quickei.io/pay/sandbox/api/v1/refunds

Parameters

transaction_id
string
required
The original payment transaction ID (e.g. TRX-98765).
amount
decimal
Amount to refund. Omit for a full refund. Must be greater than 0 and not exceed the remaining refundable amount.
reason
string
Reason for the refund (max 500 chars).
reference
string
Your internal reference for this refund (max 255 chars).
idempotency_key
string
Unique key to prevent duplicate refunds (max 64 chars).
Partial refunds: You can issue multiple partial refunds against the same transaction until the total refunded amount equals the original payment amount.

Example Request

curl -X POST https://quickei.io/pay/sandbox/api/v1/refunds \
  -H "Authorization: Basic {base64_credentials}" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "TRX-98765",
    "amount": 10.00,
    "reason": "Item returned",
    "reference": "RFD-2024-001",
    "idempotency_key": "idem_rfd_abc123"
  }'

Success Response 200

{
  "message": {
    "success": ["Refund created successfully"]
  },
  "data": {
    "refund_id": "RF-20240115-X7Y8Z9",
    "transaction_id": "TRX-98765",
    "amount": "10.00 EUR",
    "raw_amount": 10.00,
    "currency": "EUR",
    "status": "completed",
    "reason": "Item returned",
    "reference": "RFD-2024-001",
    "created_at": "2024-01-15T16:30:00+00:00"
  }
}

Response Fields

FieldDescription
refund_idUnique refund identifier (RF prefix)
transaction_idOriginal payment transaction ID
amountFormatted refund amount with currency
raw_amountNumeric refund amount
currencyISO 4217 currency code
statuspending, completed, or failed
reasonRefund reason (if provided)
referenceYour internal reference (if provided)
created_atISO 8601 timestamp

Error Responses

404 Transaction not found

{
  "message": {
    "error": ["Transaction not found"]
  }
}

422 Refund exceeds original amount

{
  "message": {
    "error": ["Refund amount exceeds the remaining refundable amount"]
  }
}

422 Transaction not refundable

{
  "message": {
    "error": ["Transaction is not eligible for refund"]
  }
}