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 - API Credentials
  2. Click Add credencial ⚠️ 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!).

Operational notes

  • Base path: https://alterproduct.com/public-api/v1
  • Health endpoint: GET /healthz
  • Server-to-server calls 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:

{
  "ok": true,
  "message": "success",
  "storefrontId": 12,
  "userOwnerId": 34,
  "credentialId": 56,
  "scopes": ["orders:read", "orders:write"]
}

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

List of available endpoints for the /public-api. These endpoints allow you to authenticate requests, manage customer orders, access storefront products, generate embed sessions and access tokens, and retrieve public or protected files for the authenticated storefront.
MethodEndpointDescriptionScopes
GET/public-api/v1/auth/checkChecks whether provided API credentials are valid for the current storefront (auth/health check).(any authenticated)
GET/public-api/v1/customer-ordersFetches a paginated order list for the authenticated storefront.orders:read
GET/public-api/v1/customer-orders/:idFetches details of a single order.orders:read
POST/public-api/v1/customer-orders/batchFetches a list of orders based on an array of IDs.orders:read
PATCH/public-api/v1/customer-orders/:id/statusUpdates the status of an order.orders:write
PATCH/public-api/v1/customer-orders/:orderId/quantityUpdates quantity for specific order line items.orders:write
PATCH/public-api/v1/customer-orders/:orderId/quantity/allSets the same quantity for all product items in the order.orders:write
DELETE/public-api/v1/customer-orders/:idDeletes the order.orders:write
POST/public-api/v1/embed/sessionCreates an embed session used to initialize embedded Viewer/Configurator/Customizer.embed:session:create
GET/public-api/v1/files/public/products/:productId/:sizeReturns a public product preview file (CORS-enabled).(public)
GET/public-api/v1/productsFetches a product list for the authenticated storefront.products:read
GET/public-api/v1/products/:idFetches details of a single product for the authenticated storefront.products:read

Fetching customer orders list

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

This endpoint returns a paginated list of customer orders for the authenticated storefront. It is typically used to synchronize external systems (e.g. store backends or dashboards) with orders created via the customizer.

Example request

const params = new URLSearchParams({
  // Filters (optional)
  name: 'T-shirt',              // string
  category_id: 12,         // number
  order_status: 'pending',   // string

  // Pagination (optional)
  offset: 0,               // number >= 0
  limit: 20,               // number 1-50

  // Sorting (optional)
  order_by: 'created_at',    // id | created_at | design_name
  direction: 'DESC'          // ASC | DESC
});

const url = `https://alterproduct.com/public-api/v1/customer-orders?${params.toString()}`;

const res = await fetch(url, {
  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);

fetch (Node.js):

{
    "order": {
        "items": [
            {
                "id": 33,
                "customizerId": 381,
                "isSeenByOwner": false,
                "orderStatus": "shopping_cart",
                "createdAt": "2026-02-09T01:55:48.000Z",
                "customizerOrderURL": "http://localhost:3000/app/customizer/381/33",
                "productItems": [
                    {
                        "id": 29,
                        "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,
                            "minOrderQuantity": 0,
                            "processingTime": 0,
                            "stockQuantity": 0,
                            "volume": null,
                            "weight": null
                        },
                        "unitPrice": {
                            "value": 5,
                            "currency": "EUR"
                        },
                        "totalPrice": {
                            "value": 5,
                            "currency": "EUR"
                        },
                        "quantity": 1,
                        "updatedAt": "2026-02-09 01:55:49.000000"
                    }
                ],
                "customizerName": "Men’s T-Shirt",
                "productGroup": null,
                "totalPrice": {
                    "value": 5,
                    "currency": "EUR"
                }
            }
        ],
        "total": 1
    }
}

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

