Zum Hauptinhalt springen
Version: 1.0.1

Refunds

Refunds allow you to return funds to customers for completed transactions. This guide covers creating and managing refunds.

Overview

A refund represents a return of funds for a transaction. Refunds can be:

  • Full refund: Return the entire transaction amount
  • Partial refund: Return a portion of the transaction amount

Create a Refund

POST /api/refund/create

Request Body

FieldTypeRequiredDescription
transactionIdStringYesTransaction ID to refund
amountLongNoRefund amount in cents (omit for full refund)
reasonStringNoReason for refund
refundTypeStringYesFULL or PARTIAL

Example

curl -X POST http://localhost:8080/api/refund/create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{
"transactionId": "TXN2026081800001",
"amount": 50000,
"reason": "Customer request",
"refundType": "PARTIAL"
}'

Refund Status

StatusDescription
PENDINGRefund initiated, awaiting processing
PROCESSINGRefund is being processed
SUCCEEDEDRefund completed successfully
FAILEDRefund failed
CANCELLEDRefund cancelled

Refund Limits

  • Full refunds must be within 180 days of the original transaction
  • Partial refunds cannot exceed the remaining refundable amount
  • Multiple partial refunds are allowed until total reaches transaction amount

List Refunds

GET /api/refund/list?transactionId={transactionId}

Code Examples

Node.js

const refund = await client.refunds.create({
transactionId: 'TXN2026081800001',
amount: 50000,
reason: 'Customer request',
});

// Full refund
const fullRefund = await client.refunds.create({
transactionId: 'TXN2026081800001',
refundType: 'FULL',
});