REST API and webhooks
Read your products, enquiries and analytics from your own systems, and have enquiries and orders sent to them as they come.
Keys
Make a key in Studio → Integrations → Developers → API keys → New key (owners and admins
see it)
(the
Pro
plan and up). It’s shown once, starts with hx_, and reads its workspace (it changes
nothing but enquiries’ status). Keys are for servers: never put one in a web page or an
app.
curl https://www.huesix.com/studio/api/v1/products \
-H "Authorization: Bearer hx_…"
Endpoints
| Request | Returns |
|---|---|
GET /studio/
|
The workspace’s products, with each live page’s and manifest’s address. |
GET /studio/
|
A product’s analytics over 1 to 365 days, with the period before. |
GET /studio/
|
Enquiries, newest first, with the design and price. |
PATCH /studio/
|
Marks one done, or new again: {"status": "done"}. |
GET /studio/
|
The catalogue as Studio’s Products → Export gives it: csv,
json or shopify (a Shopify product import file).
|
Products
{
"products": [{
"id": "f3591909f5184f67",
"slug": "solitaire-ring", // its address, and its manifest's id
"name": "Aurelia Solitaire",
"kind": "product", // or "collection", "system"
"status": "live", // draft, live, or changes (live, with changes not yet published)
"paused": false, // over the plan's products: its embeds show nothing for now
"publishedVersion": 3,
"poster": "https://…/poster.webp",
"updatedAt": "2026-11-08T14:57:12.319Z",
"links": { // null until it's published
"page": "https://www.huesix.com/<workspace>/solitaire-ring",
"manifest": "https://www.huesix.com/studio/api/public/<workspace>/solitaire-ring/manifest.hxp"
}
}]
}
Enquiries
?status=new or done, ?product= (a product’s
id), ?limit= (1 to 200, 50 by default), and
?before= for the next page: pass the response’s next as it is.
next is null on the last page (a page that’s exactly full may be followed
by an empty one).
{
"enquiries": [{
"id": "8c1d0f4e2b7a4d90",
"productId": "f3591909f5184f67",
"productName": "Aurelia Solitaire",
"version": 3,
"name": "Sam Lee",
"email": "sam@example.com",
"phone": null,
"message": "Can it be ready by June?",
"consent": true,
"shareCode": "band*classic.metal*rose-gold.setting*halo.stone*ruby",
"shareUrl": "https://www.huesix.com/<workspace>/solitaire-ring?o=Xw3k9Qp2LmZa",
"design": {
"summary": [{ "group": "Stone", "options": ["Ruby"] }],
"price": { "amount": 4620, "formatted": "AED 4,620.00", "currency": "AED" },
"leadTimeDays": 10,
"repaired": false // true: the design broke a rule and was repaired
},
"page": "https://shop.example/rings/solitaire",
"form": "Request a quote",
"language": "en",
"status": "new",
"delivery": "sent", // how sending it on went (webhook, connections)
"held": false, // true: came in past the day’s limit, so not emailed or sent on
"createdAt": "2026-11-09T10:21:04.512Z"
}],
"next": "2026-11-09T10:21:04.512Z~8c1d0f4e2b7a4d90"
}
design.price.amount is the price as the shopper saw it (with tax where the
product shows prices with it). To price it again with the
quote API, find the enquiry’s
productId in /products, take its
links.manifest with manifest.hxp replaced by
quote, and add ?code= the shareCode (and
&v= its version, for the price the shopper saw).
// Every new enquiry into your CRM, then marked done (Node.js 18 or later).
let before = '';
do {
const page = await huesix(`/enquiries?status=new&limit=50${before && `&before=${encodeURIComponent(before)}`}`);
for (const enquiry of page.enquiries) {
await crm.addLead(enquiry);
await huesix(`/enquiries/${enquiry.id}`, { method: 'PATCH', body: JSON.stringify({ status: 'done' }) });
}
before = page.next;
} while (before);
async function huesix(path, init = {}) {
const response = await fetch(`https://www.huesix.com/studio/api/v1${path}`, {
...init,
headers: { authorization: `Bearer ${process.env.HUESIX_KEY}`, 'content-type': 'application/json' },
});
// Over 120 requests this minute: wait for the next one, then go on.
if (response.status === 429) {
await new Promise((done) => setTimeout(done, 61_000 - (Date.now() % 60_000)));
return huesix(path, init);
}
if (!response.ok) throw new Error(`huesix ${response.status}: ${(await response.json()).error}`);
return response.json();
}
Analytics
The same report as the product’s Analytics page in Studio (anonymous, see
Analytics and consent), refreshed every
minute: totals and previous (views, visitors, engagement,
conversions), daily, the funnel, option popularity
(groups), conversions, xr, devices,
countries, sources, pages,
languages, campaigns, sharing,
designs, load times (loadByDevice) and errors.
Errors and limits
Errors are {"error": "…"} with the HTTP status:
- 400: a parameter it can’t read (a status, a page cursor, a format).
- 401: no key, or a deleted one.
- 402: the plan doesn’t include the API. 403: the workspace is suspended.
- 404: no such product or enquiry in the workspace.
- 429: over 120 requests a minute for a key. The count starts again each minute: wait for the next, and try again.
- 500: our side;
refidentifies it if you contact us.
Webhooks
In Studio → Integrations → Enquiries and CRM → Send them on, give an
address and save: huesix posts each enquiry (and each huesix checkout order) to it as
JSON, as it comes. The signing secret shows once it’s saved. The address must be
https:// on a public host name (not localhost or an IP address): to try it
on your own computer, use a tunnel. There’s no test send: send an enquiry from one of
your products.
POST https://your-server.example/hooks/huesix
content-type: application/json
user-agent: huesix-enquiries/1
x-huesix-event: enquiry (or order)
x-huesix-signature: sha256=<hex HMAC-SHA256 of the body, keyed with your secret>
{ "type": "enquiry", "enquiry": { …as in the API above } }
Check the signature against the raw body before you trust it. The key is the whole
secret Integrations shows, whsec_ included.
import { createHmac, timingSafeEqual } from 'node:crypto';
export function fromHuesix(rawBody, signature, secret) {
const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex');
return typeof signature === 'string' &&
signature.length === expected.length &&
timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}
// Express: the raw body, not the parsed one.
app.post('/hooks/huesix', express.raw({ type: 'application/json' }), (req, res) => {
if (!fromHuesix(req.body, req.get('x-huesix-signature'), process.env.HUESIX_WEBHOOK_SECRET))
return res.sendStatus(401);
const event = JSON.parse(req.body);
if (event.type === 'enquiry') crm.addLead(event.enquiry);
if (event.type === 'order') orders.add(event.order);
res.sendStatus(204);
});
$body = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $body, getenv('HUESIX_WEBHOOK_SECRET'));
if (!hash_equals($expected, $_SERVER['HTTP_X_HUESIX_SIGNATURE'] ?? '')) {
http_response_code(401);
exit;
}
$event = json_decode($body, true);
import hashlib, hmac
def from_huesix(raw_body: bytes, signature: str, secret: str) -> bool:
expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(signature or "", expected)
# Flask
@app.post("/hooks/huesix")
def hook():
if not from_huesix(request.get_data(), request.headers.get("x-huesix-signature"), SECRET):
abort(401)
event = request.get_json()
...
return "", 204
Check a signature
Paste a delivery’s body, its signature header and your secret to see whether they match, or fill in an example to see how it works.
-
Answer with any 2xx within 8 seconds. Anything else (a redirect included) is recorded
as failed on the enquiry or order in Studio, and there’s no second try. Catch up on
enquiries with
GET /enquiries; orders can’t be read with a key, so catch up on them in Studio → Orders. - There’s no timestamp: if you might be sent one twice (your own retries), skip ids you’ve seen.
- A new secret replaces the old one at once.
- Only while your plan has webhooks: a workspace whose plan no longer does keeps its settings, but nothing is sent.
Orders
Each huesix checkout order is posted once, as x-huesix-event: order, when
Stripe completes the checkout. With a payment method that takes time (a bank transfer),
payment can be unpaid, and its change to paid or failed isn’t
posted: Studio → Orders has it.
{
"type": "order",
"order": {
"id": "c2f8…",
"productId": "f3591909f5184f67",
"productName": "Aurelia Solitaire",
"version": 3,
"shareCode": "band*classic.metal*rose-gold.setting*halo.stone*ruby",
"shareUrl": "https://www.huesix.com/<workspace>/solitaire-ring?o=Xw3k9Qp2LmZa",
"design": { "summary": […], "bom": […], "leadTimeDays": 10, "price": {…} },
"amount": 462000, // what Stripe charged, in the currency's minor unit
"currency": "aed", // lower case, as Stripe has it
"formatted": "AED 4,620.00",
"customer": { "name": "Sam Lee", "email": "sam@example.com", "phone": null },
"shipping": { "name": "Sam Lee", "address": { "line1": "…", "city": "Dubai", "country": "AE" } },
"payment": "paid", // or unpaid, failed
"status": "new",
"live": true, // false: Stripe's test mode
"stripeSessionId": "cs_live_…",
"createdAt": "2026-11-09T10:21:04.512Z"
}
}
Connections
Connections (Integrations → Enquiries and CRM → Your own systems) send enquiries to a CRM or any API in its own shape: JSON or a form, with the headers it needs (kept encrypted), and a template of the enquiry’s fields. Each can be tried with a test send. Unlike the webhook, they aren’t signed: use the headers (an API key) to prove they’re from you. Each enquiry form can choose which connections it uses; one set to every form gets huesix checkout orders too.