Skip to main content
POST
/
payments
/
merchant
/
refund
cURL
curl --request POST \
  --url https://api.xpaycheckout.com/payments/merchant/refund \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "xIntentId": "in_fooBOwYsaK50AEfK",
  "amount": "200"
}
'
{
  "refundId": "rf_fooBOwYsaK50AEaJ",
  "intentId": "in_fooBOwYsaK50AEfK",
  "amount": 2000,
  "currency": "USD",
  "refundedAt": 1727340330123
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Headers

Idempotency-Key
string

A unique key for making the request idempotent. Must match pattern: ^[a-zA-Z0-9\-_:\.]+$. See Idempotent Requests for more details.

Maximum string length: 255

Body

application/json

Refund API

xIntentId
string
required

Unique identifier of the intent

Example:

"in_fooBOwYsaK50AEfK"

amount
string

The amount you want to refund, specified in the smallest unit of the currency (for example, cents for USD, paise for INR).

  • If you want to issue a partial refund, provide the amount you wish to refund here. For example, if the original payment was $100 (i.e., 10000 cents), and you want to refund $20, you would enter 2000.
  • If you leave this field blank, the full payment amount will be refunded automatically.
Example:

"200"

Response

Refund API response

refundId
string
required

Unique identifier of the refund

Example:

"rf_fooBOwYsaK50AEaJ"

intentId
string
required

Unique identifier of the payment intent

Example:

"in_fooBOwYsaK50AEfK"

amount
integer<int64>
required

The amount in lowest count unit. e.g.: For USD 1, amount is 100 representing 100 cents (The minimum amount should be greater than 1 USD)

Example:

2000

currency
string
required

Three letter abbreviation of the currency. Refer supported currencies

Example:

"USD"

refundedAt
integer<int64>
required

Epoch timestamp in milliseconds of when the refund was processed

Example:

1727340330123