{"openapi":"3.1.0","info":{"title":"API pubblica AzSeller","version":"1.0.0","description":"API REST per collegare gestionali, agenzie, Zapier e Make a un negozio AzSeller.\n\n## Autenticazione\nOgni chiamata porta `Authorization: Bearer azs_live_...` ed e' **solo in HTTPS**: in http la risposta e' `403 https_required`. La chiave si crea nel back office in **Impostazioni → API e integrazioni** (compare quando l'API e' attiva per il negozio) e lavora solo sul negozio che l'ha creata. Livelli: **Sola lettura** (solo GET) e **Lettura e scrittura**. Le chiamate sono per i server: niente CORS, la chiave non va mai in una pagina web.\n\n## Limiti\n2 richieste al secondo con picchi fino a 40, 50.000 al giorno per negozio (giorno UTC). Le risposte portano `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Daily-Limit` e `X-RateLimit-Daily-Remaining`; oltre il limite la risposta e' `429` con `Retry-After` in secondi. Corpo delle richieste: massimo 1 MB.\n\n## Paginazione\nGli elenchi rispondono `{ data, next_cursor }`. Senza filtri dal piu' recente; con `updated_since` per data di modifica crescente, per una sincronizzazione incrementale: si riparte dall'ultimo `updated_at` visto e nessuna riga si perde o si ripete. `limit` da 1 a 250 (predefinito 50).\n\n## Scritture\nOgni POST e PATCH richiede `Idempotency-Key` (1-100 caratteri: lettere, numeri, `. _ : -`). La stessa chiave con lo stesso corpo entro 24 ore ripete la prima risposta, con `Idempotent-Replayed: true`, senza rifare la scrittura; con un corpo diverso risponde `422`. Usa una chiave nuova per ogni operazione nuova (es. un UUID).\n\nLe scritture di uno stesso negozio vanno una alla volta: se un'altra e' in corso la risposta e' `409 busy` con `Retry-After`.\n\nGiacenza, prezzo, status e tracking si applicano subito, con gli stessi effetti del back office (marketplace, email al cliente, scarico del magazzino). La creazione dei prodotti e' in coda: `202` con l'id del lavoro, l'esito con `GET /jobs/{id}`.\n\n## Trova o crea\nMarca, fornitore, categorie, varianti, attributi e tag si indicano per id o per nome: un nome che non esiste viene creato (confronto senza maiuscole e spazi ai lati, nella lingua predefinita del negozio). Un campo obbligatorio mancante (es. la marca) e' invece un errore; senza fornitore si usa il negozio stesso, le categorie sono facoltative.\n\n## Errori\nSempre `{ \"error\": { \"code\", \"message\", \"details\" } }`. Il `code` e' stabile, il `message` e' in italiano e puo' cambiare.\n\n## Webhook\nGli eventi si ricevono come `POST` JSON firmati: `X-AzSeller-Signature: t=<secondi>,v1=<firma>`, dove la firma e' l'HMAC-SHA256 esadecimale, con il segreto del webhook, di `t + \".\" + corpo`. Scarta firme diverse o con `t` piu' vecchio di 5 minuti. Altre intestazioni: `X-AzSeller-Event`, `X-AzSeller-Delivery`. Rispondi 2xx entro 10 secondi; altrimenti si riprova dopo 1 min, 5 min, 30 min, 2 h, 6 h e 24 h, e dopo 3 giorni di soli errori il webhook si spegne.\n\nEventi: `order.created` (Ordine creato), `order.paid` (Ordine pagato), `order.status_changed` (Status ordine cambiato), `order.shipped` (Ordine spedito), `inventory.changed` (Giacenza cambiata), `product.created` (Prodotto creato), `product.updated` (Prodotto modificato), `customer.created` (Cliente registrato), `return.requested` (Reso richiesto).","contact":{"name":"AzSeller","url":"https://www.azseller.it/contatti"}},"servers":[{"url":"https://public-api.azseller.app/public/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Negozio"},{"name":"Ordini"},{"name":"Prodotti"},{"name":"Giacenze"},{"name":"Clienti"},{"name":"Catalogo","description":"Marche, fornitori, categorie, varianti, attributi e tag"},{"name":"Webhook"}],"paths":{"/me":{"get":{"operationId":"getMe","tags":["Negozio"],"summary":"Negozio e chiave","description":"Prova della connessione: negozio della chiave e suo livello.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shop"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/order-statuses":{"get":{"operationId":"listOrderStatuses","tags":["Ordini"],"summary":"Stati degli ordini","description":"Stati scelti dal negozio (Impostazioni → Ordini), nella lingua predefinita; senza scelta, tutti.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderStatus"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/orders":{"get":{"operationId":"listOrders","tags":["Ordini"],"summary":"Elenco ordini","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/UpdatedSince"},{"name":"status","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"description":"Id da /order-statuses"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/orders/{id}":{"get":{"operationId":"getOrder","tags":["Ordini"],"summary":"Un ordine","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Order"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/orders/{id}/status":{"post":{"operationId":"updateOrderStatus","tags":["Ordini"],"summary":"Cambia lo status","description":"Come dal back office: email al cliente, scarico o ricarico del magazzino e invio ai marketplace secondo le impostazioni del negozio.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status_id"],"properties":{"status_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6","description":"Id da /order-statuses"}}}}}},"responses":{"200":{"description":"Ordine aggiornato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Order"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"description":"Aggiornamento rifiutato (es. dal marketplace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"order_update_failed","message":"Aggiornamento non riuscito"}}}}}}}}},"/orders/{id}/tracking":{"post":{"operationId":"updateOrderTracking","tags":["Ordini"],"summary":"Aggiunge il tracking","description":"Corriere e numero di tracking su tutte le righe o solo su quelle degli `skus` indicati; inviati ai marketplace come dal back office.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["carrier","tracking_number"],"properties":{"carrier":{"type":"string","maxLength":60,"example":"BRT"},"tracking_number":{"type":"string","maxLength":100},"skus":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Ordine aggiornato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Order"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"description":"Aggiornamento rifiutato","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"order_update_failed","message":"Aggiornamento non riuscito"}}}}}}}}},"/products":{"get":{"operationId":"listProducts","tags":["Prodotti"],"summary":"Elenco prodotti","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/UpdatedSince"},{"$ref":"#/components/parameters/Lang"},{"name":"sku","in":"query","schema":{"type":"string"}},{"name":"ean","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createProduct","tags":["Prodotti"],"summary":"Crea un prodotto (in coda)","description":"Il prodotto entra completo, come creato dal back office: marca, fornitore, categorie, varianti, attributi e tag mancanti vengono creati. I controlli sul corpo sono immediati (400); quelli che richiedono il catalogo (es. `sku_exists`) arrivano nell'esito del lavoro.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"200":{"description":"Stessa Idempotency-Key di un lavoro gia' creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Job"}}}}}},"202":{"description":"Lavoro in coda","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Job"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/products/{id}":{"get":{"operationId":"getProduct","tags":["Prodotti"],"summary":"Un prodotto","parameters":[{"$ref":"#/components/parameters/Id"},{"$ref":"#/components/parameters/Lang"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products/{id}/price":{"patch":{"operationId":"updateProductPrice","tags":["Prodotti"],"summary":"Aggiorna i prezzi delle varianti","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceUpdate"}}}},"responses":{"200":{"description":"Prezzi aggiornati","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"product_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"sku":{"type":["string","null"]},"price":{"type":["number","null"]},"price_net":{"type":["number","null"]},"compare_at_price":{"type":["number","null"]}}}}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"Richiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`."}},"/jobs/{id}":{"get":{"operationId":"getJob","tags":["Prodotti"],"summary":"Esito di un lavoro","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Job"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/inventory":{"get":{"operationId":"listInventory","tags":["Giacenze"],"summary":"Giacenze per variante","description":"Una riga per variante; la pagina conta i prodotti. Con `sku` o `ean` solo la variante cercata.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/UpdatedSince"},{"name":"sku","in":"query","schema":{"type":"string"}},{"name":"ean","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryRow"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateInventory","tags":["Giacenze"],"summary":"Imposta la giacenza","description":"Giacenza assoluta di fino a 100 varianti. Ogni riga ha il suo esito; i marketplace ricevono la nuova giacenza secondo le regole del negozio.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryUpdate"}}}},"responses":{"200":{"description":"Esito per riga","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryResult"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customers":{"get":{"operationId":"listCustomers","tags":["Clienti"],"summary":"Elenco clienti","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/UpdatedSince"},{"name":"email","in":"query","schema":{"type":"string"},"description":"Uguale, senza distinzione di maiuscole"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{id}":{"get":{"operationId":"getCustomer","tags":["Clienti"],"summary":"Un cliente","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Customer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/brands":{"get":{"operationId":"listBrands","tags":["Catalogo"],"summary":"Elenco marche","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Brand"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"findOrCreateBrands","tags":["Catalogo"],"summary":"Trova o crea una marca","description":"`201` se qualcosa e' stato creato, `200` se esisteva gia'.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Esisteva gia'","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CatalogResult"}}}}}},"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CatalogResult"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/suppliers":{"get":{"operationId":"listSuppliers","tags":["Catalogo"],"summary":"Elenco fornitori","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"findOrCreateSuppliers","tags":["Catalogo"],"summary":"Trova o crea un fornitore","description":"`201` se qualcosa e' stato creato, `200` se esisteva gia'.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Esisteva gia'","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CatalogResult"}}}}}},"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CatalogResult"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/categories":{"get":{"operationId":"listCategories","tags":["Catalogo"],"summary":"Elenco categorie","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"findOrCreateCategories","tags":["Catalogo"],"summary":"Trova o crea una categoria","description":"`201` se qualcosa e' stato creato, `200` se esisteva gia'.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"`path` dalla radice (i livelli mancanti vengono creati sotto il padre giusto) oppure `name` (un solo nome, cercato a qualunque livello).","properties":{"path":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":6,"example":["Scarpe","Uomo"]},"name":{"type":"string"}}}}}},"responses":{"200":{"description":"Esisteva gia'","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CatalogResult"}}}}}},"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CatalogResult"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/variants":{"get":{"operationId":"listVariants","tags":["Catalogo"],"summary":"Elenco tipi di variante con i valori","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"findOrCreateVariants","tags":["Catalogo"],"summary":"Trova o crea tipi e valori di variante","description":"`201` se qualcosa e' stato creato, `200` se esisteva gia'.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","values"],"properties":{"name":{"type":"string","example":"Taglia"},"values":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"string"},"example":["42","43"]}}}}}},"responses":{"200":{"description":"Esisteva gia'","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6","description":"Id del tipo"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"created":{"$ref":"#/components/schemas/Created"}}}}}}}},"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6","description":"Id del tipo"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"created":{"$ref":"#/components/schemas/Created"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/attributes":{"get":{"operationId":"listAttributes","tags":["Catalogo"],"summary":"Elenco attributi con i valori","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"findOrCreateAttributes","tags":["Catalogo"],"summary":"Trova o crea attributi e valori","description":"`201` se qualcosa e' stato creato, `200` se esisteva gia'.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","values"],"properties":{"name":{"type":"string","example":"Taglia"},"values":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"string"},"example":["42","43"]}}}}}},"responses":{"200":{"description":"Esisteva gia'","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6","description":"Id del tipo"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"created":{"$ref":"#/components/schemas/Created"}}}}}}}},"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6","description":"Id del tipo"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"created":{"$ref":"#/components/schemas/Created"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/tags":{"get":{"operationId":"listTags","tags":["Catalogo"],"summary":"Elenco tag","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"next_cursor":{"type":["string","null"],"description":"Da passare in `cursor` per la pagina dopo; null = fine."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"findOrCreateTags","tags":["Catalogo"],"summary":"Trova o crea tag","description":"`201` se qualcosa e' stato creato, `200` se esisteva gia'.\n\nRichiede una chiave **Lettura e scrittura** e l'intestazione `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["names"],"properties":{"names":{"type":"array","minItems":1,"maxItems":30,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Esisteva gia'","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"}},"created":{"$ref":"#/components/schemas/Created"}}}}}}}},"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"}},"created":{"$ref":"#/components/schemas/Created"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/webhooks":{"post":{"operationId":"createWebhook","tags":["Webhook"],"summary":"Crea un webhook","description":"Sottoscrizione a uno o piu' eventi. Il `secret` per verificare la firma compare solo in questa risposta. Basta una chiave di sola lettura: il webhook legge, non scrive.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://","description":"Server pubblico in https"},"events":{"type":"array","items":{"type":"string","enum":["order.created","order.paid","order.status_changed","order.shipped","inventory.changed","product.created","product.updated","customer.created","return.requested"]}},"event":{"type":"string","enum":["order.created","order.paid","order.status_changed","order.shipped","inventory.changed","product.created","product.updated","customer.created","return.requested"],"description":"Alternativa a events per un evento solo"},"source":{"type":"string","enum":["api","zapier","make"],"default":"api"}}}}}},"responses":{"201":{"description":"Creato","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","tags":["Webhook"],"summary":"Elimina un webhook","description":"Solo webhook creati via API, Zapier o Make: quelli creati nel back office si gestiscono da li'.","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"204":{"description":"Eliminato"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/sample/{event}":{"get":{"operationId":"getWebhookSample","tags":["Webhook"],"summary":"Esempi di un evento","description":"Gli ultimi 3 eventi reali di quel tipo o, se non ce ne sono, uno costruito con un dato reale del negozio (per mappare i campi in Zapier e Make).","parameters":[{"name":"event","in":"path","required":true,"schema":{"type":"string","enum":["order.created","order.paid","order.status_changed","order.shipped","inventory.changed","product.created","product.updated","customer.created","return.requested"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"webhooks":{"order.created":{"post":{"operationId":"webhook_order_created","summary":"Ordine creato","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"order.created"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"order.paid":{"post":{"operationId":"webhook_order_paid","summary":"Ordine pagato","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"order.paid"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"order.status_changed":{"post":{"operationId":"webhook_order_status_changed","summary":"Status ordine cambiato","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"order.status_changed"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"order.shipped":{"post":{"operationId":"webhook_order_shipped","summary":"Ordine spedito","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"order.shipped"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"inventory.changed":{"post":{"operationId":"webhook_inventory_changed","summary":"Giacenza cambiata","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"inventory.changed"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"product.created":{"post":{"operationId":"webhook_product_created","summary":"Prodotto creato","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"product.created"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"product.updated":{"post":{"operationId":"webhook_product_updated","summary":"Prodotto modificato","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"product.updated"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"customer.created":{"post":{"operationId":"webhook_customer_created","summary":"Cliente registrato","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"customer.created"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}},"return.requested":{"post":{"operationId":"webhook_return_requested","summary":"Reso richiesto","parameters":[{"name":"X-AzSeller-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1763650000,v1=5f2b..."}},{"name":"X-AzSeller-Event","in":"header","required":true,"schema":{"type":"string","const":"return.requested"}},{"name":"X-AzSeller-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Ricevuto (qualunque 2xx)"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"azs_live_...","description":"Chiave creata in Impostazioni → API e integrazioni"}},"parameters":{"Id":{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"}},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":250,"default":50}},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` della pagina prima"},"UpdatedSince":{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Solo righe modificate da questa data, in ordine di modifica crescente"},"Lang":{"name":"lang","in":"query","schema":{"type":"string","example":"en"},"description":"Lingua dei testi; senza, o se il negozio non la ha, la predefinita"},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":100,"pattern":"^[\\w.:-]+$"}}},"responses":{"BadRequest":{"description":"Richiesta non valida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"invalid_request","message":"Richiesta non valida"}}}}}},"Unauthorized":{"description":"Chiave mancante o non valida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"unauthorized","message":"Chiave API mancante o non valida"}}}}}},"Forbidden":{"description":"API spenta per il negozio, IP non ammesso, IP bloccato per troppi tentativi o chiave di sola lettura","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"forbidden","message":"La chiave non ha il livello necessario"}}}}}},"NotFound":{"description":"Non trovato (o di un altro negozio)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"not_found","message":"Risorsa non trovata"}}}}}},"Conflict":{"description":"Scrittura in corso sullo stesso negozio (`busy`, con Retry-After), stessa Idempotency-Key ancora in corso (`request_in_progress`) o SKU gia' presente (`sku_exists`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"busy","message":"Risorsa occupata da un'altra scrittura: riprova"}}}}}},"Unprocessable":{"description":"Dati coerenti ma non applicabili (es. categoria ambigua, Idempotency-Key gia' usata con un altro corpo)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"invalid_request","message":"Richiesta non valida"}}}}}},"RateLimited":{"description":"Limite al secondo (`rate_limited`) o giornaliero (`daily_limit`) superato","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondi da aspettare"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"rate_limited","message":"Troppe richieste: riprova dopo il tempo indicato in Retry-After"}}}}}},"InternalError":{"description":"Errore interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error","example":{"error":{"code":"internal_error","message":"Errore interno"}}}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized","ip_blocked","api_disabled","ip_not_allowed","forbidden","rate_limited","daily_limit","not_found","invalid_request","payload_too_large","busy","sku_exists","order_update_failed","request_in_progress","internal_error","https_required"]},"message":{"type":"string","description":"Testo leggibile, in italiano: puo' cambiare, non usarlo nel codice."},"details":{"description":"Informazioni in piu' per alcuni errori (es. `sku_exists`: product_id e sku)."}}}},"example":{"error":{"code":"not_found","message":"Risorsa non trovata"}}},"Shop":{"type":"object","properties":{"shop":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]},"website":{"type":["string","null"]}}},"key":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string","enum":["read","write"]}}}}},"OrderStatus":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]}}},"Address":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"street1":{"type":["string","null"]},"street2":{"type":["string","null"]},"city":{"type":["string","null"]},"province":{"type":["string","null"]},"postal_code":{"type":["string","null"]},"country":{"type":["string","null"],"description":"Codice ISO 3166-1 alpha-2"},"phone":{"type":["string","null"]}}},"InvoiceAddress":{"type":["object","null"],"properties":{"company":{"type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"postal_code":{"type":["string","null"]},"province":{"type":["string","null"]},"country":{"type":["string","null"]},"vat_number":{"type":["string","null"]},"fiscal_code":{"type":["string","null"]},"sdi":{"type":["string","null"]},"pec":{"type":["string","null"]}}},"Order":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"order_number":{"type":["string","null"]},"platform":{"type":["string","null"],"description":"Canale di vendita (Website, Amazon, Ebay, Shopify, TikTok, POS...)"},"marketplace":{"type":["string","null"]},"status":{"type":["object","null"],"properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]}}},"payment":{"type":"object","properties":{"method":{"type":["string","null"]},"status":{"type":["string","null"]},"paid_at":{"type":["string","null"],"format":"date-time"}}},"currency":{"type":["string","null"]},"totals":{"type":"object","properties":{"subtotal":{"type":["number","null"]},"shipping":{"type":["number","null"]},"discount":{"type":["number","null"]},"tax":{"type":["number","null"]},"total":{"type":["number","null"]},"refunded":{"type":["number","null"]}}},"shipping_method":{"type":["string","null"]},"shipped_at":{"type":["string","null"],"format":"date-time"},"cancelled_at":{"type":["string","null"],"format":"date-time"},"customer":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"email":{"type":["string","null"]},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]}}},"shipping_address":{"$ref":"#/components/schemas/Address"},"invoice_address":{"$ref":"#/components/schemas/InvoiceAddress"},"coupon":{"type":["string","null"]},"note":{"type":["string","null"]},"lang":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"variant_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"sku":{"type":["string","null"]},"title":{"type":["string","null"]},"quantity":{"type":["number","null"]},"quantity_shipped":{"type":["number","null"]},"price":{"type":["number","null"],"description":"Prezzo unitario IVA inclusa"},"vat":{"type":["number","null"]},"tracking":{"type":["object","null"],"properties":{"carrier":{"type":["string","null"]},"number":{"type":["string","null"]}}}}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"VariantOption":{"type":"object","properties":{"name":{"type":["string","null"],"example":"Taglia"},"value":{"type":["string","null"],"example":"42"},"name_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"value_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"}}},"Variant":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"sku":{"type":["string","null"]},"ean":{"type":["string","null"]},"active":{"type":"boolean"},"price":{"type":["number","null"],"description":"Prezzo IVA inclusa"},"price_net":{"type":["number","null"],"description":"Prezzo senza IVA"},"compare_at_price":{"type":["number","null"],"description":"Prezzo di partenza (barrato), IVA inclusa"},"currency":{"type":["string","null"]},"quantity":{"type":["number","null"]},"options":{"type":"array","items":{"$ref":"#/components/schemas/VariantOption"}}}},"Product":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]},"description":{"type":["string","null"],"description":"HTML"},"slug":{"type":["string","null"]},"url":{"type":["string","null"]},"active":{"type":"boolean"},"model":{"type":["string","null"]},"brand_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"category_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"}},"supplier_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"}},"vat":{"type":["number","null"],"description":"Aliquota IVA in percentuale"},"condition":{"type":["string","null"]},"weight":{"type":["number","null"]},"dimensions":{"type":"object","properties":{"length":{"type":["number","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]}}},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"url":{"type":"string"},"alt":{"type":["string","null"]}}}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"InventoryRow":{"type":"object","properties":{"product_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"variant_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"sku":{"type":["string","null"]},"ean":{"type":["string","null"]},"quantity":{"type":["number","null"]},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Customer":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"email":{"type":["string","null"]},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"newsletter":{"type":"boolean"},"type":{"type":["string","null"]},"lang":{"type":["string","null"]},"active":{"type":"boolean"},"shipping_addresses":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Address"},{"type":"object","properties":{"default":{"type":"boolean"}}}]}},"invoice_address":{"$ref":"#/components/schemas/InvoiceAddress"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Brand":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]},"active":{"type":"boolean"}}},"Supplier":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]}}},"Category":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]},"parent_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"level":{"type":"integer"},"active":{"type":"boolean"}}},"OptionType":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]}}}}}},"Tag":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":["string","null"]}}},"Created":{"type":"object","description":"Anagrafiche create da questa richiesta (vuote se esistevano gia').","properties":{"brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"suppliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"},"parent_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"}}}},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"attributes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"name":{"type":"string"}}}}}},"CatalogResult":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"created":{"$ref":"#/components/schemas/Created"}}},"CategoryRef":{"description":"Id di una categoria, un nome (cercato a qualunque livello: se e' ambiguo serve il percorso) o un percorso dalla radice. Un nome e' sempre un nome solo: i separatori come `>` o `/` non dividono i livelli.","oneOf":[{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},{"type":"string","example":"Sneakers"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":6,"example":["Scarpe","Uomo","Sneakers"]}]},"ProductCreate":{"type":"object","required":["name","brand","variants"],"properties":{"name":{"type":"string","maxLength":250},"description":{"type":"string","description":"HTML, al massimo 50.000 caratteri"},"model":{"type":"string","maxLength":100},"brand":{"type":"string","description":"Id o nome della marca: se il nome non esiste la marca viene creata."},"supplier":{"type":"string","description":"Id o nome del fornitore: se il nome non esiste viene creato. Senza, il fornitore è il negozio stesso (con il suo nome)."},"categories":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/CategoryRef"},"description":"Facoltative: si possono aggiungere dopo dal back office."},"vat":{"type":"number","minimum":0,"maximum":100,"description":"Aliquota IVA; senza, quella predefinita del negozio."},"active":{"type":"boolean","default":false,"description":"Pubblicato sul sito. Di norma si crea spento e lo si accende dopo il controllo."},"weight":{"type":"number"},"dimensions":{"type":"object","properties":{"length":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}}},"images":{"type":"array","maxItems":12,"items":{"type":"string","format":"uri","pattern":"^https://"},"description":"Indirizzi https pubblici: le immagini vengono scaricate e salvate nello storage del negozio."},"attributes":{"type":"array","maxItems":30,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","example":"Materiale"},"value":{"type":"string","example":"Pelle"}}},"description":"Attributi e valori mancanti vengono creati."},"tags":{"type":"array","maxItems":30,"items":{"type":"string"}},"variants":{"type":"array","minItems":1,"maxItems":250,"items":{"type":"object","properties":{"sku":{"type":"string","maxLength":100,"description":"Senza, viene generato come dal pulsante del back office. Uno SKU gia' presente nel negozio fa fallire la creazione (`sku_exists`)."},"ean":{"type":"string","maxLength":20},"price":{"type":"number","minimum":0,"description":"IVA inclusa. Serve `price` oppure `price_net`."},"price_net":{"type":"number","minimum":0,"description":"Senza IVA"},"compare_at_price":{"type":"number","minimum":0,"description":"Prezzo barrato, IVA inclusa; senza, uguale a price."},"quantity":{"type":"integer","minimum":0,"default":0},"options":{"type":"object","maxProperties":5,"additionalProperties":{"type":"string"},"example":{"Taglia":"42","Colore":"Nero"},"description":"Obbligatorio con piu' varianti. Tipi e valori di variante mancanti vengono creati."}}}}},"example":{"name":"Sneaker Runner","brand":"Acme","supplier":"Distributore Nord","categories":[["Scarpe","Uomo"]],"images":["https://example.com/img/runner.jpg"],"attributes":[{"name":"Materiale","value":"Pelle"}],"variants":[{"sku":"RUN-42","price":89.9,"quantity":5,"options":{"Taglia":"42"}},{"sku":"RUN-43","price":89.9,"quantity":3,"options":{"Taglia":"43"}}]}},"Job":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"kind":{"type":"string","enum":["product.create"]},"status":{"type":"string","enum":["queued","running","done","failed"]},"result":{"type":["object","null"],"description":"Con status `done`","properties":{"product_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"sku":{"type":["string","null"]}}}},"images":{"type":"integer","description":"Immagini salvate"},"images_requested":{"type":"integer"},"created":{"$ref":"#/components/schemas/Created"}}},"error":{"type":["object","null"],"description":"Con status `failed`. Codici: quelli di Error piu' `url_conflict` e `worker_lost`.","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}},"created_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"InventoryUpdate":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["quantity"],"description":"Serve uno fra variant_id, sku ed ean (in quest'ordine di priorita').","properties":{"variant_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"sku":{"type":"string"},"ean":{"type":"string"},"quantity":{"type":"integer","minimum":0,"description":"Giacenza assoluta (non una differenza)"}}}}},"example":{"items":[{"sku":"RUN-42","quantity":7}]}},"InventoryResult":{"type":"object","properties":{"variant_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"sku":{"type":["string","null"]},"ean":{"type":["string","null"]},"status":{"type":"string","enum":["updated","unchanged","not_found","ambiguous","invalid"]},"message":{"type":"string"},"product_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"previous_quantity":{"type":"integer"},"quantity":{"type":"integer"}}},"PriceUpdate":{"type":"object","required":["variants"],"properties":{"variants":{"type":"array","minItems":1,"maxItems":250,"items":{"type":"object","description":"variant_id oppure sku; price (IVA inclusa) oppure price_net: l'altro si calcola con l'IVA del prodotto.","properties":{"variant_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"sku":{"type":"string"},"price":{"type":"number","minimum":0},"price_net":{"type":"number","minimum":0},"compare_at_price":{"type":"number","minimum":0}}}}},"example":{"variants":[{"sku":"RUN-42","price":79.9,"compare_at_price":89.9}]}},"WebhookEvent":{"type":"object","description":"Corpo di ogni chiamata webhook. `data` ha la stessa forma della lettura corrispondente: Order (piu' `previous_status_id` in order.status_changed), Product, una riga InventoryRow con `previous_quantity`, Customer, ReturnRequest.","properties":{"id":{"type":"string","description":"Id dell'evento: uguale nei ritentativi, usalo per scartare i doppioni."},"type":{"type":"string","enum":["order.created","order.paid","order.status_changed","order.shipped","inventory.changed","product.created","product.updated","customer.created","return.requested"]},"created_at":{"type":"string","format":"date-time"},"shop_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"test":{"type":"boolean","description":"Solo negli eventi di prova"},"data":{"type":"object"}}},"ReturnRequest":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"6650c1f2a8b4e1d2c3f4a5b6"},"order_number":{"type":["string","null"]},"status":{"type":["string","null"]},"resolution":{"type":["string","null"]},"reason":{"type":["string","null"]},"customer":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"email":{"type":["string","null"]}}},"total":{"type":["number","null"]},"items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"variant_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"sku":{"type":["string","null"]},"title":{"type":["string","null"]},"quantity":{"type":["number","null"]}}}},"created_at":{"type":"string","format":"date-time"}}}}}}