Skip to navigation

Cerrar lote de terminal

Closes the current physical batch of a POS terminal, marks it as closed, and leaves the terminal ready to open a new batch with the next payment.

The batch must belong to the selected merchant or include that merchant’s transactions or refunds. Association with a shared terminal alone does not grant access to another merchant’s batch. If no eligible open batch exists, the endpoint returns 422 with no_open_batch.

The response contains only the selected merchant’s successful transaction count and gross totals by currency. Use the connected-account context header when operating for an authorized connected merchant. Closing the batch remains a physical operation shared by all participating merchants; it does not settle their balances.

Send Idempotency-Key for safe retries. If your system loses the response after closure, repeating the same request with the same key returns the original response rather than closing another batch.

Two concurrent requests that already found the same open batch can both succeed, preserving the first closure’s timestamp, responsible user and stored totals. A new request without the same idempotency key looks for the current open batch: it returns 422 if none exists or closes the next batch if one has opened.

Authentication

X-SECRET-KEYstring

Tu clave secreta de API.

Una llave de cuenta (sk_live_..., sk_test_...) opera sobre su propia cuenta y, con X-ACCOUNT-ID, sobre sus cuentas conectadas.

La llave también fija el ambiente: una sk_test_ solo lista y resuelve objetos de prueba (live_mode: false) y una sk_live_ solo objetos reales. Un ID del otro ambiente responde 404 (401 en /customers).

Una llave de organización (sk_org_live_..., sk_org_test_...) alcanza todas las cuentas de una organización y solo sirve para leer: saldos, movimientos y reportes. Para operar sobre una cuenta debe nombrarla con X-ACCOUNT-ID; omitirlo en una lectura devuelve todas las cuentas de la organización. Cualquier otro endpoint responde 403 con code: organization_key_unsupported.

Headers

Idempotency-KeystringOptional

Clave de idempotencia para reintentos seguros de operaciones críticas, especialmente las que mueven dinero o cambian estado operativo. Reintentar con la misma clave y el mismo cuerpo devuelve la respuesta original (header Idempotency-Replayed: true); reusarla con parámetros distintos devuelve 409.

Request

This endpoint expects an object.
terminal_idstringRequired
ID de la terminal POS cuyo lote abierto quieres cerrar

Response

Lote cerrado exitosamente
idstringOptional
ID del lote cerrado
statusenumOptional
Estado del lote
Allowed values:
terminal_idstringOptional
ID de la terminal POS
transaction_countintegerOptional
Number of successful transactions belonging to the authenticated merchant within this physical batch
total_in_centsintegerOptional

Authenticated merchant subtotal in cents for total_currency; amounts in different currencies are not added together. Use totals_by_currency for each currency’s total.

total_currencyenumOptional

Currency of the total_in_cents subtotal. A single-currency batch uses that currency; mixed or empty batches retain the batch currency (GTQ by default).

Allowed values:
totals_by_currencymap from strings to integersOptional
Gross totals belonging to the authenticated merchant within this batch, grouped by currency. A shared POS never includes another merchant's transactions.
opened_atdatetimeOptional

Fecha y hora en que se abrió el lote

closed_atdatetime or nullOptional

Fecha y hora en que se cerró el lote

Errors

404
Not Found Error
422
Unprocessable Entity Error