Xtopay Docs
Payments

Refunds

Issue full or partial refunds on succeeded payments.

Overview

Refunds return money to the original payment method. For card payments, the refund appears on the customer's card statement within 5–10 business days. For mobile money and bank transfers, it arrives within 1–2 business days.

Create a refund

// Full refund
const refund = await xtopay.refunds.create({
  payment_id: "pay_abc123",
  reason: "customer_request",
});

// Partial refund
const refund = await xtopay.refunds.create({
  payment_id: "pay_abc123",
  amount: 2500,  // must be ≤ remaining refundable amount
  reason: "order_partially_cancelled",
});

Refund object

{
  "id": "ref_a1b2c3",
  "payment_id": "pay_abc123",
  "amount": 5000,
  "currency": "GHS",
  "status": "succeeded",
  "reason": "customer_request",
  "created_at": "2026-05-24T12:00:00Z",
  "processed_at": "2026-05-24T12:00:04Z"
}

Refund status

StatusMeaning
pendingRefund queued
processingSent to payment network
succeededMoney returned to customer
failedRefund rejected — contact support

Reasons

ReasonDescription
customer_requestCustomer asked for a refund
duplicatePayment was charged twice
fraudulentSuspected fraudulent transaction
order_partially_cancelledPart of an order was cancelled
otherAny other reason

Restrictions

  • Only succeeded payments can be refunded
  • You can issue multiple partial refunds up to the original amount
  • Refunds must be issued within 180 days of the original payment
  • Refunds cannot be cancelled once initiated

Webhook events

EventFired when
refund.createdRefund is initiated
refund.succeededMoney returned to customer
refund.failedRefund could not be processed

On this page