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<uuid>
required

Product ID.

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.

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>
productId
string<uuid>
token
string

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

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.

active
boolean

false once revoked.

revokedAt
string<date-time> | null

When the link was revoked.

createdAt
string<date-time>
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.