Skip to main content
POST
Create an order checkout session
Once you have created a draft order, use this endpoint to generate a checkout session that lets the buyer complete the order details – including selecting a payment term and confirming the purchase amount – within Tilta’s hosted checkout UI. The response provides both a short-lived JWT token (for embedding the checkout flow via the Tilta JS SDK) and a pre-built hosted URL (for a full-page redirect). The session is scoped to the specific draft order and expires shortly after creation, so generate it only when you are ready to redirect the buyer.
Checkout sessions are single-use and short-lived. Do not cache the token or url across page loads – call this endpoint fresh each time a buyer is about to enter the checkout flow.
When using the hosted URL redirect approach, listen for the ORDER.CONFIRMED webhook event to know when the buyer has completed the draft order and it is ready for invoicing.

Authorizations

Authorization
string
header
required

Your Tilta API key, sent as Bearer <key>.

Path Parameters

external_id
string
required

Unique identifier of an order.

Maximum string length: 100
Pattern: ^[a-zA-Z0-9-_]+$

Body

application/json
success_url
string<uri>
error_url
string<uri>

Response

JWT token and hosted checkout URL to authenticate a buyer in the order checkout flow. The token is valid for 2h.

token
string
required
url
string
required