Create a hosted checkout session
bearerAuthAutorizaciónBearer <token>Your API key, created in Configuración → Claves API. The key alone, without the Bearer prefix, is accepted too.
application/json- body
externalId?stringYour id for this session. Sending the same externalId again returns the existing session instead of creating another; with different items (a line's IVA rate included, and the IVA per rate), automaticTax, currency, iframe origins, appearance or splits it is refused with 409. How the IVA of a rate is split over its lines is not compared. Once a payment has issued the session's order, its items and IVA are no longer compared, since staff may have edited the order.
1 <= length <= 128currency*stringA USD or EUR total is converted to bolívares at the day's BCV rate; the buyer always pays in bolívares.
"VES""USD""EUR"automaticTax?Who computes the IVA. Left out or true: UnoPago adds IVA to the non-exento lines (a product line at its product's rate, any other at 16 %), and the order it records can be fiscally invoiced. false: you send each line's IVA rate (and optionally its amount) in items[].taxes, and the order can't be fiscally printed or emitted, since you invoice the sale in your own system. See Taxes (IVA).
items*array<>What is sold. Each amount is a net unit price in currency, multiplied by quantity. A line with a productId takes its description, amount and exento from the product when they are left out. A sent amount or exento that doesn't match the product is refused; a sent description is kept. A line without one needs description and amount. The server adds IVA to the non-exento lines (a product line at its product's rate, any other at 16 %), unless automaticTax.enabled is false and the lines bring their own taxes; the total is never an input.
1 <= items <= 100splits?array<>The parts of the order you owe to vendors, each an amount in currency for a vendor id (see Vendors; needs the Proveedores module). Up to 10, each vendor once. UnoPago pays every vendor its part and you keep the rest, paying UnoPago's fee on the whole charge: what is left for you after the fee must be more than zero. A session with splits is paid by C2P or immediate debit only, in one payment. The buyer is shown nothing about them. An empty list is a session without splits.
items <= 10reference?stringShown to the buyer on the checkout page.
length <= 128description?stringShown to the buyer on the checkout page.
length <= 500buyerName?stringPrefills the payment form.
length <= 100buyerEmail?string^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$emaillength <= 128buyerNationalId?stringThe buyer's cédula or RIF, e.g. V12345678 or J123456789. Prefills the payment form; the buyer can change it.
^[JVEGP]2 <= length <= 10buyerPhoneNumber?stringThe Venezuelan mobile affiliated to the buyer's bank, e.g. 04141234567 or +584141234567. Prefills the payment form; the buyer can change it.
^(?:[01]\d{3}-?\d{7}|\+58(?!0)\d{3}-?\d{7}|\+(?!58)\d{1,3}\d{3}-?\d{7})$buyerBankCode?stringThe buyer's bank, as its four-digit code (e.g. 0105 for Mercantil). Prefills the bank in either payment method; the buyer can change it.
metadata?Your own data, stored with the session.
{}successUrl?stringWhere the buyer is sent after paying.
uricancelUrl?stringThe checkout page's way back whenever the session isn't PAID: while it's open or PROCESSING, and on the expired, canceled or failed screens. Without it, the page shows no way back.
uriiframeAllowedOrigins?array<>The origins allowed to frame iframeUrl, e.g. https://shop.example.com. Exact origins only: scheme + host + optional port, no path, wildcard or credentials; at most 10. Send it and the response carries a signed iframeUrl; omit it (or send []) and iframeUrl is null. http is accepted for local testing; production requires https except on localhost. Part of the idempotent externalId check.
items <= 10appearance?The session's own look in the checkout, over the account's "Tema" settings. Every field is optional; one left out keeps the account's. mode is light or dark; colorPrimary is #RRGGBB; saturation and lightness are integers from 0 to 100 that tint the surfaces around the colour (the console's presets: Neutro 0/98, Suave 30/97, Intenso 60/95); borderStyle is square, soft, medium or rounded; showMerchantName shows "Pagando a" and the account's name in the embedded checkout, true unless the account turned it off; showTotal shows the total in the embedded checkout's header, true unless the account turned it off, and the pay button shows the amount either way. Unknown keys are refused. Part of the idempotent externalId check.
expiresInMinutes?integerMinutes until the session expires and can't be paid.
5 <= value <= 144030Successful response
application/json- response
id*string^[cC][0-9a-z]{6,}$cuidexternalId*|Your id for this session.
status*stringOPEN until the buyer pays. PROCESSING while a bank charge is confirmed: it becomes PAID, or goes back to OPEN (EXPIRED if past expiresAt) when the bank rejects it. PAID, EXPIRED and CANCELED are final. FAILED is reserved and not used today.
"OPEN""PROCESSING""PAID""FAILED""EXPIRED""CANCELED"automaticTax*Whether UnoPago computed the IVA from your account's settings. false when the session was created with your own IVA per line: see items[].taxes.
items*array<>What is sold. A product line carries its product's price, exento and IVA rate as they were when the session was created: a later change to the product never reaches it. Without automaticTax, a line without taxes is exento: true.
subtotal*numberThe items' net total, before discounts and IVA.
ivaRate*|The general IVA rate (0.16) when the session carries IVA: a product line is taxed at its product's own rate, which may be another one, and every other non-exento line at this one. null when the account applies none. Without automaticTax, the rate your lines' taxes share, or null when no line has any or they use more than one: ivaBreakdown lists them.
ivaAmount*numberThe IVA the buyer pays: each non-exento item's rate on its amount, summed per rate in ivaBreakdown, or without automaticTax, per rate, the sum of the taxes[].amount you sent, or rate × the rate's base when you sent none.
ivaBreakdown*array<>ivaAmount per rate, each with its taxable base, highest rate first. When UnoPago computes the IVA, one per rate its lines use; without automaticTax, one per distinct rate in your lines' taxes. Empty when no IVA applies.
amount*numberWhat the buyer pays, in currency: subtotal + ivaAmount, less any discount you add to the order after a first payment.
currency*string"VES""USD""EUR"amountVes*numberWhat the buyer pays in bolívares: amount times exchangeRate. While the session is open it is computed at today's BCV rate, so it changes when a new rate starts. Once a payment claims the session (processing, paid) it is what that payment charges; once it closes (expired, canceled) it stays at the rate of the day it closed. Equal to amount for VES.
exchangeRate*|Bolívares per unit of currency. null for VES.
exchangeRateDate*|The date of the BCV publication exchangeRate comes from. null for VES.
amountPaid*numberWhat the session has been paid so far, in currency, on amount (fees not included). A session can be paid in parts, and a payment recorded into its invoice outside the checkout counts too. Still counts what was paid once a partly paid session is canceled.
amountRemaining*numberamount minus amountPaid, never below 0, whatever the status: read status to know whether it can still be paid.
splits*array<>The parts of the order owed to vendors: the splits the session was created with, in no particular order. Empty for a session without them.
reference*string|nulldescription*string|nullbuyerName*string|nullbuyerEmail*string|nullurl*stringThe hosted checkout page. Send the buyer here, or use iframeUrl to embed the form on your site.
uriiframeUrl*|A form-only version of the checkout, for an <iframe> on one of the origins sent in iframeAllowedOrigins. null when the session has no allowlist. The URL is signed: don't change it. See the API guide's "Embedding the checkout" section for the postMessage events.
appearance*|The appearance the session was created with. null when it was created without one: the checkout uses the account's "Tema" settings.
paidAt*string|nullexpiresAt*stringcreatedAt*stringupdatedAt*stringcurl -X POST 'https://api.unopago.com/v1/checkout-sessions' \ -H 'Content-Type: application/json' \ -d '{ "currency": "VES", "items": [ { "quantity": 1 } ]}'{ "id": "string", "externalId": "string", "status": "OPEN", "automaticTax": { "enabled": true }, "items": [ { "productId": "string", "description": "string", "quantity": -9007199254740991, "amount": 0, "exento": true, "taxes": [ { "type": "IVA", "rate": 0, "amount": 0 } ] } ], "subtotal": 0, "ivaRate": 0, "ivaAmount": 0, "ivaBreakdown": [ { "rate": 0, "rateBase": 0, "amount": 0 } ], "amount": 0, "currency": "VES", "amountVes": 0, "exchangeRate": 0, "exchangeRateDate": "string", "amountPaid": 0, "amountRemaining": 0, "splits": [ { "vendor": "string", "externalId": "string", "amount": 0, "amountVes": 0 } ], "reference": "string", "description": "string", "buyerName": "string", "buyerEmail": "string", "url": "http://example.com", "iframeUrl": "http://example.com", "appearance": { "mode": "light", "colorPrimary": "string", "saturation": 0, "lightness": 0, "borderStyle": "square", "showMerchantName": true, "showTotal": true }, "paidAt": "string", "expiresAt": "string", "createdAt": "string", "updatedAt": "string"}