{
    "order": {
        "id": 1,
        "customizerId": 10,
        "orderStatus": "editable",
        "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

{
    "orders": [
        {
            "id": 1,
            "customizerId": 10,
            "orderStatus": "editable",
            "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": "editable",
            "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": "editable",
            "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. Can be updated manually in the Customizer order panel or via the API.

Context

When the customer clicks 'Add to cart' in the Customizer, an order is created in an editable flow with status shopping_cart and can still be edited via: https://alterproduct.com/app/customizer/{customizerId}/{orderId}. After moving to fulfillment statuses such as paid, processing, completed or cancelled, editing by customer is locked.

Available status values (enum)

StatusDescription
shopping_cartOrder is in cart flow and can still be edited by the customer
editableOrder remains editable by the customer
processingOrder pass checkout
paidOrder is paid and waiting for fulfillment
completedOrder has been fulfilled
cancelledOrder was canceled

Editable curstomer flows are handled with statuses such as 'shopping_cart' and 'editable'. Final statuses (like 'paid', 'processing', 'completed', 'cancelled') lock further edits.

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,
  "message": "Order status updated.",
  "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:

{
  "items": [
    { "orderDetailId": 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({
    items: [
      { orderDetailId: 1, quantity: 3 } // ID pozycji z zamówienia (productItem)
    ]
  })
});

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

Example response

{
  "success": true,
  "message": "Order quantities updated.",
  "orderId": 1
}

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,
    "orderId": 1,
    "quantity": 2
}

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,
  "message": "Order deleted.",
  "orderId": 1
}

Embed Session

POST https://alterproduct.com/public-api/v1/embed/session

This endpoint creates a short-lived embed session token (JWT) that allows your application to securely open Alter Product tools (viewer, configurator, customizer) for a specific resource (design or order) and a validated origin. The token is scoped minimally and expires automatically (TTL: 3600s).

Example request (fetch, Node.js)

const response = await fetch('https://alterproduct.com/public-api/v1/embed/session', {
  method: 'POST',
  headers: {
    'x-alter-access-key': 'YOUR_API_KEY',
    'x-alter-access-token': 'YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    tool: 'customizer', // Tool to open: viewer | configurator | customizer
    origin: 'https://yourstore.com', // Domain where embed will be rendered (must be allowed in settings)
    designId: 123 // Resource identifier (provide designId OR orderId)
  })
});

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

Example response

{
  "token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjEifQ...",
  "expiresIn": 3600,
  "kid": "1",
  "mode": "design"
}

Public product preview file

GET https://alterproduct.com/public-api/v1/files/public/products/:productId/:size

This endpoint returns a public preview image for a product. It does not require authentication and is CORS-enabled, so it can be used directly in browsers or frontend apps.

Example request (browser / fetch)

const url = "https://alterproduct.com/public-api/v1/files/public/products/42/medium";

const response = await fetch(url);
const blob = await response.blob();

const imageUrl = URL.createObjectURL(blob);
console.log(imageUrl);

Example response

Binary image file (image/png or image/webp)

Storefront Products

GET https://alterproduct.com/public-api/v1/products

This endpoint returns a list of products available for the authenticated storefront (that have viewer, cofigurator or customizer).

Example request (fetch, Node.js)

const params = new URLSearchParams({
  offset: '0',          // default: 0
  limit: '9',           // default: 9, max: 50
  name: 't-shirt',      // optional search
  customizer: 'true',   // optional: true/false
  order_by: 'name',     // optional (whitelisted server-side)
  direction: 'ASC'      // ASC | DESC
});

const response = await fetch(`https://alterproduct.com/public-api/v1/products?${params.toString()}`, {
  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 response

{
  "products": {
    "items": [
      {
        "id": 381,
        "name": "Men’s T-Shirt",
        "createdAt": "2026-01-03T23:55:05.000Z",
        "productId": 4,
        "media": {
          "img": {
            "big": "http://localhost:5010/v1/file/public/products/4/big.png",
            "medium": "http://localhost:5010/v1/file/public/products/4/medium.png",
            "small": "http://localhost:5010/v1/file/public/products/4/small.png"
          }
        },
        "storefrontProduct": {
          "id": 89,
          "shareAccess": "public",
          "idUserDesign": 381,
          "isCustomizer": 1
        },
        "embeddable": {
          "viewer": true,
          "configurator": true,
          "customizer": true
        }
      }
    ],
    "total": 1
  }
}

Fetching a single product

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

This endpoint returns full details of a single product for the authenticated storefront.

Example request (fetch, Node.js)

const productId = 381;

const response = await fetch(`https://alterproduct.com/public-api/v1/products/${productId}`, {
  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 response

{
  "id": 381,
  "name": "Men’s T-Shirt",
  "createdAt": "2026-01-03T23:55:05.000Z",
  "productId": 4,
  "media": {
    "img": {
      "big": "http://localhost:5010/v1/file/public/products/4/big.png",
      "medium": "http://localhost:5010/v1/file/public/products/4/medium.png",
      "small": "http://localhost:5010/v1/file/public/products/4/small.png"
    }
  },
  "storefrontProduct": {
    "id": 89,
    "shareAccess": "public",
    "idUserDesign": 381,
    "isCustomizer": 1
  },
  "embeddable": {
    "viewer": true,
    "configurator": true,
    "customizer": true
  }
}