Hosted Checkout
Create a Payment Session
Creates a new Hosted Checkout session. Tonder returns a URL for you to redirect your customer to complete the payment. The session tracks the overall payment state and can handle multiple payment attempts if the first one fails.
post/checkout/v1/sessions
Request body
Example request
{
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"amount_total": 35000,
"currency": "MXN",
"line_items": [
{
"name": "Product 1",
"quantity": 1,
"unit_price": 15000,
"product_id": "prod-12345"
}
],
"external_id": "ORD-12345",
"expires_at": 1751063448,
"success_url": "https://my-store.com/order/success",
"return_url": "https://my-store.com/checkout/complete",
"payment_method_types": [
"card"
],
"checkout_type": "hosted",
"session_type": "payment",
"ui_config_version": "V1",
"ui_config": {
"branding": {
"brand_color": "#1A2B3C"
},
"theme": {
"shapes": "rounded"
}
}
}Response
Session created successfully
Example response
{
"id": "cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d",
"url": "https://stage-payflow.tonder.io/checkout/cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d",
"status": "pending",
"payment_id": 41521,
"amount_total": 35000,
"currency": "MXN",
"expires_at": 1751564943,
"external_id": "ORD-12345",
"session_type": "payment",
"checkout_type": "hosted",
"payment_method_types": [
"card"
],
"ui_config_version": "V1",
"created_at": 1751478543567,
"modified_at": 1751478543567,
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"transaction_status": "Pending",
"provider": "tonder"
}