Set the door key of a booking
Bookings
For a lock system that issues the PIN itself: stores the key of the booking room door where every reader takes it from — the guest webapp, which shows it to the guest when the property chose to, the arrivals report and the self check-in kiosks. Send { "pin": "0427" } with the PIN as text (digits only, 4 to 8, leading zeros kept); { "state": "keyWithoutPin" } when the booking has a key but no PIN to give the guest; or { "state": "none" } to remove the key, when the booking is cancelled or moved to a room the PIN does not open. Exactly one of pin and state. Only a booking still to come or in house: cancelled bookings, no-shows, blocks and checked-out bookings are refused, removing the key included — nothing reads the key of a stay that is over. Idempotent: sending the key the booking already has writes nothing and answers changed: false, so it is safe to retry. The answer says the status the booking has now and never repeats the PIN. Every change goes in the booking history under your partner name, with the status before and after and never the PIN. Hotelgest sends the guest no email with the PIN. One booking is one room: in a group, write each booking with its own id. Answers 400 doorKeyPinInvalid for a PIN that is not 4 to 8 digits sent as text, or is all zeros or zeros ending in 1 (0000, 0001), which older readers of the booking take for "no key"; 400 doorKeyRequestInvalid when the body is not exactly one of pin and state; 409 doorKeyBookingNotActive for a cancelled booking, a no-show or a block; 409 doorKeyBookingCheckedOut once the booking is checked out; and 404 for a booking that is not of this property. Partner keys only, with this endpoint granted to the connection.
Console
Runs against the API from your browser, with the same request your server will send.
Environment
Production
https://uni-api.hotelgest.com
Calls hit live data with your own API key. A POST, PUT, PATCH or DELETE here changes a real property.
Credentials
The API key, sent on every request. A property admin creates it in the PMS under Settings → API keys; a partner receives one per property when the property activates its integration. It works only for the property it was issued for, and only on the endpoints granted to it.
This endpoint needs a credential. Without it you will get a 401.
Stored in this browser only. Never sent anywhere but the API host above.
Path parameters
Body
Arm production
Writing methods are locked until you arm them. This is live hotel data.
PUT is locked on production. Arm it above if you mean it.
Send the request to see the real response here.
Nothing is mocked. What comes back is what the API returned.
Requests go straight from your browser to the API host above — nothing is proxied through this site.
Path parameters
Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.
Booking ID. Obtained from the search endpoints (GET /api/v2/bookings/{pcode}/search) or returned by the booking creation endpoint.
Request body
The PIN your system issued for this booking, as text: digits only, 4 to 8 of them, leading zeros kept. Never a JSON number. All zeros and zeros ending in 1 (0000, 0001) are refused: older readers of the booking take them for "no key". Send either pin or state, not both
keyWithoutPin: the booking has a key, but no PIN to give the guest (a card, a link); the guest is sent to reception. none: the booking has no key any more, e.g. it was cancelled or moved to a room your PIN does not open. Send either pin or state, not both
1{2 "pin": "0427",3 "state": "none"4}
Responses
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 of the booking, as it was sent
The key the booking has now, as every reader of the door key sees it: pin (a PIN is stored), keyWithoutPin (a key that carries no PIN) or none (no key). The PIN itself is never sent back
False when the booking already had exactly this key: nothing was written and nothing was recorded, so a request can be safely sent again
1{2 "bookingId": 789,3 "status": "pin",4 "changed": true5}
What is a pcode?
Rate limits