Skip to main content
POST
/
api
/
v1
/
payments
cURL
curl --request POST \
  --url http://localhost:8080/api/v1/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 12997,
  "currency": "USD",
  "paymentMethod": {
    "type": "CARD",
    "card": {
      "number": "4111111111111111",
      "holderName": "John Doe",
      "expiryMonth": "12",
      "expiryYear": "2025",
      "cvv": "123",
      "brand": "VISA"
    }
  },
  "merchantReference": "PAYMENT-12345",
  "goodsType": "MIXED",
  "captureNow": true,
  "descriptor": "MyStore Online",
  "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",
    "email": "[email protected]",
    "lastName": "Doe",
    "phone": "+1234567890",
    "ip": "192.168.1.1"
  },
  "billing": {
    "address": {
      "street": "123 Main Street",
      "city": "San Francisco",
      "country": "US",
      "state": "CA",
      "zip": "94105"
    }
  },
  "shipping": {
    "address": {
      "street": "123 Main Street",
      "city": "San Francisco",
      "country": "US",
      "state": "CA",
      "zip": "94105"
    },
    "firstName": "Jane",
    "lastName": "Smith"
  },
  "previousFailures": [
    {
      "gateway": "AcquirerX",
      "attemptNumber": 1,
      "responseCode": "05",
      "reason": "Do not honour",
      "timestamp": "2025-11-05T14:22:10Z"
    },
    {
      "gateway": "ProcessorY",
      "attemptNumber": 2,
      "responseCode": "14",
      "reason": "Invalid card number",
      "timestamp": "2025-11-05T14:24:32Z"
    }
  ]
}
'
{
  "paymentId": "pay_1234567890abcdef",
  "merchantReference": "ORDER-12345",
  "amount": 12997,
  "currency": "USD",
  "status": "CAPTURED",
  "paymentMethod": {
    "type": "CARD",
    "card": {
      "bin": "41111111",
      "holderName": "John Doe",
      "expiryMonth": "12",
      "expiryYear": "2025",
      "last4": "1111",
      "cvvPresentDuringAttempt": true,
      "brand": "VISA"
    }
  },
  "captureNow": true,
  "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",
    "email": "[email protected]",
    "lastName": "Doe",
    "phone": "+1234567890",
    "ip": "192.168.1.1"
  },
  "billing": {
    "address": {
      "street": "123 Main Street",
      "city": "San Francisco",
      "country": "US",
      "state": "CA",
      "zip": "94105"
    }
  },
  "shipping": {
    "address": {
      "street": "123 Main Street",
      "city": "San Francisco",
      "country": "US",
      "state": "CA",
      "zip": "94105"
    },
    "firstName": "Jane",
    "lastName": "Smith"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T11:00:00Z"
}

Authorizations

Authorization
string
header
required

Enter your API token

Headers

User-Agent
string

Body

application/json
amount
integer
required

Payment amount in the smallest currency unit (e.g., cents).

Example:

12997

currency
string
required

Three-letter ISO 4217 currency code (e.g., USD, EUR).

Example:

"USD"

paymentMethod
object
required

The chosen payment method details (e.g., card).

merchantReference
string
required

Merchant's unique identifier for this payment (idempotency/business tracking).

Example:

"PAYMENT-12345"

goodsType
enum<string>
required

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

Available options:
PHYSICAL,
DIGITAL,
MIXED
Example:

"MIXED"

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"

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.

previousFailures
object[]

Array of previous failed payment attempts with other providers.

Example:
[
{
"gateway": "AcquirerX",
"attemptNumber": 1,
"responseCode": "05",
"reason": "Do not honour",
"timestamp": "2025-11-05T14:22:10Z"
},
{
"gateway": "ProcessorY",
"attemptNumber": 2,
"responseCode": "14",
"reason": "Invalid card number",
"timestamp": "2025-11-05T14:24:32Z"
}
]

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"