Skip to main content
GET
/
payments
/
v2
/
get-intent
/
{xIntentId}
cURL
curl --request GET \
  --url https://api.xpaycheckout.com/payments/v2/get-intent/{xIntentId} \
  --header 'Authorization: Basic <encoded-value>'
{
  "amount": 100,
  "currency": "USD",
  "presentmentCurrency": "USD",
  "receiptId": "order123",
  "customerDetails": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "contactNumber": "+919123456789",
    "customerAddress": {
      "country": "US",
      "postalCode": "2424"
    }
  },
  "description": "Order for 2 items",
  "callbackUrl": "https://example.com/callback",
  "cancelUrl": "https://example.com/cancel",
  "createdAt": "2024-09-26T10:41:50.472+00:00",
  "status": "CREATED",
  "xIntentId": "in_fooBOwYsaK50AEfK",
  "succeededAt": 1727340330123,
  "metadata": {
    "orderId": "12345",
    "customerNote": "Deliver after 5 PM"
  },
  "chargeAttempts": [
    {
      "status": "FAILED",
      "paymentMetadata": {
        "paymentMethod": "CARD",
        "cardMetadata": {
          "brand": "Visa",
          "country": "US",
          "lastFourDigit": "4242",
          "expiryMonth": 12,
          "expiryYear": 2025
        }
      },
      "chargeTime": 1727340330123,
      "errorCode": "card_declined"
    },
    {
      "status": "SUCCESS",
      "paymentMetadata": {
        "paymentMethod": "CARD",
        "cardMetadata": {
          "brand": "Visa",
          "country": "US",
          "lastFourDigit": "4242",
          "expiryMonth": 12,
          "expiryYear": 2025
        }
      },
      "chargeTime": 1727340331123,
      "errorCode": null
    }
  ],
  "succeededCharge": {
    "status": "SUCCESS",
    "paymentMetadata": {
      "paymentMethod": "CARD",
      "cardMetadata": {
        "brand": "Visa",
        "country": "US",
        "lastFourDigit": "4242",
        "expiryMonth": 12,
        "expiryYear": 2025
      }
    },
    "chargeTime": 1727340331123,
    "errorCode": null
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

xIntentId
string
required

Unique identifier of the intent

Example:

"in_fooBOwYsaK50AEfK"

Query Parameters

expand
enum<string>[]

List of fields to expand in the response. Available options:

  • charge_attempts : includes all charge attempts
  • succeeded_charge : includes the successful charge details

Response

Successful response with transaction status and related details

amount
integer

The amount in lowest count unit (e.g., cents for USD)

Example:

100

currency
string

Three-letter currency code

Example:

"USD"

presentmentCurrency
string

The currency that the customer paid in

Example:

"USD"

receiptId
string

Your identifier for the order

Example:

"order123"

customerDetails
object
description
string

Description of the order, if any

Example:

"Order for 2 items"

callbackUrl
string

Callback URL to notify order status

Example:

"https://example.com/callback"

cancelUrl
string

The URL to redirect the customer to when they cancel the payment.

Example:

"https://example.com/cancel"

createdAt
string<date-time>

Timestamp of when the intent was created

Example:

"2024-09-26T10:41:50.472+00:00"

status
string

Current status of the intent.

Example:

"CREATED"

xIntentId
string

Unique identifier of the intent

Example:

"in_fooBOwYsaK50AEfK"

succeededAt
integer

Epoch timestamp in milliseconds of when the payment was successfully completed

Example:

1727340330123

metadata
object

A collection of key-value pairs that were provided when the object was created. These metadata values are echoed back in the response, allowing you to store and retrieve custom information such as context-specific attributes, references, or tags. This can be useful for correlating records in your system or attaching meaningful context to transactions.

Example:
{
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
}
chargeAttempts
object[]

List of all charge attempts for this intent. Only included when charge_attempts is specified in the expand parameter.

Example:
[
{
"status": "FAILED",
"paymentMetadata": {
"paymentMethod": "CARD",
"cardMetadata": {
"brand": "Visa",
"country": "US",
"lastFourDigit": "4242",
"expiryMonth": 12,
"expiryYear": 2025
}
},
"chargeTime": 1727340330123,
"errorCode": "card_declined"
},
{
"status": "SUCCESS",
"paymentMetadata": {
"paymentMethod": "CARD",
"cardMetadata": {
"brand": "Visa",
"country": "US",
"lastFourDigit": "4242",
"expiryMonth": 12,
"expiryYear": 2025
}
},
"chargeTime": 1727340331123,
"errorCode": null
}
]
succeededCharge
object

Details of the successful charge attempt. Only included when succeeded_charge is specified in the expand parameter and the payment was successful.

I