Skip to content

Create a checkout session

POST
/v1/checkout/sessions

Creates a hosted checkout session and returns a one-time public URL. The customer tops up their wallet (eSewa/Khalti) and authorizes the subscription there. Listen for subscription.created to fulfil.

Idempotency-Key
required
string
<= 255 characters

A client-generated unique key (UUID recommended). Required on all POST/PATCH/DELETE. Retrying with the same key returns the original response for 24 hours.

object
priceId
required
string
price_01ARZ3NDEKTSV4RRFFQ69G5FAY
customerId

Optional — pre-bind to an existing customer.

string
successUrl
string format: uri
cancelUrl
string format: uri
metadata

Up to 50 key/value string pairs you can attach to an object. Trile ignores them; they’re returned on every read.

object
key
additional properties
string
{
"internal_user_id": "42"
}

Session created.

object
id
string
cs_01ARZ3NDEKTSV4RRFFQ69G5FB9
token

One-time token embedded in the public URL.

string
publicUrl
string format: uri
https://checkout.trile.app/cs_...