Créer un contingent (allotment / tentative) et armer son cutoff
POST
/v1/allotments
const url = 'https://example.com/v1/allotments';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"establishmentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","ratePlanId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","channelType":"to","channelExternalId":"example","allotmentType":"allotment","currency":"EUR","periodFrom":"2026-09-01","periodTo":"2026-09-07","unitAllocations":[{"unitTypeId":"example","quantity":1}],"cutoffDate":"2026-08-01","minimumPickupPercent":70,"penaltyPerRoomNightCents":"5000","complimentaryRooms":1,"contractualHeadcount":1,"invoicingMode":"master_single","billingFolioId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/allotments \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "establishmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ratePlanId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "channelType": "to", "channelExternalId": "example", "allotmentType": "allotment", "currency": "EUR", "periodFrom": "2026-09-01", "periodTo": "2026-09-07", "unitAllocations": [ { "unitTypeId": "example", "quantity": 1 } ], "cutoffDate": "2026-08-01", "minimumPickupPercent": 70, "penaltyPerRoomNightCents": "5000", "complimentaryRooms": 1, "contractualHeadcount": 1, "invoicingMode": "master_single", "billingFolioId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Authorizations
Section intitulée « Authorizations »Request Body required
Section intitulée « Request Body required »PenaltyPerRoomNightCents en centimes (bigint string). Un allotment contractuel exige une pénalité ; un tentative non.
Media type application/json
object
establishmentId
required
string format: uuid
ratePlanId
required
string format: uuid
channelType
required
string
channelExternalId
string
allotmentType
required
string
currency
required
string
periodFrom
required
string format: date
Example
2026-09-01 periodTo
required
string format: date
Example
2026-09-07 unitAllocations
required
Array<object>
object
unitTypeId
required
string
quantity
required
integer
cutoffDate
required
string format: date
Example
2026-08-01 minimumPickupPercent
required
number
Example
70 penaltyPerRoomNightCents
string
Example
5000 complimentaryRooms
integer
contractualHeadcount
integer
invoicingMode
string
billingFolioId
string format: uuid
Responses
Section intitulée « Responses »Contingent créé
Media type application/json
object
data
required
object
allotmentId
required
string format: uuid
Example generated
{ "data": { "allotmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }}Corps invalide
Media type application/json
object
code
required
Code machine de l’erreur
string
message
required
Message lisible
string
origin
Origine domaine de l’erreur (optionnel)
object
boundedContext
string
module
string
status
required
integer
traceId
required
Identifiant de corrélation pour le support
string
Example
{ "code": "RESERVATION_NOT_FOUND", "message": "Réservation introuvable", "status": 404}Non authentifié
Media type application/json
object
code
required
Code machine de l’erreur
string
message
required
Message lisible
string
origin
Origine domaine de l’erreur (optionnel)
object
boundedContext
string
module
string
status
required
integer
traceId
required
Identifiant de corrélation pour le support
string
Example
{ "code": "RESERVATION_NOT_FOUND", "message": "Réservation introuvable", "status": 404}Permission refusée ou scope IDOR
Media type application/json
object
code
required
Code machine de l’erreur
string
message
required
Message lisible
string
origin
Origine domaine de l’erreur (optionnel)
object
boundedContext
string
module
string
status
required
integer
traceId
required
Identifiant de corrélation pour le support
string
Example
{ "code": "RESERVATION_NOT_FOUND", "message": "Réservation introuvable", "status": 404}