Skip to main content
POST
/
payments
/
s2s
/
charge-raw-card
cURL
curl --request POST \
  --url https://api.xpaycheckout.com/payments/s2s/charge-raw-card \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customerDetails": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "contactNumber": "+919123456789",
    "customerAddress": {
      "country": "US",
      "postalCode": "2424"
    }
  },
  "amount": 2000,
  "currency": "USD",
  "receiptId": "order123",
  "cardDetails": {
    "cardNumber": "4000002500000003",
    "expiryMonth": 1,
    "expiryYear": 28,
    "cvv": "123"
  },
  "offSession": "false",
  "callbackUrl": "https://example.com/callback",
  "metadata": {
    "orderId": "12345",
    "customerNote": "Deliver after 5 PM"
  }
}'
{
"status": "SUCCESS",
"intentId": "in_gKAqR0DjLeOihdTE"
}
Charge a customer’s card directly from your servers without presenting the checkout.
  • Use this endpoint when you already gathered card details and consent within your PCI DSS compliant environment
  • You must obtain explicit approval from hello@xpaycheckout.com before using this API

Authorizations

Authorization
string
header
required

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

Body

application/json
customerDetails
object
required
amount
integer
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"

cardDetails
object
required

Payment card information collected by you

callbackUrl
string
required

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

Example:

"https://example.com/callback"

receiptId
string

Your identifier for the order

Example:

"order123"

offSession
boolean
default:false

Indicates if the payment is being processed in a different session than the one where the card details were collected.

Example:

"false"

metadata
object

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.
Example:
{
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
}

Response

Charge raw card response

status
enum<string>
required

Current state of the charge attempt.

Available options:
CREATED,
SUCCESS,
FAILED
Example:

"SUCCESS"

intentId
string
required

Identifier of the payment intent created for this charge.

Example:

"in_gKAqR0DjLeOihdTE"

nextActionRedirectionURL
string

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.

Example:

"https://pay.xpaycheckout.com/?id=67f53a6e2097773e4f0112c8"

errorCode
string

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

Example:

"insufficient_funds"