v0.3.0

bookings

Creare una prenotazione

Esattamente uno tra startAt (UTC) e customStart (ora locale nel fuso del prodotto/fornitore). Almeno un'unità valida e quantità positive. idempotencyKey è nel JSON, univoca per tenant: il riuso restituisce la prenotazione esistente senza confrontare il payload, anche con risposta 201. Omettere status per rispettare metadata.directBooking: CONFIRMED normalmente, PENDING se false; ON_HOLD crea una riserva. customStart crea una partenza manuale e supera il booking cutoff; fornire retailPrices se manca una tariffa. expandCapacity=true autorizza un aumento della capacità. backdated richiede una sessione utente, con API key restituisce 403. endAt omesso può tornare null; il consumo usa la durata dell'opzione.


https://api.takoconnect.com
POST/api/v1/bookings
Authorization
Body
curl -X POST "https://api.takoconnect.com/api/v1/bookings" \
  -H "Authorization: Bearer $TAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "optionId": "option-id",
  "startAt": "2030-06-15T08:00:00Z",
  "unitItems": [
    {
      "unitId": "unit-id",
      "quantity": 2
    }
  ],
  "status": "ON_HOLD",
  "idempotencyKey": "gestionale:supplier:ordine-123",
  "customer": {
    "firstName": "Ada",
    "lastName": "Esempio",
    "emailAddress": "ada@example.com"
  }
}'
{
  "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

Body

Content-Type: application/json · esattamente una tra le varianti indicate.

optionIdstring

minLength 1

startAt?datetime

date-time

customStart?object

Mostra proprietà

localDatedate

date

localTimestring

retailPrices?object

endAt?datetime

date-time

unitItemsobject[]

Mostra proprietà

unitIdstring

minLength 1

quantityinteger

min 1

resourceItems?object[]

Mostra proprietà

resourceIdstring

minLength 1

quantityinteger

min 1

participants?object

customer?object

notes?string

minLength 1

idempotencyKey?string

minLength 1

status?enum

ON_HOLDCONFIRMED

expandCapacity?boolean

backdated?boolean

Risposte

201object

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.

SuccessivoLeggere una prenotazioneGET