Ordini dei clienti
Gli endpoint degli ordini dei clienti consentono a un negozio esterno di leggere gli articoli configurati, aggiornare le quantità, far avanzare un ordine tra gli stati di evasione ed eliminare ordini abbandonati.
| Parametro | Obbligatorio | Dettagli |
|---|---|---|
name | no | Cerca per nome del design e ID numerico dell'ordine. |
category_id | no | Filtra per ID della categoria del prodotto. |
order_status | no | Uno degli stati dell'ordine consentiti. |
offset | no | Predefinito 0. Deve essere >= 0. |
limit | no | Predefinito 9 per questo controller, massimo 50. |
order_by | no | id, created_at o design_name. |
direction | no | ASC o DESC. |
Esempio di richiesta (fetch)
const params = new URLSearchParams({
limit: '20',
offset: '0',
order_status: 'shopping_cart',
order_by: 'created_at',
direction: 'DESC'
});
const orders = await alterFetch(`/customer-orders?${params.toString()}`);
const order = await alterFetch('/customer-orders/123');
const batch = await alterFetch('/customer-orders/batch', {
method: 'POST',
body: JSON.stringify({
customerOrderIds: [123, 124, 125]
})
});Valori consentiti
| Stato | Descrizione |
|---|---|
shopping_cart | Flusso del carrello; il cliente può ancora modificare la configurazione. |
editable | L'ordine resta modificabile dal cliente. |
paid | L'ordine è pagato e pronto per l'evasione. |
processing | L'ordine è in fase di evasione. |
completed | L'ordine è stato evaso. |
cancelled | L'ordine è stato annullato. |
Esempio di richiesta (fetch)
await alterFetch('/customer-orders/123/status', {
method: 'PATCH',
body: JSON.stringify({
status: 'processing'
})
});
await alterFetch('/customer-orders/123/quantity', {
method: 'PATCH',
body: JSON.stringify({
items: [
{ orderDetailId: 987, quantity: 3 }
]
})
});
await alterFetch('/customer-orders/123/quantity/all', {
method: 'PATCH',
body: JSON.stringify({
quantity: 2
})
});
await alterFetch('/customer-orders/123', {
method: 'DELETE'
});Esempio di risposta
{
"order": {
"id": 123,
"customizerId": 381,
"orderStatus": "shopping_cart",
"createdAt": "2026-05-28T10:15:00.000Z",
"customizerOrderURL": "https://alterproduct.com/app/customizer/381/123",
"productItems": [
{
"id": 987,
"model3d": { "id": 381 },
"size": {
"id": 395,
"name": { "pl": "M", "en": "M" },
"measureSize": null
},
"material": {
"id": 2,
"name": { "pl": "Bawełna", "en": "Cotton" }
},
"printType": {
"id": 1,
"name": { "pl": "DTG", "en": "DTG" }
},
"color": {
"id": 418,
"name": { "pl": "Domyślny", "en": "Default" },
"hex": "#ffffff"
},
"variant": {
"id": 531,
"metadata": null,
"stockQuantity": 25
},
"unitPrice": { "value": 12.5, "currency": "EUR" },
"totalPrice": { "value": 37.5, "currency": "EUR" },
"quantity": 3
}
],
"customizerName": "Men's T-Shirt",
"productGroup": {
"id": 4,
"name": { "pl": "Koszulka", "en": "T-Shirt" }
},
"totalPrice": { "value": 37.5, "currency": "EUR" }
}
}