---
title: "POST /payments/create-intent"
method: POST
path: "/payments/create-intent"
---

# POST /payments/create-intent

`POST /payments/create-intent`

This API is the first API to be called when the payment flow begins. Through this API, you inform xPay of the intent of the user to pay with all the requisite info about the user.

## Headers

- `Idempotency-Key` string
- `x-connect-merchant-id` string

## Request body

- CreateIntent
  - `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)
  - `currency` string, required — Three letter abbreviation of the currency. Refer [supported currencies](/get-started/currencies-supported)
  - `receiptId` string — Your identifier of the order
  - `customerDetails` BillingDetails, required — Billing details for the customer.
    - `name` string, required — Customer's name
    - `email` string, required — Customer's email address
    - `contactNumber` string, required — Customer's contact number ([E.164 format](https://en.wikipedia.org/wiki/E.164)), including the country code (e.g., +1 for US, +44 for UK, +91 for India).
    - `customerAddress` CustomerAddress
      - `addressLine1` string — Line 1 of the customer's address
      - `addressLine2` string — Line 2 of the customer's address
      - `city` string — City of the customer's address
      - `state` string — State of the customer's address
      - `country` string — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
      - `postalCode` string — Postal code
  - `customerReferenceId` string — Your unique identifier for the customer. This can be used to associate the payment with a specific customer in your system.
  - `description` string — The description of the order, if any
  - `callbackUrl` string, required — The URL we will callback to with the xIntentId once it finishes.
  - `cancelUrl` string — The URL to redirect the customer to when they cancel the payment. If not provided, the callbackUrl will be used as fallback.
  - `paymentMethods` string[] — List of payment methods to be enabled for the link. [supported payment methods](/get-started/payment-methods-supported#payment-method-enums) 💡 If a selected payment method is unavailable, the system will automatically fallback to card payments to ensure a smooth checkout experience.
  - `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.
  - `phoneNumberRequired` boolean — Flag to indicate whether phone number is required from the customer during checkout. By default, this is false.
  - `customerId` string — The unique identifier for the customer, generated via the [create-customer API](/api-reference/customers/create-customer). This can be used to associate the payment with a specific customer in your system.
  - `storeFrontId` string — 🔵 **Beta Feature** - The unique identifier for your storefront. This ID is used to associate the payment with a specific storefront in your account. When provided, it will replace the default DBA and logo with the corresponding storefront's branding. This feature is currently in beta testing and may be subject to changes. To enable this feature, please contact [hello@xpaycheckout.com](mailto:hello@xpaycheckout.com)
  - `tokenise` boolean — This boolean tokenises and stores the card to showcase the same card in future. If sending this value, corresponding `customerId` is also required. You will receive [`payment_method_token.created`](/developer-resources/webhooks/events/setupMethodEvents/payment_method_token_created) webhook every time a new payment method token is created.
  - `productPage` ProductPage
    - `name` string, required — Product name. Must be between 2 and 100 characters long.
    - `description` string — Product description. Must be less than 500 characters long.
  - `allowedCardInstallmentTenures` string[] — Optional. Restricts which Card Installment (EMI) tenures (in months) are offered at checkout. If omitted, all tenures enabled on your account are offered.
  - `platformFeeInBps` integer — Optional additional fee in basis points (1 bps = 0.01%). Only available to Platform merchants when creating a payment intent on behalf of a Connect merchant (requires the `x-connect-merchant-id` header). See [Platform Connect](/products/platform-connect/overview).

## Response `200`

Create Intent response

- IntentDetailsResponse
  - `amount` integer — The amount in lowest count unit (e.g., cents for USD)
  - `currency` string — Three-letter currency code
  - `presentmentCurrency` string — The currency that the customer paid in
  - `receiptId` string — Your identifier for the order
  - `customerDetails` BillingDetails — Billing details for the customer.
    - `name` string, required — Customer's name
    - `email` string, required — Customer's email address
    - `contactNumber` string, required — Customer's contact number ([E.164 format](https://en.wikipedia.org/wiki/E.164)), including the country code (e.g., +1 for US, +44 for UK, +91 for India).
    - `customerAddress` CustomerAddress
      - `addressLine1` string — Line 1 of the customer's address
      - `addressLine2` string — Line 2 of the customer's address
      - `city` string — City of the customer's address
      - `state` string — State of the customer's address
      - `country` string — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
      - `postalCode` string — Postal code
  - `description` string — Description of the order, if any
  - `callbackUrl` string — Callback URL to notify order status
  - `cancelUrl` string — The URL to redirect the customer to when they cancel the payment.
  - `createdAt` string, date-time — Timestamp of when the intent was created
  - `status` string — Current status of the intent. Refer [payment statuses](/products/one-time-payments/payment-statuses)
  - `xIntentId` string — Unique identifier of the intent
  - `fwdUrl` string — The URL to redirect the customer to the xPay payment gateway for payment.
  - `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.

## Other responses

- `400` — unexpected error

---

[API](https://skmtc.net/xpaycheckout/apis/xpay-api-store.md) · [All operations](https://skmtc.net/xpaycheckout/apis/xpay-api-store/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xpaycheckout/xpay-api-store/versions/6329a7c694bc/schema)
