Create a payment link
order_create_payment_linkCreate a Stripe embedded-checkout link, only when the customer asks to pay.
The payment link is the order: the customer sees it here for the first time. It attaches each cart line's design and checks its print file. Until the order is paid, a later link attaches a changed design again. Never create it just because the customer picked or finished a design: the link is the order.
Every line needs artwork first: a design, or the customer's own finished file
uploaded through order_get_artwork_upload_page. LinesWithoutArtworkError
names the lines that have none. A line whose design was made before the
product was chosen needs design_adapt first (AdaptStepRequiredError). Each design goes on with its latest version.
CheckoutRenderFailedError names a line whose print file failed: that line
needs new artwork. Any other failure keeps what was done, so call again once
the cause is fixed. NoSnapshotError
means a design is not saved yet; a photo book can take a few minutes after it
resolves. Wait a little and call this again.
A product this link does not pay for needs a checkout link of its own:
other_lines names those products. Tell
the customer they need a new checkout link, and call this again when they ask
to pay for them. Pass order_id only to pay an order that already had a
payment link.
After a line changed, pass the offer the customer chose from its new quote in
offer_ids, so the link changes that item on the order.
Returns a job — poll until SUCCEEDED for the checkout_url. Put
checkout_url in your reply as a markdown hyperlink (never the raw URL),
and call order_get yourself to confirm payment. When the payment card is
displayed, it shows a "Pay securely" button wired to the link and polls
order_get itself once clicked, so just confirm the payment step is ready
and share the link again only if the customer asks for it. From here on, reference_id is
the customer's order reference.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>"
},
"name": "order_create_payment_link"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | No | ||
| offer_ids | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |