const response =awaitfetch('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)
importaxiosfrom'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);
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.
Method
Endpoint
Description
Scopes
GET
/public-api/v1/auth/check
Checks whether provided API credentials are valid for the current storefront (auth/health check).
(any authenticated)
GET
/public-api/v1/customer-orders
Fetches a paginated order list for the authenticated storefront.
orders:read
GET
/public-api/v1/customer-orders/:id
Fetches details of a single order.
orders:read
POST
/public-api/v1/customer-orders/batch
Fetches a list of orders based on an array of IDs.
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 =newURLSearchParams({// Filters (optional)name:'T-shirt',// stringcategory_id:12,// numberorder_status:'pending',// string// Pagination (optional)offset:0,// number >= 0limit:20,// number 1-50// Sorting (optional)order_by:'created_at',// id | created_at | design_namedirection:'DESC'// ASC | DESC});const url =`https://alterproduct.com/public-api/v1/customer-orders?${params.toString()}`;const res =awaitfetch(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);
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 =awaitfetch('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);
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 =awaitfetch('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);
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)
Status
Description
shopping_cart
Order is in cart flow and can still be edited by the customer
editable
Order remains editable by the customer
processing
Order pass checkout
paid
Order is paid and waiting for fulfillment
completed
Order has been fulfilled
cancelled
Order 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 =awaitfetch('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"}
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 =awaitfetch('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);
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 =awaitfetch('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);
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 =awaitfetch('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 | customizerorigin:'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);
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.