Skip to main content
POST
/
lps
/
payment-links
Create payment link
curl --request POST \
  --url https://api.cheqpay.dev/lps/payment-links \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "products": [
    {
      "id": "<string>",
      "name": "<string>",
      "qty": 2,
      "price": 1,
      "total": 1,
      "description": "<string>",
      "imageUrl": "<string>",
      "isQtyAdjustable": true,
      "minQty": 123,
      "maxQty": 123
    }
  ],
  "totals": {
    "total": 1,
    "taxes": 1,
    "shipping": 1,
    "fees": 1,
    "discounts": 1
  },
  "paymentMethods": [
    "CARD"
  ],
  "type": "products_subscriptions",
  "currency": "MXN",
  "numberOfPayments": 2,
  "isDraft": true,
  "isEnabled": true,
  "redirectUrl": "<string>",
  "reference": "<string>",
  "defaults": {
    "billingAddress": {
      "firstName": "<string>",
      "lastName": "<string>",
      "organizationName": "<string>",
      "email": "[email protected]",
      "phone": "<string>",
      "addressLine1": "<string>",
      "addressLine2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postalCode": "<string>",
      "country": "<string>",
      "isSameAsShipping": true
    },
    "shippingAddress": {
      "firstName": "<string>",
      "lastName": "<string>",
      "organizationName": "<string>",
      "email": "[email protected]",
      "phone": "<string>",
      "addressLine1": "<string>",
      "addressLine2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postalCode": "<string>",
      "country": "<string>"
    }
  },
  "metadata": {},
  "expiresAt": "2023-11-07T05:31:56Z"
}
'
{
  "_id": "<string>",
  "url": "<string>",
  "id": "<string>",
  "merchantId": "<string>",
  "type": "products_subscriptions",
  "products": [
    {
      "id": "<string>",
      "name": "<string>",
      "qty": 2,
      "price": 1,
      "total": 1,
      "description": "<string>",
      "imageUrl": "<string>",
      "isQtyAdjustable": true,
      "minQty": 123,
      "maxQty": 123
    }
  ],
  "currency": "<string>",
  "totals": {
    "total": 1,
    "taxes": 1,
    "shipping": 1,
    "fees": 1,
    "discounts": 1
  },
  "numberOfPayments": 2,
  "paymentMethods": [
    "<string>"
  ],
  "isDraft": true,
  "isEnabled": true,
  "redirectUrl": "<string>",
  "reference": "<string>",
  "defaults": {
    "billingAddress": {
      "firstName": "<string>",
      "lastName": "<string>",
      "organizationName": "<string>",
      "email": "[email protected]",
      "phone": "<string>",
      "addressLine1": "<string>",
      "addressLine2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postalCode": "<string>",
      "country": "<string>",
      "isSameAsShipping": true
    },
    "shippingAddress": {
      "firstName": "<string>",
      "lastName": "<string>",
      "organizationName": "<string>",
      "email": "[email protected]",
      "phone": "<string>",
      "addressLine1": "<string>",
      "addressLine2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postalCode": "<string>",
      "country": "<string>"
    }
  },
  "metadata": {},
  "expiresAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

API key for merchant authentication

Body

application/json

Request to create a payment link

products
object[]
required

Products in the payment link

totals
object
required

Payment link totals

paymentMethods
enum<string>[]
required

Available payment methods

Minimum array length: 1
Available options:
CARD
type
enum<string>
default:products_subscriptions

Payment link type

Available options:
products_subscriptions
currency
string
default:MXN

Currency code

numberOfPayments
number

How many payments you want to allow for this payment link

Required range: x >= 1
isDraft
boolean
default:true

Whether the payment link is a draft

isEnabled
boolean
default:true

Whether the payment link is enabled

redirectUrl
string

The URL to which Cheqpay will redirect the customer after the payment is completed, regardless of success or failure. This URL will include status and invoiceId parameters. Example: https://yourdomain.com[...]?cp_status={status}&cp_invoice_id={invoiceId}

reference
string

Merchant reference for the payment link

defaults
object

Default values for customer choice payment links

metadata
object

Additional metadata

expiresAt
string<date-time>

Expiration date

Response

Payment link created successfully

Payment link entity

_id
string

Payment link ID

url
string

Payment link URL

id
string

Unique payment link identifier

merchantId
string

Merchant identifier

type
enum<string>

Payment link type

Available options:
products_subscriptions,
customer_choice
products
object[]

Products in the payment link

currency
string

Currency code (3 letters)

totals
object

Payment link totals

numberOfPayments
number

Number of payments for subscription

Required range: x >= 1
paymentMethods
string[]

Available payment methods

Minimum array length: 1
isDraft
boolean

Whether the payment link is a draft

isEnabled
boolean

Whether the payment link is enabled

redirectUrl
string

URL to redirect after payment completion

reference
string

Merchant reference for the payment link

defaults
object

Default values for customer choice payment links

metadata
object

Additional metadata

expiresAt
string<date-time>

Expiration date

createdAt
string<date-time>

Creation timestamp

updatedAt
string<date-time>

Last update timestamp