Booking
Apply a promo code to a reservation
Accès
Membre de l’organisation avec cette autorisation :
reservations:write
Une clé API avec des scopes doit aussi avoir l’autorisation dans ses scopes.
POST
Checks the code's conditions against the stay and the guest, ties it to the reservation and returns the new price. A stay holds one code; applying another replaces it.
ApiKeyAuthheader
x-api-key<token>API key for authentication
organizationId*stringThe ID or slug of the organization
reservationId*stringLength
1 <= lengthapplication/json- body
code*stringLength
1 <= length <= 40OK
application/json- response
reservationId*stringterrainTypeId*string|nullaccommodationName*string|nullcurrency*stringquote*|nullinvoiceId*string|nullinvoiceDisplayId*string|nullpromoCode*|nullbilling*|nullcurl -X POST 'https://api.tillor.eu/orgs//booking/reservations/string/promo-code' \ -H 'Content-Type: application/json' \ -d '{ "code": "string"}'Example Response
{ "reservationId": "string", "terrainTypeId": "string", "accommodationName": "string", "currency": "string", "quote": { "checkIn": "string", "checkOut": "string", "nights": -9007199254740991, "nightPrices": [ { "date": "string", "price": 0, "rateId": "string" } ], "lines": [ { "key": "string", "kind": "stay", "label": "string", "quantity": 0, "unitPrice": 0, "total": 0, "taxPercentage": 0, "extraId": "string", "periodStart": "string", "periodEnd": "string" } ], "subtotal": 0, "discount": 0, "total": 0, "deposit": 0, "taxTotal": 0, "issues": [ { "code": "INVALID_RANGE", "value": 0, "date": "string" } ], "valid": true, "promo": { "code": "string", "percentage": 0, "amount": 0, "appliesToExtras": true, "appliesToTouristTax": true, "minNights": -9007199254740991, "maxNights": -9007199254740991, "stayFrom": "string", "stayTo": "string", "checkInWeekdays": [ -9007199254740991 ], "firstBookingOnly": true, "firstStayOnly": true, "rejected": true } }, "invoiceId": "string", "invoiceDisplayId": "string", "promoCode": { "id": "string", "code": "string", "discount": 0 }, "billing": { "documents": [ { "id": "string", "displayId": "string", "type": "INVOICE", "status": "DRAFT", "paymentStatus": "UNPAID", "amountTotal": 0, "amountPaid": 0, "amountOutstanding": 0 } ], "canceled": true, "mode": "lines", "currentTotal": 0, "invoicedTotal": 0, "difference": 0, "untrackedTotal": 0, "action": "none", "lines": [ { "description": "string", "quantity": 0, "unitPrice": 0, "total": 0, "taxPercentage": 0 } ] }}