Ir al contenido
UnoPagoDocumentación
Referencia de la APIBillingCheckout sessions

Cancel an open checkout session

POST
/v1/checkout-sessions/{id}/cancel

Autorización

bearerAuth
headerAutorizaciónBearer <token>

Your API key, created in Configuración → Claves API. The key alone, without the Bearer prefix, is accepted too.

Parámetros de ruta

id*string
Patrón^[cC][0-9a-z]{6,}$
Formatocuid

Cuerpo de la respuesta

Successful response

application/json
  1. response
id*string
Patrón^[cC][0-9a-z]{6,}$
Formatocuid
externalId*|

Your id for this session.

status*string

OPEN 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.

Valor en"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*number

The 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*number

The 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*number

What the buyer pays, in currency: subtotal + ivaAmount, less any discount you add to the order after a first payment.

currency*string
Valor en"VES""USD""EUR"
amountVes*number

What 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*number

What 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*number

amount 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|null
description*string|null
buyerName*string|null
buyerEmail*string|null
url*string

The hosted checkout page. Send the buyer here, or use iframeUrl to embed the form on your site.

Formatouri
iframeUrl*|

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|null
expiresAt*string
createdAt*string
updatedAt*string
Ejemplo de solicitud
curl -X POST 'https://api.unopago.com/v1/checkout-sessions/string/cancel'
Ejemplo de respuesta
{  "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"}