Consultar los pagos de una reserva

Reservas

get/api/v2/bookings/{pcode}/payments/{bookingId}x-api-key

Devuelve todos los pagos registrados en una reserva, los cobrara quien los cobrara: efectivo y tarjeta en recepción, transferencia bancaria y pagos online por las pasarelas que el establecimiento tenga conectadas. Si la reserva forma parte de un grupo, llegan los pagos de todas las reservas del grupo, también los de reservas de otros establecimientos cuando el grupo abarca varios: cada pago lleva su propio bookingId y su pcode, así que filtra por ellos para quedarte con los de una sola reserva. type dice cómo se pagó, con el nombre que le dio el establecimiento, y providerType qué pasarela lo gestionó; no viene cuando el pago se registró a mano. Un pago devuelto sigue en la lista y viene marcado como tal, así que la lista es el historial, no el saldo: suma los importes para saber qué se ha cobrado de verdad. Los importes van en la moneda del establecimiento. El dinero retenido como garantía en lugar de cobrado no está aquí: ver /deposits.

Consola

Llama a la API desde tu navegador, con la misma petición que enviará tu servidor.

Entorno

Producción

https://uni-api.hotelgest.com

Las llamadas van contra datos reales con tu propia clave. Un POST, PUT, PATCH o DELETE aquí modifica un establecimiento de verdad.

Credenciales

La clave de API, en cada petición. La crea un administrador del establecimiento en el PMS, en Configuración → Claves de API; un partner recibe una por establecimiento cuando este activa su integración. Solo funciona con el establecimiento para el que se emitió y con los endpoints que tiene concedidos.

Este endpoint necesita una credencial. Sin ella recibirás un 401.

Se guarda solo en este navegador. No se envía a ningún sitio que no sea el host de la API de arriba.

Parámetros de ruta

gethttps://uni-api.hotelgest.com/api/v2/bookings/123456/payments/789

Envía la petición y aquí verás la respuesta real.

No hay nada simulado. Lo que aparezca es lo que devolvió la API.

Las peticiones salen directamente de tu navegador al host de la API de arriba: esta web no hace de intermediaria.

Parámetros de ruta

pcode
number

Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.

bookingId
number

Booking ID. Obtained from the search endpoints (GET /api/v2/bookings/{pcode}/search) or returned by the booking creation endpoint.

Respuestas

Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its payload decrypts to. See https://public-api.hotelgest.com/public/guides/encryption

id
number

Unique ID of the payment

invoiceId
number

ID of the invoice this payment is linked to. Absent while it is on no invoice

reference
string

Reference of the payment as it was recorded: free text typed at reception, or the identifier of the gateway or channel that took it (for example the Paycomet order or the channel payment ID). Empty string when there is none. It is not generated by Hotelgest and is not unique

amountAuth
number

Amount authorized by the payment provider (may differ from the captured amount for card payments). 0 when there was no authorization

amount
number

Actual amount captured/received

date
string

Date the payment was made (YYYY-MM-DD)

paymentType
stringObsoleto

Same value as type. Kept for older integrations: read type instead

type
string

Payment method, as the property named it. It is free text, not a closed list: besides the usual Cash, Credit Card, Credit Card2, Bank Transfer, Virtual POS, bizum, PayPal, Paycomet, Monei, Stripe, Amex, Paycheck, CashDro and others, a property can record its own names (for example "TPV BBVA", "Booking.com", "VISA", "Bank Transfer booking"), and Hotelgest itself writes "Preauthorization" for a captured card pre-authorisation and "credit" for a payment recorded against a company account

providerType
enum

Online payment gateway that took the payment: paycomet, monei or stripe. Absent when it was recorded by hand or came through any other way

Uno de:paycometmoneistripe

notes
string

Free-text notes about the payment. Empty string when there are none

userId
number

ID of the user who registered this payment. 0 when it was not registered by a person (a gateway, a channel or an integration)

bookingId
number

ID of the booking this payment belongs to

pcode
number

Property code of the booking the payment belongs to. In a group that spans several properties it can be another property than the one in the path

createdAt
string

When the payment was recorded, as an ISO 8601 date-time. The value is Spain local time (Europe/Madrid) written with a Z suffix: read the digits as Madrid wall-clock time, not as UTC

prePay
boolean

Whether this is a pre-payment (advance payment before check-in, typically from OTA or booking engine)

prePayChannel
number

A 0/1 flag, not a channel ID: 1 on a payment the sales channel (OTA) collected and on a captured card pre-authorisation, 0 otherwise

transactionType
string

Kind of transaction, as the numeric code the legacy stores, in text: "0" for an ordinary payment (almost all of them), "1" and "2" for card operations handled by a gateway. Absent when the row has no code

isRefunded
boolean

Whether this payment has been refunded

isAdvancePayment
boolean

Whether this payment already is an advance payment ("pago a cuenta"), so it cannot be converted again

locator
string

The booking code on the channel the reservation of this payment came from. Absent when it has none

authCode
string

Authorization code the card gateway returned for the payment. Absent on payments that did not go through a gateway

Respuesta de ejemplo
1[
2 {
3 "id": 101,
4 "invoiceId": 450,
5 "reference": "1023-pay-1736935320",
6 "amountAuth": 120.5,
7 "amount": 120.5,
8 "date": "2025-01-15",
9 "paymentType": "Cash",
10 "type": "Cash",
11 "providerType": "paycomet",
12 "notes": "Paid via virtual POS",
13 "userId": 12,
14 "bookingId": 999,
15 "pcode": 123456,
16 "createdAt": "2025-01-15T10:22:00.000Z",
17 "prePay": false,
18 "prePayChannel": 0,
19 "transactionType": "0",
20 "isRefunded": false,
21 "isAdvancePayment": false,
22 "locator": "4417230981",
23 "authCode": "123456"
24 }
25]

¿Qué es un pcode?

El código de propiedad. Cada endpoint está limitado a un establecimiento, y tu clave de API solo funciona con el establecimiento para el que se emitió.

Límites de uso

100 peticiones por minuto por IP de origen, 120 por clave de API y 300 por establecimiento, cada una contada entre todos los endpoints a la vez, no por endpoint. Al pasarte de cualquiera recibes un 429 con los segundos de espera en Retry-After-<límite> (apikey-ip, apikey o apikey-pcode): para y espera. Cada reincidencia en una clave o un establecimiento se bloquea más tiempo, hasta 7 días.