---
title: "POST /link/merchant/generate-link"
method: POST
path: "/link/merchant/generate-link"
---

# POST /link/merchant/generate-link

`POST /link/merchant/generate-link`

This API can be used to generate payment links programmatically. Payments links are basically standalone webpages where your customer can make a one time payment.

## Headers

- `Idempotency-Key` string

## Request body

- GenerateLink
  - `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
  - `description` string — The description of the order, if any
  - `expiryDate` integer, required — Timestamp in epoch milliseconds, indicating the expiration time of the link
  - `callbackUrl` string — 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.
  - `storeFrontId` string — 🔵 **Beta Feature** - The unique identifier for your storefront. This ID is used to associate the payment link 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)
  - `multiUseLimit` integer — The maximum number of times this payment link can be used. If null, the link can be used only once. Must be greater than 0 if provided.
  - `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.
  - `phoneNumberRequired` boolean — Flag to indicate whether phone number is required from the customer during checkout. By default, this is false.
  - `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.

## Response `200`

Generate Payment Link

- GenerateLinkResponse
  - `shortUrl` string — The shortened URL generated by the xPay API. This link can be shared with customers for completing payments.
  - `disclaimer` string — A message highlighting unsupported currency and payment method pairs. You may use this information to communicate these limitations to your users and set expectations.

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