Reimbursement (Refund)

Refund

The POST /v1/payin/{reference}/refund endpoint allows you to partially or fully refund a previously validated customer payment (Payin).

This operation credits the customer's account or cancels the transaction depending on the initial settlement method.


Endpoint

ElementDescription
MethodPOST
URL/v1/payin/{reference}/refund
AuthAuthorization: Basic base64(api_key:api_client)
IdempotenceX-Idempotency-Key required
Payload Typeapplication/json

Purpose

  • Perform a full refund of a validated payment.
  • Perform a partial refund if the refunded amount is less than the original payment.
  • Restore consistency between customer transactions and merchant balances.
  • Automate dispute and cancellation management.

Request Example

POST /v1/payin/tr_fhchi842jyimwiugjgszcxvb8n/refund

Headers

KeyDescriptionRequired
AuthorizationBasic base64(api_key:api_client)
X-Idempotency-KeyUUID ensuring request uniqueness

Request Body

{
  "amount": 150,
  "reason": "Client cancellation",
  "externalReference": "refund_9843b-9911c-qa87"
}

Response Example

{
  "type": "refund",
  "reference": "rf_fhchi842jyimwiugjgszcxvb8n",
  "originalReference": "tr_fhchi842jyimwiugjgszcxvb8n",
  "amount": 150,
  "fee": 0,
  "currency": "XOF",
  "status": "processing",
  "reason": "Client cancellation",
  "refundType": "partial",
  "customerMsisdn": "+2250702968786",
  "customerName": "John",
  "createdAt": "2025-08-23T12:34:48.189Z",
  "transaction": {
    "reference": "tr_rf84dhf9pqiuhd38",
    "status": "pending",
    "processedAt": null
  }
}

Field Interpretation

FieldDescription
typeOperation type (refund).
referenceUnique refund identifier.
originalReferenceReference of the original payment to refund.
amountAmount to refund.
feeAssociated fees (if applicable).
currencyRefund currency (XOF, USD, etc.).
statusRefund status (pending, processing, completed, failed).
reasonRefund reason provided by the merchant.
refundTypeRefund type (full or partial).
customerMsisdnPhone number of the refunded customer.
customerNameCustomer's name.
createdAtRefund request creation timestamp.
transactionRefund transaction details on the Core System side.

Refund Statuses

StatusDescription
pendingRequest received, awaiting processing.
processingRefund in progress.
completedRefund validated and credited to customer.
failedRefund refused or rejected (insufficient funds, deadline exceeded, etc.).
reversedAmount returned to merchant after failure or manual cancellation.

Difference Between Full and Partial Refund

TypeDescriptionCondition
Full (full)Complete refund of the initial amount.amount = original payment amount
Partial (partial)Refund of part of the initial amount.amount < original payment amount

💡 A payment can be partially refunded multiple times, as long as the total refunded amounts ≤ initial amount.


Refund Verification

Once the refund is initiated, its status can be tracked via:

GET /v1/payin/{reference}

or via webhooks:

EventDescription
refund.processingRefund in progress.
refund.completedRefund executed successfully.
refund.failedRefund refused.

Constraints and obligation

RuleDescription
Unique refund per referenceEach refund generates a new reference (rf_...).
Maximum amountCannot exceed the original transaction amount.
Time windowA refund can only be requested during the authorized period (e.g., 7 days after payment).
Available fundsThe merchant must have sufficient balance to cover the refund.
SecurityHMAC signature verification and refund logging

Possible Errors

CodeMessageProbable CauseRecommended Action
400Invalid amountAmount greater than original paymentVerify the amount
401UnauthorizedInvalid authenticationVerify API key
403Refund not allowedNon-refundable transactionCheck refund conditions
404Payment not foundReference not foundVerify original reference
409Duplicate refundRefund already attemptedUse a different idempotency key
500Internal Server ErrorServer errorRetry later

Common Use Cases

CaseExampleDescription
Customer cancellationreason: "Client cancellation"User cancels their order after payment.
Partial refundamount: 500Merchant partially refunds a purchase.
Billing errorreason: "Duplicate charge"Duplicate payment to refund.

Transaction Types

TypeCustomer ConfirmationMobile Money InteractionNotification
Triggered payment✅ Yes❌ No✅ Yes
Internal transfer (P2P)❌ No❌ No✅ Yes