Skip to main content
POST
Create a payment link

Authorizations

Authorization
string
header
required

Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.

Path Parameters

productID
string
required

Product ID.

Pattern: ^prod_[0-9A-Za-z]{22}$
Example:

"prod_1d4YogBuw00jAySh5mbUpk"

Body

application/json

Optional. A link needs no configuration; send a body only to set where the payer goes afterwards, or to sell an offer. URLs must be absolute http(s).

successUrl
string | null

Where the payer goes after paying, with ?status=success&invoice=… appended.

Maximum string length: 2048
cancelUrl
string | null

Offered to the payer as "back to the store" while the checkout is open.

Maximum string length: 2048
productVersionId
string<uuid> | null

Sells a specific published version instead of the default. This is how a promotional price reaches a buyer: the version is published with default: false, and only a link that names it can sell it. Omit it to sell the default version. Refused if the version is not a published version of this product.

appearance
object

Response

Link created.

A reusable, revocable payment link bound to a product. Anyone holding it can open the checkout; it is meant to be copied and shared.

id
string<uuid>
required
productId
string
required
Pattern: ^prod_[0-9A-Za-z]{22}$
Example:

"prod_1d4YogBuw00jAySh5mbUpk"

token
string
required

The link's public token, part of the url.

active
boolean
required

false once revoked.

appearance
object
required
createdAt
string<date-time>
required
url
string

The address to send the payer. Use this value instead of building the URL yourself.

productVersionId
string<uuid> | null

The product version this link sells, fixed at creation. Publishing a new version does not reprice a link already issued. When null, the link sells the latest published version at payment time.

revokedAt
string<date-time> | null

When the link was revoked.

successUrl
string | null

Where the payer goes after paying, with ?status=success&invoice=… appended.

cancelUrl
string | null

Offered to the payer as "back to the store" while the checkout is open; also the ?status=error destination when the charge expires in the embedded checkout.