Customizer - API Integration

API Integration – Authentication

To integrate with the Customizer API and fetch product data, you must first generate access keys.

Generating API Keys

  1. Log in to the panel: E-commerce Settings
  2. Go to the API Integration section.
  3. Click Generate API Keys. ⚠️ Keys can only be displayed once after generation. If you lose them later, you will need to generate new ones.

Authentication Headers

All requests must include headers with authentication data (server-side only!).

x-alter-access-key: API_KEY
x-alter-access-token: API_TOKEN

Connection Test

To verify that your API connection is working correctly, send a GET request to the following address:

GET https://alterproduct.com/public-api/v1/auth/check

Expected response:

{
  "message": "success"
}

Example request (Node.js / fetch)

const response = await fetch('https://alterproduct.com/public-api/v1/auth/check', {
  method: 'GET',
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  }
});

const result = await response.json();
console.log(result);

Example request (axios)

import axios from 'axios';

const result = await axios.get('https://alterproduct.com/public-api/v1/auth/check', {
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  }
});

console.log(result.data);

API Endpoints – Customer Orders

List of available endpoints for the customer-orders resource, used to fetch and update customer orders (e.g. after a user adds a project to cart in the customizer). You can view the orders on the orders page
MethodEndpointDescription
GET/public-api/v1/customer-orders/:idFetches details of a single order
POST/public-api/v1/customer-orders/batchFetches a list of orders based on an array of IDs
PATCH/public-api/v1/customer-orders/:id/statusUpdates the status of an order
PATCH/public-api/v1/customer-orders/:orderId/quantityUpdates quantity of a specific product item in the order
PATCH/public-api/v1/customer-orders/:orderId/quantity/allSets the same quantity for all product items in the order
DELETE/public-api/v1/customer-orders/:idDeletes the order

Fetching a single customer order

GET https://alterproduct.com/public-api/v1/customer-orders/:id

This endpoint returns the full details of a single customer order – including status, assigned design, 3D model, edit link, selected variant and total price.

Example request (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);

Example response

{
    "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"
        }
    }
}

Fetching multiple orders

POST https://alterproduct.com/public-api/v1/customer-orders/batch

This endpoint allows you to retrieve a list of orders based on their IDs. It's particularly useful when a user has added multiple projects to the cart.

Example request

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);

Example response

{
    "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"
            }
        }
    ]
}

Update Order Status

PATCH https://alterproduct.com/public-api/v1/customer-orders/:id/status

Allows you to change the status of a specific customer order. Status updates are recommended after payment and can be done manually from the order panel or via the API.

Context

When the customer clicks 'Add to cart' in the Customizer, a new order record is created with the default status: pending, which allows the customer to continue editing the design via this link: https://alterproduct.com/app/customizer/{customizerId}/{orderId}. Once the status is changed to anything other than pending, the editing is locked – the customer sees a frozen version of the design.

Available status values (enum)

StatusDescription
pendingFetches details of a single order
paidFetches a list of orders based on an array of IDs
processingUpdates the status of an order
completedUpdates quantity of a specific product item in the order
cancelledOrder cancelled

The 'pending' status is the only one that allows the customer to open the Customizer and edit the project.

Example request (fetch)

const res = await fetch('https://alterproduct.com/public-api/v1/customer-orders/1/status', {
  method: 'PATCH',
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    status: 'processing'
  })
});

const data = await res.json();
console.log(data);

Example response

{
  "success": true,
  "orderId": 1,
  "newStatus": "processing"
}

Update quantity of a specific order item

PATCH https://alterproduct.com/public-api/v1/customer-orders/:orderId/quantity

This endpoint allows updating the quantity of a specific product variant (productItem) within a single order.

Example request

JSON body:

{
  "updates": [
    { "id": 1, "quantity": 3 }
  ]
}

fetch (Node.js):

const response = await fetch('https://alterproduct.com/public-api/v1/customer-orders/1/quantity', {
  method: 'PATCH',
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    updates: [
      { id: 1, quantity: 3 } // ID pozycji z zamówienia (productItem)
    ]
  })
});

const result = await response.json();
console.log(result);

Example response

{
  "success": true
}

Set the same quantity for all items (productItems) in the order

PATCH https://alterproduct.com/public-api/v1/customer-orders/:orderId/quantity/all

This endpoint allows you to easily set the same quantity for all items (productItems) in order.

Example request

JSON body:

{
  "quantity": 2
}

fetch (Node.js):

const response = await fetch('https://alterproduct.com/public-api/v1/customer-orders/1/quantity/all', {
  method: 'PATCH',
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    quantity: 2
  })
});

const result = await response.json();
console.log(result);

Example response

{
  "success": true
}

Delete customer order

DELETE https://alterproduct.com/public-api/v1/customer-orders/:id

This endpoint is used to permanently delete a customer's order – for example, if the project was abandoned or canceled before production. Once deleted, the order can no longer be opened or edited.

Example request (fetch, Node.js)

const response = await fetch('https://alterproduct.com/public-api/v1/customer-orders/1', {
  method: 'DELETE',
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const result = await response.json();
console.log(result);

Example response

{
  "success": true
}