createBooking
Mutation
Create a new booking. Booking must align with the configuration as defined by the location.
Bookings created via this mutation are subject to approval by the booking engine.
Signature
Section titled “Signature”mutation { createBooking( organisationId: UUID! booking: BookingInput bookingEntityRef: BookingEntityRefInput ): ID!}Arguments
Section titled “Arguments”| Argument | Type | Default | Description |
|---|---|---|---|
organisationId* | UUID! | — | The ID of the organisation making the request. |
booking | BookingInput | — | Details of the requested booking. |
bookingEntityRef | BookingEntityRefInput | — | Details of the requested booking. The EntityRef parameter variant is able to omit some Mobiledock UUIDs in favour of entity names. |
Return type
Section titled “Return type”ID (ID!)
Example
Section titled “Example”mutation CreateBooking($organisationId: UUID!, $booking: BookingInput, $bookingEntityRef: BookingEntityRefInput) { createBooking(organisationId: $organisationId, booking: $booking, bookingEntityRef: $bookingEntityRef) {
}}curl -X POST https://my.mobiledock.com/api/v1/graphql \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "mutation CreateBooking($organisationId: UUID!, $booking: BookingInput, $bookingEntityRef: BookingEntityRefInput) { createBooking(organisationId: $organisationId, booking: $booking, bookingEntityRef: $bookingEntityRef) { id } }", "variables": { "organisationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } }'const response = await fetch('https://my.mobiledock.com/api/v1/graphql', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: ` mutation CreateBooking($organisationId: UUID!, $booking: BookingInput, $bookingEntityRef: BookingEntityRefInput) { createBooking(organisationId: $organisationId, booking: $booking, bookingEntityRef: $bookingEntityRef) {
} } `, variables: { "organisationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, }),});
const data = await response.json();