The checkout endpoint is the single entry point for initiating a payment transaction in iLeben. It accepts a unified request body and internally routes the operation to the correct payment gateway driver — Transbank (Webpay Plus), Mercado Pago, or manual bank transfer. The response shape differs per gateway, so clients should inspect theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/scooller/Leben-site/llms.txt
Use this file to discover all available pages before exploring further.
gateway field to determine how to handle the result.
Authentication
All checkout and gateway-listing endpoints require bothauth:sanctum and token.origin middleware:
- Header:
Authorization: Bearer <token> - Header:
Origin: <your-authorized-origin>(orReferer/X-Authorized-Url)
GET /api/v1/payment-gateways
List the payment gateways available for a given plant before presenting the checkout form. Pass the target plant ID as a query parameter to filter gateways by project-level configuration.Query parameters
The ID of the plant unit the user intends to purchase. When provided, gateways that are not configured for the plant’s project are excluded from the response.
Response
Array of available gateway objects.
Total number of available gateways returned.
Example response
POST /api/v1/checkout
Initiate a checkout transaction for a plant. The gateway field determines which payment driver is invoked and which response fields are returned.Request body
ID of the plant unit being purchased.
Number of units. Typically
1 for real estate plant purchases.Payment gateway to use. Accepted values:
"transbank", "mercadopago", or "manual".Full name of the buyer for billing and identification purposes.
Buyer’s email address. Used for payment notifications and receipts.
Buyer’s phone number, e.g.
"+56911111111".Buyer’s Chilean RUT identifier, e.g.
"12345678-5".Required when
gateway is "manual". The session_token returned from a prior POST /api/v1/reservations call. An active reservation must exist for the specified plant_id.Request body example
Response shapes
Response fields differ depending on which gateway was selected.- Transbank
- Mercado Pago
- Manual
Transbank returns a redirect URL and a transaction token. Redirect the user to
redirect_url to complete payment on the Webpay Plus hosted page.Always
"transbank" for this driver.Full URL to redirect the user to for card payment on Transbank’s hosted page.
Transbank transaction token (
token_ws). Appended to redirect_url as a query parameter by the SDK.Internal iLeben payment record ID.
Token used to poll the public status endpoint (
GET /api/v1/payments/public-status/{id}?token=...) without authentication.Transaction amount in the configured currency (CLP by default).
Line-item description of the purchase, e.g.
"1x Depto 301".Transbank environment in use:
"integration" or "production".cURL examples
Transbank checkout
Reservation + manual checkout (two-step flow)
First, create a reservation to hold the plant and obtain asession_token:
session_token:
Payment result webhooks and redirects
After checkout, gateways post results back through web routes defined outside/api/v1:
| Gateway | Route | Method |
|---|---|---|
| Transbank | /payments/transbank/return | GET or POST |
| Mercado Pago | /payments/mercadopago/webhook | POST (async) |
| Mercado Pago | /payments/mercadopago/return | GET (user redirect) |
| Outcome | Route |
|---|---|
| Success | GET /payments/success/{payment?} |
| Failed | GET /payments/failed/{payment?} |
| Pending | GET /payments/pending/{payment?} |