Check a promo code

Booking engine

get/api/direct-booking/{pcode}/promo-codesx-api-key

Whether a promo code a guest typed exists, and what it takes off. Answers a list with the promotion when the code matches one the hotel shows on its engine — compared without case — and an empty list when it does not, or when the code has used up all its uses. Several promotions can share a code, and then all of them come. Check dfrom and dto against the stay: the code is returned whatever the dates.

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

Query parameters

gethttps://uni-api.hotelgest.com/api/direct-booking/123456/promo-codes

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

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.

Query parameters

code
string

The code the guest typed

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
string

Promotion id

code
string

The code, as the hotel created it

dfrom
string

Start of the validity of the code (YYYY-MM-DD HH:mm:ss)

dto
string

End of the validity of the code (YYYY-MM-DD HH:mm:ss)

dtype
string

How value applies: 0 takes value off each night, -1 takes value % off the stay, -2 takes value off the stay. When booking, send them as fbn, pbn and ta

value
string

Amount or percentage dtype applies, with two decimals

name
string

Name of the promotion

Example response
1[
2 {
3 "id": "7",
4 "code": "SUMMER27",
5 "dfrom": "2027-06-01 00:00:00",
6 "dto": "2027-09-30 00:00:00",
7 "dtype": "-1",
8 "value": "10.00",
9 "name": "Summer offer"
10 }
11]

What is a pcode?

The property code. Every endpoint is scoped to one property, and your API key only works for the property it was issued for.

Rate limits

100 requests per minute per source IP, 120 per API key and 300 per property, each counted across every endpoint together — not per endpoint. Over any of them you get a 429 with the seconds to wait in Retry-After-<limit> (apikey-ip, apikey or apikey-pcode): stop and wait it out. Repeat offences on a key or a property are blocked for longer each time, up to 7 days.