Crear sesión de pago
Crea una sesión de Hosted Checkout. Tonder devuelve la URL a la que rediriges a tu cliente para completar el pago. La sesión rastrea el estado general y admite varios intentos de pago.
Autorización
Authorization Your public API key, with the word Token and a space in front of it. Example: Token 6534bc0a7e1f4d2b9c8e3a5f7b1d2c4e6f8a9b0c — that whole value is the header. Sending the key alone returns 401 'Authentication credentials were not provided'. In this playground you may paste just the key; the prefix is added for you.
In: header
Cuerpo de la petición
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Cuerpo de la respuesta
application/json
curl -X POST "https://example.com/checkout/v1/sessions" \ -H "Content-Type: application/json" \ -d '{ "customer": { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" }, "amount_total": 350, "currency": "MXN", "line_items": [ { "name": "Product 1", "quantity": 1, "unit_price": 150, "product_id": "prod-001" }, { "name": "Product 2", "quantity": 2, "unit_price": 100, "product_id": "prod-002" } ], "return_url": "https://my-store.com/checkout/complete", "external_id": "ORD-12345" }'{
"id": "cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d",
"url": "https://stage-payflow.tonder.io/checkout/cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d",
"status": "pending",
"payment_id": 41521,
"amount_total": 350,
"currency": "MXN",
"expires_at": 1751564943,
"external_id": "ORD-12345",
"session_type": "payment",
"checkout_type": "hosted",
"return_url": "https://my-store.com/checkout/complete",
"metadata": {},
"payment_method_types": [
"card"
],
"ui_config": {},
"ui_config_version": "V1",
"created_at": 1751478543567,
"modified_at": 1751478543567,
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"line_items": [
{
"name": "Product 1",
"quantity": 1,
"unit_price": 150,
"product_id": "prod-001"
}
],
"transaction_status": "Pending",
"provider": "tonder"
}Configurar el negocio
Define la configuración de UI por defecto (logo y estilos) para todas tus sesiones de Hosted Checkout. Se aplica a todas las sesiones salvo que la sobrescribas a nivel de sesión.
Consultar una sesión
Consulta los detalles de una sesión de pago por su ID. Es la forma recomendada de verificar el resultado después de que el cliente regresa a tu sitio.
