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 Tu API key con prefijo Token , p. ej. Token <API_KEY>
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"
}