Create a payment link
How to create a payment link via API
To create a new payment link, send a POST request to the /api/2026-05/payment_links endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/2026-05/payment_links
Arguments
type
string
Required
attributes.amount_cents
integer
Optional, default to the payment session or order amount
attributes.currency_code
string
Optional, default to the payment session or order currency code
attributes.name
string
Optional
attributes.return_url
string
Optional
attributes.options
object
Optional
attributes._internal_version
string
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
relationships.order
object
Optional
relationships.billing_address
object
Optional
relationships.payment_setting
object
Required
relationships.payment_session
object
Optional
Example
The following request creates a new payment link:
On success, the API responds with a 201 Created status code, returning the created resource object:
Last updated