Skip to main content
POST
/
api
/
v1
/
payments
/
{paymentId}
/
refund
cURL
curl --request POST \
  --url http://localhost:8080/api/v1/payments/{paymentId}/refund \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "refundAmount": 12997
}
'
{
  "paymentId": "pay_1234567890abcdef",
  "merchantReference": "ORDER-12345",
  "amount": 12997,
  "currency": "USD",
  "status": "REFUNDED",
  "paymentMethod": {
    "type": "card",
    "card": {
      "bin": "41111111",
      "holderName": "John Doe",
      "cvvPresentDuringAttempt": true,
      "expiryMonth": "12",
      "expiryYear": "2025",
      "brand": "VISA"
    }
  },
  "captureNow": false,
  "descriptor": "MyStore Online",
  "goodsType": "MIXED",
  "productItems": [
    {
      "id": "PROD-001",
      "name": "Wireless Keyboard",
      "quantity": 2,
      "unitPrice": 4999,
      "goodsType": "PHYSICAL"
    },
    {
      "id": "PROD-002",
      "name": "E-Book Subscription",
      "quantity": 1,
      "unitPrice": 2999,
      "goodsType": "DIGITAL"
    }
  ],
  "consumer": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]"
  },
  "billing": {
    "firstName": "John",
    "lastName": "Doe",
    "address": {
      "line1": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postalCode": "10001",
      "country": "US"
    }
  },
  "shipping": {
    "firstName": "John",
    "lastName": "Doe",
    "address": {
      "line1": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postalCode": "10001",
      "country": "US"
    }
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T11:00:00Z"
}

Authorizations

Authorization
string
header
required

Enter your API token

Path Parameters

paymentId
string
required

Body

application/json

Only required when performing a partial refund. For a full refund, this object can be omitted.

refundAmount
integer

Amount to refund in the smallest currency unit.

Required range: x >= 1
Example:

12997

Response

OK

paymentId
string

Unique identifier for the payment generated by the system.

Example:

"pay_1234567890abcdef"

merchantReference
string

Reference passed in by the merchant for correlation.

Example:

"ORDER-12345"

amount
integer

Amount processed in the smallest currency unit.

Example:

12997

currency
string

ISO 4217 currency code used in the payment.

Example:

"USD"

status
enum<string>

Current state of the payment.

Available options:
PENDING,
AUTHORIZED,
CAPTURED,
REFUNDED,
VOIDED,
FAILED
Example:

"CAPTURED"

paymentMethod
object

The chosen payment method details (e.g., card). Sensitive fields are masked in responses.

captureNow
boolean

Determines how the payment is processed. Default: false → Authorization only (funds reserved, must capture later). If true → Sale (authorize and capture in one step).

Example:

true

descriptor
string

Text shown on the customer's bank statement (e.g., merchant or product name).

Example:

"MyStore Online"

goodsType
enum<string>

Type of goods being purchased: PHYSICAL = tangible items, DIGITAL = non-physical items, MIXED = combination of both.

Available options:
PHYSICAL,
DIGITAL,
MIXED
Example:

"MIXED"

productItems
object[]

List of product or service items included in this payment.

Example:
[
{
"id": "PROD-001",
"name": "Wireless Keyboard",
"quantity": 2,
"unitPrice": 4999,
"goodsType": "PHYSICAL"
},
{
"id": "PROD-002",
"name": "E-Book Subscription",
"quantity": 1,
"unitPrice": 2999,
"goodsType": "DIGITAL"
}
]
consumer
object

Consumer details such as name, email, phone.

billing
object

Billing address information.

shipping
object

Shipping address and recipient details.

createdAt
string<date-time>

Timestamp when the payment was created.

Example:

"2024-01-15T10:30:00Z"

updatedAt
string<date-time>

Timestamp when the payment was last updated.

Example:

"2024-01-15T11:00:00Z"