GET https://alterproduct.com/public-api/v1/customer-orders/:id
Endpoint zwraca pełne szczegóły pojedynczego zamówienia klienta – w tym status, przypisany projekt, model 3D, link do edycji, wybrany wariant oraz całkowitą cenę.
Przykład żądania (fetch)
const res = await fetch('https://alterproduct.com/public-api/v1/customer-orders/1', {
method: 'GET',
headers: {
'x-alter-access-key': 'YOUR_API_KEY',
'x-alter-access-token': 'YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const data = await res.json();
console.log(data);
Przykładowa odpowiedź
{
"success": true,
"customerOrder": {
"id": 1,
"customizerId": 10,
"orderStatus": "pending",
"createdAt": "2025-07-28T14:18:20.000Z",
"customizerOrderURL": "https://alterproduct.com/app/customizer/10/1",
"productItems": [
{
"id": 1,
"model3d": {
"id": 10
},
"size": {
"id": 9,
"name": {
"pl": "450ml (15oz)",
"en": "450ml (15oz)"
},
"measureSize": {
"D": 8.65,
"H": 11.95
}
},
"material": {
"id": 3,
"name": {
"pl": "Ceramika",
"en": "Ceramic"
}
},
"printType": {
"id": 5,
"name": {
"pl": "Sublimacja",
"en": "Sublimation"
}
},
"color": {
"id": 11,
"name": {
"pl": "Domyślny",
"en": "Default"
},
"hex": "#FFFFFF"
},
"variant": {
"id": 11,
"productGroupId": 1,
"productModel3dId": 3,
"sizeId": 9,
"materialId": 3,
"printTypeId": 5,
"colorId": 11,
"metadata": null,
"minOrderQuantity": null,
"processingTime": null,
"stockQuantity": null,
"volume": null,
"weight": null
},
"unitPrice": {
"value": 0,
"currency": "EUR"
},
"totalPrice": {
"value": 0,
"currency": "EUR"
},
"quantity": 1,
"updatedAt": "2025-07-28 14:18:20.000000"
}
],
"designName": "Mug 450ml (15oz)",
"productGroup": {
"id": 1,
"name": {
"pl": "Kubek 450ml (15oz)",
"en": "Mug 450ml (15oz)"
}
},
"totalPrice": {
"value": 0,
"currency": "EUR"
}
}
}
POST https://alterproduct.com/public-api/v1/customer-orders/batch
Endpoint pozwala pobrać listę zamówień na podstawie ich ID. Szczególnie przydatny, gdy użytkownik dodał wiele projektów do koszyka.
Przykład żądania
JSON body:
{
"customerOrderIds": [1, 2, 3]
}
fetch (Node.js):
const response = await fetch('https://alterproduct.com/public-api/v1/customer-orders/batch', {
method: 'POST',
headers: {
'x-alter-access-key': 'YOUR_API_KEY',
'x-alter-access-token': 'YOUR_API_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
customerOrderIds: [1, 2, 3]
})
});
const data = await response.json();
console.log(data);
Przykładowa odpowiedź
{
"success": true,
"customerOrders": [
{
"id": 1,
"customizerId": 10,
"orderStatus": "pending",
"createdAt": "2025-07-28T14:18:20.000Z",
"customizerOrderURL": "https://alterproduct.com/app/customizer/10/1",
"productItems": [
{
"id": 1,
"model3d": {
"id": 10
},
"size": {
"id": 9,
"name": {
"pl": "450ml (15oz)",
"en": "450ml (15oz)"
},
"measureSize": {
"D": 8.65,
"H": 11.95
}
},
"material": {
"id": 3,
"name": {
"pl": "Ceramika",
"en": "Ceramic"
}
},
"printType": {
"id": 5,
"name": {
"pl": "Sublimacja",
"en": "Sublimation"
}
},
"color": {
"id": 11,
"name": {
"pl": "Domyślny",
"en": "Default"
},
"hex": "#FFFFFF"
},
"variant": {
"id": 11,
"productGroupId": 1,
"productModel3dId": 3,
"sizeId": 9,
"materialId": 3,
"printTypeId": 5,
"colorId": 11,
"metadata": null,
"minOrderQuantity": null,
"processingTime": null,
"stockQuantity": null,
"volume": null,
"weight": null
},
"unitPrice": {
"value": 0,
"currency": "EUR"
},
"totalPrice": {
"value": 0,
"currency": "EUR"
},
"quantity": 1,
"updatedAt": "2025-07-28 14:18:20.000000"
}
],
"designName": "Mug 450ml (15oz)",
"productGroup": {
"id": 1,
"name": {
"pl": "Kubek 450ml (15oz)",
"en": "Mug 450ml (15oz)"
}
},
"totalPrice": {
"value": 0,
"currency": "EUR"
}
},
{
"id": 2,
"customizerId": 10,
"orderStatus": "pending",
"createdAt": "2025-07-28T14:20:48.000Z",
"customizerOrderURL": "https://alterproduct.com/app/customizer/10/2",
"productItems": [
{
"id": 2,
"model3d": {
"id": 10
},
"size": {
"id": 9,
"name": {
"pl": "450ml (15oz)",
"en": "450ml (15oz)"
},
"measureSize": {
"D": 8.65,
"H": 11.95
}
},
"material": {
"id": 3,
"name": {
"pl": "Ceramika",
"en": "Ceramic"
}
},
"printType": {
"id": 5,
"name": {
"pl": "Sublimacja",
"en": "Sublimation"
}
},
"color": {
"id": 11,
"name": {
"pl": "Domyślny",
"en": "Default"
},
"hex": "#FFFFFF"
},
"variant": {
"id": 11,
"productGroupId": 1,
"productModel3dId": 3,
"sizeId": 9,
"materialId": 3,
"printTypeId": 5,
"colorId": 11,
"metadata": null,
"minOrderQuantity": null,
"processingTime": null,
"stockQuantity": null,
"volume": null,
"weight": null
},
"unitPrice": {
"value": 0,
"currency": "EUR"
},
"totalPrice": {
"value": 0,
"currency": "EUR"
},
"quantity": 1,
"updatedAt": "2025-07-28 14:20:48.000000"
}
],
"designName": "Mug 450ml (15oz)",
"productGroup": {
"id": 1,
"name": {
"pl": "Kubek 450ml (15oz)",
"en": "Mug 450ml (15oz)"
}
},
"totalPrice": {
"value": 0,
"currency": "EUR"
}
},
{
"id": 3,
"customizerId": 10,
"orderStatus": "pending",
"createdAt": "2025-07-28T14:21:19.000Z",
"customizerOrderURL": "https://alterproduct.com/app/customizer/10/3",
"productItems": [
{
"id": 3,
"model3d": {
"id": 10
},
"size": {
"id": 9,
"name": {
"pl": "450ml (15oz)",
"en": "450ml (15oz)"
},
"measureSize": {
"D": 8.65,
"H": 11.95
}
},
"material": {
"id": 3,
"name": {
"pl": "Ceramika",
"en": "Ceramic"
}
},
"printType": {
"id": 5,
"name": {
"pl": "Sublimacja",
"en": "Sublimation"
}
},
"color": {
"id": 11,
"name": {
"pl": "Domyślny",
"en": "Default"
},
"hex": "#FFFFFF"
},
"variant": {
"id": 11,
"productGroupId": 1,
"productModel3dId": 3,
"sizeId": 9,
"materialId": 3,
"printTypeId": 5,
"colorId": 11,
"metadata": null,
"minOrderQuantity": null,
"processingTime": null,
"stockQuantity": null,
"volume": null,
"weight": null
},
"unitPrice": {
"value": 0,
"currency": "EUR"
},
"totalPrice": {
"value": 0,
"currency": "EUR"
},
"quantity": 1,
"updatedAt": "2025-07-28 14:21:19.000000"
}
],
"designName": "Mug 450ml (15oz)",
"productGroup": {
"id": 1,
"name": {
"pl": "Kubek 450ml (15oz)",
"en": "Mug 450ml (15oz)"
}
},
"totalPrice": {
"value": 0,
"currency": "EUR"
}
}
]
}