Consultar las facturas de una reserva

Reservas

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

Devuelve las facturas emitidas de una reserva y, si forma parte de un grupo, las de todas las reservas del grupo en el mismo establecimiento; también llegan las facturas de lote que facturan alguna línea de cualquiera de ellas. Son los documentos definitivos, con numeración legal: una vez emitidos no se editan, y una corrección se hace emitiendo un abono contra ellos. Los abonos vienen en la misma lista, con type: refund, y la factura que corrigen apunta a ellos con refundId, así que lo realmente facturado es la suma de las facturas menos la suma de los abonos, no la suma de todo. Cada entrada lleva su serie y número, fecha, total, las líneas que factura con el tipo de impuesto de cada una y el cliente o empresa al que se facturó; las bases y cuotas de impuesto no vienen desglosadas. Los importes van en la moneda en que se emitió la factura, que coin da tal como se guardó. Una reserva puede no tener ninguna factura todavía, tener varias, o una por huésped si se dividió la cuenta. Los presupuestos que se mandan antes de facturar son otro documento: ver /proformas.

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/invoices/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 invoice

pcode
number

Property code this invoice belongs to

coin
string

Currency of the invoice as it was stored when it was issued: the symbol for most properties (€), an ISO 4217 code for some others (COP, MAD). Not normalised

date
string

Invoice issue date (YYYY-MM-DD)

prefix
string

Invoice series prefix (e.g. INV, F, RE) as configured in the property settings

prefixAdditional
number

Additional numeric prefix for sub-series. Absent when the invoice has none

reference
integer

Sequential number of the invoice within its series, as a number. The series is in prefix (and prefixAdditional): the printed reference is the two together

total
number

Total amount of the invoice (including taxes)

refundId
number

ID of the credit note that refunds this invoice. Absent when it was not refunded

paymentsIds
number[]

List of payment IDs linked to this invoice

totalPaid
number

Total amount already paid towards this invoice

isCredit
boolean

Whether the invoice was issued on credit, to be paid later. It does not mark a credit note: a credit note is type: refund

invoiceWasSent
string

Day the invoice was emailed (YYYY-MM-DD). Absent when it was never sent

InvoiceType

Invoice type: invoice, refund (a credit note) or deposit. Invoices and credit notes of the services module (POS) also come as invoice and refund; servicesDocument tells them apart. The value service is listed by the enum but never returned here

bookingsIds
number[]

List of booking IDs included in this invoice (an invoice can cover multiple bookings)

items
object

Line items breakdown. Keyed by item ID, each entry shows the booking it belongs to, tax percentage, and total amount; type is the kind of line as stored — an open set: main for the stay, tax for the tourist tax, and others such as prePay, refund, tax2 or the type of a POS integration; absent when the line has none — and start/end the first and last night it covers (YYYY-MM-DD) when it has them. Taxes come only as a rate per line: the invoice carries no tax bases or tax amounts

CustomerType

Billing customer type: particular, company, or agency

name
string

Billing customer first name. For a particular it is every word of the billing name but the last; for a company or an agency it is the whole billing name

surname
string

Billing customer last name: the last word of the billing name for a particular (empty when the name is one word), and always empty for a company or an agency

DocumentType

Billing customer document type: P (passport), D (DNI), C (driving license), I (identity card), N (Spanish residence permit), X (foreign residence permit), MI (minor undocumented), E (other), IDX (foreigner ID), ID (identity card, legacy code), 50 (foreign tax ID). P when the stored type is missing or not one of these

documentNumber
string

Billing customer document number. Absent when it was not recorded

phone
string

Billing customer phone number. Absent when empty

address
string

Billing address. Absent when empty

postalCode
string

Billing postal code. Absent when empty

city
string

Billing city. Absent when empty

country
string

Billing country code as stored: almost always ISO 3166-1 alpha-3, a two-letter code on a few older invoices. Absent when empty

province
string

Billing province or state. Absent when empty

observations
string

Additional notes or observations on the invoice. Absent when empty

signed
boolean

Whether the invoice carries the verification URL of a fiscal digital signature (TicketBAI or Veri*factu): see fiscalUrl

fiscalUrl
string

Verification URL of the fiscal digital signature (TicketBAI or Veri*factu) the invoice was signed with. Absent when it is not signed

error
string

Why the fiscal digital signature failed, on an invoice that is not signed. Absent on a signed invoice and when nothing failed

errorProvider
enum

Signature provider that reported error. Absent when there is no error

Uno de:ticketbaiverifactu

errorCode
string

The provider's own code for error (for example B4_1000002). Absent when the provider gave none

DigitalSignatureStatus

Where an asynchronous signature of an unsigned invoice stands: processing, signed or error. Absent when no signature is in flight

companyId
number

ID of the billing customer record (company, agency or particular) the invoice was issued to

countryName
string

Country name of the billing customer as it was typed (for example "france"), the text the invoice prints. Absent when empty

irpf
number

Withholding tax rate (IRPF) of the invoice, in percent. 0 when there is none

servicesDocument
boolean

true on the invoices and credit notes of the services module (POS sales billed on their own series). Absent on every other invoice

bookingTotal
number

Only on an invoice that bills bookings outside the group of the one asked for (a batch invoice): what this booking owes on it. total keeps meaning the whole invoice

bookingPaid
number

Only on a batch invoice, with bookingTotal: what has been paid for this booking on it. totalPaid keeps meaning the whole invoice

Respuesta de ejemplo
1[
2 {
3 "id": 1,
4 "pcode": 123456,
5 "coin": "€",
6 "date": "2025-01-20",
7 "prefix": "INV",
8 "prefixAdditional": 2,
9 "reference": 1,
10 "total": 450.75,
11 "refundId": 99,
12 "paymentsIds": [
13 10,
14 11
15 ],
16 "totalPaid": 300.5,
17 "isCredit": false,
18 "invoiceWasSent": "2025-01-21",
19 "type": "invoice",
20 "bookingsIds": [
21 1001,
22 1002
23 ],
24 "items": {
25 "1": {
26 "bookingId": 1001,
27 "tax": 10,
28 "total": 100,
29 "type": "main",
30 "start": "2026-01-10",
31 "end": "2026-01-11"
32 },
33 "2": {
34 "bookingId": 1002,
35 "tax": 10,
36 "total": 200
37 }
38 },
39 "customerType": "particular",
40 "name": "John",
41 "surname": "Doe",
42 "documentType": "D",
43 "documentNumber": "X1234567",
44 "phone": "+34 600 123 456",
45 "address": "Main Street 123",
46 "postalCode": "08001",
47 "city": "Barcelona",
48 "country": "ESP",
49 "province": "Barcelona",
50 "observations": "Customer requested digital invoice",
51 "signed": true,
52 "fiscalUrl": "https://batuz.eus/QRTBAI/?id=TBAI-00000000A-010126-btFpwP8dcLGAF-237",
53 "error": "Invalid tax calculation",
54 "errorProvider": "verifactu",
55 "errorCode": "B4_1000002",
56 "signStatus": "processing",
57 "companyId": 12,
58 "countryName": "france",
59 "irpf": 0,
60 "servicesDocument": true,
61 "bookingTotal": 180,
62 "bookingPaid": 180
63 }
64]

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