v1

latestOpenAPI 3.0.1MIT2026-07-26336777.7 KB

post/payments/s2s/charge-raw-card

Headers

Idempotency-Keystring

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

Request body

amountinteger 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)

currencystring required

Three letter abbreviation of the currency. Refer supported currencies

receiptIdstring

Your identifier for the order

callbackUrlstring required

URL that the customer will be redirected to once the payment is processed in case 3ds authentication is required.

metadataobject

A collection of key-value pairs that can be attached to an object for storing additional structured information. This is useful for capturing custom data or context-specific attributes.

Constraints:

  • Maximum of 50 key-value pairs allowed.
  • Each key must be no longer than 40 characters.
  • Each value must be a string and cannot exceed 500 characters.
customerIdstring

The unique identifier for the customer, generated via the create-customer API. This can be used to associate the payment with a specific customer in your system.

customerReferenceIdstring

Your unique identifier for the customer. This can be used to associate the payment with a specific customer in your system.

Example request

{
  "amount": 2000,
  "currency": "USD",
  "receiptId": "order123",
  "cardDetails": {
    "cardHolderName": "John Doe",
    "cardNumber": "4000002500000003",
    "expiryMonth": 1,
    "expiryYear": 28,
    "cvv": "123",
    "country": "US",
    "postalCode": "2424"
  },
  "callbackUrl": "https://example.com/callback",
  "metadata": {
    "orderId": "12345",
    "customerNote": "Deliver after 5 PM"
  },
  "customerId": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
  "customerReferenceId": "eTfd3Jq1tZxPjYVhRQW2r3",
  "customerDetails": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "contactNumber": "+919123456789",
    "customerAddress": {
      "addressLine1": "123 Main St",
      "addressLine2": "Apt 1",
      "city": "New York",
      "state": "NY",
      "country": "US",
      "postalCode": "2424"
    }
  }
}

Response

Charge raw card response

intentIdstring required

Identifier of the payment intent created for this charge.

nextActionRedirectionURLstring required

URL to redirect your customer to xpay's secure link to complete any pending 3DS or next action steps. Present only when additional authentication is required.

errorCodestring

Machine readable failure reason when status is FAILED. See all possible values here.

Example response

{
  "intentId": "in_gKAqR0DjLeOihdTE",
  "nextActionRedirectionURL": "https://pay.xpaycheckout.com/?id=67f53a6e2097773e4f0112c8",
  "errorCode": "insufficient_funds"
}