Modificare quantità, partenza o prezzi
expectedUpdatedAt obbligatorio, da GET. Serve almeno uno tra startAt, customStart, unitItems, resourceItems, retailPrices, participants; startAt e customStart sono alternativi. unitItems sostituisce l'intera composizione. Stati ammessi: ON_HOLD non scaduto, PENDING, CONFIRMED. 409 per modifica concorrente, capacità insufficiente o canale di origine senza sottoscrizione BOOKING_UPDATE. L'API management supera i cutoff di prenotazione e cancellazione. Ricalcola prezzo e consumo atomicamente. Non consente di cambiare optionId, customer o notes.
/api/v1/bookings/{id}Authorization
Path
Body
curl -X PATCH "https://api.takoconnect.com/api/v1/bookings/{id}" \
-H "Authorization: Bearer $TAKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expectedUpdatedAt": "2030-06-01T12:00:00.000Z",
"unitItems": [
{
"unitId": "unit-id",
"quantity": 3
}
]
}'{
"id": "entity-id",
"tenantId": "tenant-id",
"uuid": "uu-id",
"supplierId": "supplier-id",
"sourceChannelConnectionId": "source-channel-connection-id",
"productId": "product-id",
"optionId": "option-id",
"source": "source",
"externalId": "external-id",
"status": "ON_HOLD",
"startAt": "2030-06-15T08:00:00.000Z",
"endAt": "2030-06-15T08:00:00.000Z",
"expiresAt": "2030-06-15T08:00:00.000Z",
"customer": {},
"notes": "notes",
"cancellationReason": "cancellationReason",
"idempotencyKey": "idempotencyKey",
"pricingSnapshot": {
"schemaVersion": 1,
"pricingPer": "UNIT",
"currency": "EUR",
"currencyPrecision": 0,
"retail": 0,
"unitPricing": [
{
"unitId": "unit-id",
"quantity": 0,
"retail": 0,
"unitRetail": 0,
"name": "name",
"type": "type",
"paxCount": 0
}
]
},
"resourceUsageSnapshot": {
"schemaVersion": 1,
"items": [
{
"resourceId": "resource-id",
"name": "name",
"capacityPlaces": 0,
"resourceQuantity": 0
}
]
},
"participants": {},
"createdAt": "2030-06-15T08:00:00.000Z",
"updatedAt": "2030-06-15T08:00:00.000Z",
"unitItems": [
{
"id": "entity-id",
"bookingId": "booking-id",
"unitId": "unit-id",
"quantity": 0,
"metadata": {}
}
]
}Autorizzazione
AuthorizationBearer <token>
Chiave tenant emessa dalla dashboard o da POST /api-keys, usata come Bearer token.
Scope richiesti: bookings:write
In: header
Parametri di percorso
idstring
Body
Content-Type: application/json · almeno uno dei campi modificabili.
expectedUpdatedAtdatetime
date-time
startAt?datetime
date-time
customStart?object
Mostra proprietà
localDatedate
date
localTimestring
pricingReferenceStartAt?datetime
date-time
retailPrices?object
unitItems?object[]
Mostra proprietà
unitIdstring
minLength 1
quantityinteger
min 1
resourceItems?object[]
Mostra proprietà
resourceIdstring
minLength 1
quantityinteger
min 1
participants?object
Risposte
200object
Operazione riuscita. Lo schema descrive il JSON restituito.
Mostra schema
idstring
tenantIdstring
uuidstring
supplierIdstring
sourceChannelConnectionIdstring | null
productIdstring
optionIdstring
sourcestring
externalIdstring | null
statusenum
ON_HOLDPENDINGCONFIRMEDCANCELLEDREJECTEDEXPIRED
startAtdatetime
date-time
endAtdatetime | null
date-time
expiresAtdatetime | null
date-time
customerany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
notesstring | null
cancellationReasonstring | null
idempotencyKeystring | null
pricingSnapshotobject | null
Mostra proprietà
schemaVersionenum | enum
pricingPerenum
UNITRESOURCEBOOKING
currencystring
currencyPrecisioninteger
retailinteger
Importo nelle unità minori della valuta: EUR 1250 = 12,50 EUR.
min 0
unitPricingobject[]
Mostra proprietà
unitIdstring
quantityinteger
retailinteger
Importo nelle unità minori della valuta: EUR 1250 = 12,50 EUR.
min 0
unitRetail?integer
Importo nelle unità minori della valuta: EUR 1250 = 12,50 EUR.
min 0
name?string
type?string
paxCount?integer
resourceUsageSnapshotobject | null
Mostra proprietà
schemaVersionenum
1
itemsobject[]
Mostra proprietà
resourceIdstring
namestring
capacityPlacesinteger
resourceQuantity?integer
participantsany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
createdAtdatetime
date-time
updatedAtdatetime
date-time
unitItemsobject[]
Mostra proprietà
idstring
bookingIdstring
unitIdstring
quantityinteger
metadataany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
400object
Validazione o regola di dominio non soddisfatta; correggere la richiesta.
401object
Credenziale assente, revocata, scaduta o non valida.
403object
Scope, ruolo o tipo di credenziale non consentito.
404object
Risorsa assente o non accessibile nel perimetro risolto.
409object
Conflitto di stato, capacità, versione o riferimenti; rileggere lo stato e correggere.
413object
Corpo JSON oltre il limite di 15 MB.
500object
Errore interno. Prima di ripetere una mutazione verificarne l'esito.