Aller au contenu

Créer un type d'unité (chambre, emplacement…)

POST
/v1/unit-types
curl --request POST \
--url https://example.com/v1/unit-types \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "establishmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "code": "example", "name": "example", "format": "hotel_room", "baseCapacity": 1, "headcountBillingMode": "per_person", "housekeepingApplicable": true }'
Media type application/json
object
establishmentId
required
string format: uuid
code
required
string
<= 20 characters
name
required
string
<= 200 characters
format
required

Format physique (hotel_room, camping_pitch…)

string
Example
hotel_room
baseCapacity
required
integer
>= 1
headcountBillingMode
required
string
Example
per_person
housekeepingApplicable
boolean
nullable

Type d’unité créé

Media type application/json
object
data
required
object
unitTypeId
required
string format: uuid
Example generated
{
"data": {
"unitTypeId": "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

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
}