Creare un prodotto
status predefinito ACTIVE; per preparare il catalogo usare INACTIVE. reference derivata dal nome se omessa. metadata.directBooking=false abilita la richiesta di approvazione.
/api/v1/productsAuthorization
Body
curl -X POST "https://api.takoconnect.com/api/v1/products" \
-H "Authorization: Bearer $TAKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"supplierId": "supplier-id",
"name": "Tour di esempio",
"status": "INACTIVE"
}'{
"id": "entity-id",
"tenantId": "tenant-id",
"name": "name",
"reference": "tour-di-esempio",
"createdAt": "2030-06-15T08:00:00.000Z",
"updatedAt": "2030-06-15T08:00:00.000Z",
"supplierId": "supplier-id",
"shortDescription": "shortDescription",
"description": "description",
"features": [
{
"type": "type",
"shortDescription": "shortDescription"
}
],
"depositPercentage": 0,
"durationMinutesFrom": 0,
"durationMinutesTo": 0,
"timezone": "timezone",
"locale": "locale",
"availabilityType": "START_TIME",
"status": "ACTIVE",
"metadata": {},
"options": [
{
"id": "entity-id",
"tenantId": "tenant-id",
"name": "name",
"reference": "tour-di-esempio",
"createdAt": "2030-06-15T08:00:00.000Z",
"updatedAt": "2030-06-15T08:00:00.000Z",
"productId": "product-id",
"isDefault": true,
"durationMinutes": 0,
"sortOrder": 0,
"pricingPer": "UNIT",
"cancellationCutoffAmount": 0,
"cancellationCutoffUnit": "cancellationCutoffUnit",
"bookingCutoffMinutes": 0,
"requiredContactFields": [
"requiredContactFields"
],
"restrictions": {},
"metadata": {},
"units": [
{
"id": "entity-id",
"tenantId": "tenant-id",
"name": "name",
"reference": "tour-di-esempio",
"createdAt": "2030-06-15T08:00:00.000Z",
"updatedAt": "2030-06-15T08:00:00.000Z",
"optionId": "option-id",
"type": "ADULT",
"requiredContactFields": [
"requiredContactFields"
],
"restrictions": {},
"metadata": {},
"deletedAt": "2030-06-15T08:00:00.000Z"
}
],
"resourceRequirements": [
{
"id": "entity-id",
"tenantId": "tenant-id",
"optionId": "option-id",
"resourceId": "resource-id",
"quantity": 0,
"maxQuantity": 0
}
],
"availabilityPeriods": [
{
"id": "entity-id",
"tenantId": "tenant-id",
"optionId": "option-id",
"startMonthDay": "startMonthDay",
"endMonthDay": "endMonthDay",
"weekdays": [
0
],
"startTimes": [
"startTimes"
],
"label": "label",
"createdAt": "2030-06-15T08:00:00.000Z",
"updatedAt": "2030-06-15T08:00:00.000Z",
"active": true,
"pricingBasis": "pricingBasis",
"currency": "EUR",
"prices": {}
}
],
"pricingPeriods": [
{
"id": "entity-id",
"tenantId": "tenant-id",
"optionId": "option-id",
"startMonthDay": "startMonthDay",
"endMonthDay": "endMonthDay",
"weekdays": [
0
],
"startTimes": [
"startTimes"
],
"label": "label",
"createdAt": "2030-06-15T08:00:00.000Z",
"updatedAt": "2030-06-15T08:00:00.000Z",
"color": "color",
"retailPrices": {
"unit-id": 0
},
"retailPriceTiers": [
{
"minQuantity": null,
"maxQuantity": null,
"retail": null
}
]
}
]
}
],
"photos": [
{
"id": "entity-id",
"sortOrder": 0,
"contentType": "contentType",
"updatedAt": "2030-06-15T08:00:00.000Z"
}
]
}Autorizzazione
AuthorizationBearer <token>
Chiave tenant emessa dalla dashboard o da POST /api-keys, usata come Bearer token.
Scope richiesti: catalog:write
In: header
Body
Content-Type: application/json
supplierIdstring
minLength 1
namestring
minLength 1
reference?string
shortDescription?string
minLength 1
description?string
minLength 1
features?object[]
Mostra proprietà
typeenum
INCLUSIONEXCLUSIONPREBOOKING_INFORMATIONADDITIONAL_INFORMATION
shortDescriptionstring
minLength 1
depositPercentage?integer
min 0max 100
durationMinutesFrom?integer
min 0
durationMinutesTo?integer
min 0
timezone?string
minLength 1
locale?string
minLength 2
availabilityType?enum
START_TIMEOPENING_HOURS
status?enum
ACTIVEINACTIVE
metadata?object
Risposte
201object
Operazione riuscita. Lo schema descrive il JSON restituito.
Mostra schema
idstring
tenantIdstring
namestring
referencestring
createdAtdatetime
date-time
updatedAtdatetime
date-time
supplierIdstring
shortDescriptionstring | null
descriptionstring | null
featuresobject[] | null
Mostra proprietà
typestring
shortDescriptionstring
depositPercentageinteger
durationMinutesFrominteger | null
durationMinutesTointeger | null
timezonestring | null
localestring | null
availabilityTypeenum
START_TIMEOPENING_HOURS
statusenum
ACTIVEINACTIVE
metadataany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
optionsobject[]
Mostra proprietà
idstring
tenantIdstring
namestring
referencestring
createdAtdatetime
date-time
updatedAtdatetime
date-time
productIdstring
isDefaultboolean
durationMinutesinteger
sortOrderinteger
pricingPerenum | null
UNITRESOURCEBOOKING
cancellationCutoffAmountinteger
cancellationCutoffUnitstring
bookingCutoffMinutesinteger
requiredContactFieldsstring[]
restrictionsany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
metadataany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
unitsobject[]
Mostra proprietà
idstring
tenantIdstring
namestring
referencestring
createdAtdatetime
date-time
updatedAtdatetime
date-time
optionIdstring
typeenum
ADULTYOUTHCHILDINFANTFAMILYSENIORSTUDENTMILITARYOTHER
requiredContactFieldsstring[]
restrictionsany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
metadataany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
deletedAtdatetime | null
date-time
resourceRequirementsobject[]
Mostra proprietà
idstring
tenantIdstring
optionIdstring
resourceIdstring
quantityinteger
maxQuantityinteger | null
availabilityPeriodsobject[]
Mostra proprietà
idstring
tenantIdstring
optionIdstring
startMonthDaystring
endMonthDaystring
weekdaysinteger[]
startTimesstring[]
labelstring | null
createdAtdatetime
date-time
updatedAtdatetime
date-time
activeboolean
pricingBasisstring
Campo legacy; leggere i prezzi da pricing-periods.
currencystring
Campo legacy; la valuta corrente è tenant.defaultCurrency.
pricesany
Valore JSON libero; non usare per dedurre campi strutturati non documentati.
pricingPeriodsobject[]
Mostra proprietà
idstring
tenantIdstring
optionIdstring
startMonthDaystring
endMonthDaystring
weekdaysinteger[]
startTimesstring[]
labelstring | null
createdAtdatetime
date-time
updatedAtdatetime
date-time
colorstring | null
retailPricesobject
retailPriceTiersobject[] | null
Mostra proprietà
minQuantityinteger
maxQuantityinteger
retailinteger
Importo nelle unità minori della valuta: EUR 1250 = 12,50 EUR.
min 0
photosobject[]
Mostra proprietà
idstring
sortOrderinteger
contentTypestring
updatedAtdatetime
date-time
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.