Skip to main content
← CutOptim ConfiguratorCustom platform

Cut-to-size order integration for your own shop or ERP

The CutOptim Configurator connects to a custom shop or ERP through two checks on your server: the signed quote and the signed webhook. Both are plain HMAC-SHA256, so any language can verify them, and reference examples in Node and PHP show how.

Quick answer

To take configurator orders in a platform of your own, your server does two things. It verifies the signed quote before a line enters the cart, and it verifies the signed webhook before it stores an order. CutOptim collects no payment and hosts no shop: the cart, the payment and the order record stay with you.

Two checks, both on your server

A custom platform has no plug-in to lean on, so the trust sits in two signatures. The browser can show a price, but only your server can decide to believe it.

MomentWhat arrivesWhat your server checks
The customer orders on the pageThe cutoptim:order event with the order and its signed quoteThe quote token, with your secret key at /cfg/v1/quote/verify
The order is placedA signed webhook at the address you registeredThe signature, the five-minute window and the event id
A retry or a redeliveryThe same event againNothing new: the event id is already stored

Check the quote before the cart

The quote token is the price promise. Your server asks CutOptim whether it is genuine, unexpired and not yet used, then compares what it claims with the cart line.

  1. Receive the order

    The page hands your script the cutoptim:order event with the order and its quote token.

  2. Ask CutOptim

    Your server posts the token to /cfg/v1/quote/verify with your secret key. The answer says whether it is valid, whether an order has already used it, and which claims it carries.

  3. Compare the claims

    The tenant, the currency, the expiry and the hash of the priced lines must match the line you are about to add. Anything else is refused.

  4. Add or refuse

    Only a token that passes reaches the cart. A price changed in the browser fails here.

The signing key is never handed to shops. Checking the shape and the expiry of a token locally saves a round trip, but only /cfg/v1/quote/verify can confirm the signature.

Receive the order by webhook

When an order is placed, CutOptim posts it to the address you registered, signed so that you can tell it came from us.

  • — The CutOptim-Signature header carries a timestamp t and a signature v1: an HMAC-SHA256 of the timestamp, a dot and the raw body.
  • — Verify the raw bytes exactly as received; a body that was parsed and written out again no longer matches.
  • — Refuse a timestamp more than five minutes old or new, and compare signatures in constant time.
  • — Store the event id and answer success for an id you have seen: a retry repeats it.

Reference code in Node and PHP

Two small examples do exactly this, with no framework and no dependency: a Node module and a single PHP file. Copy the one that fits, replace the in-memory store with a table that has a unique key on the event id, and keep your secrets in the environment.

Reference code: verifying a webhook (Node)
import { createWebhookReceiver } from './cutoptim-verify.mjs';

const receive = createWebhookReceiver({
  secrets: [process.env.WEBHOOK_SECRET],          // whsec_... from the admin route, never in the repository
  async onEvent(event) { /* store event.data.order, keyed by event.id */ },
});

// in your HTTP handler - the RAW body, not parsed JSON:
const { status } = await receive({ rawBody, headers: req.headers });
res.writeHead(status).end();

What stays with you

The configurator prices and plans the cut; your platform keeps everything that comes after it.

  • — The cart, the checkout and the payment: CutOptim collects no payment.
  • — The order record and its fulfilment, in your database or ERP.
  • — Your customers and your shop pages: there is no hosted shop.

Start a free sandbox in the console to get your keys and your webhook secret. The reference examples can be downloaded on this page.

Where it fits

Any system that can receive an HTTPS request and compute an HMAC can take these orders: a shop written in-house, a headless storefront, a quoting tool or an ERP. If you only need the cutting engine and not the ordering screen, the Engine API serves that.

Frequently asked questions

Do I need a plug-in to connect my own platform?
No. A custom platform needs two checks on its server, the signed quote and the signed webhook, and the Node and PHP examples show both. There is no CutOptim code to install in your shop.
How do I know a price was not changed in the browser?
Your server posts the quote token to /cfg/v1/quote/verify with your secret key and compares its claims with the cart line. An altered or expired token is reported as not valid. A token an order has already used is still valid but comes back with redeemed: true, so check both fields and keep your own record of used tokens.
What happens if my endpoint is down when an order arrives?
CutOptim retries the delivery on a growing schedule, up to six attempts over several hours. Every retry carries the same event id, so a receiver that stores ids processes the order once.
Does CutOptim collect the payment or host my shop?
No. The configurator prices and plans the cut and hands the signed order to your platform. The cart, the payment and the fulfilment stay in your own system.
Which programming languages do the examples cover?
Node and PHP. The signature is plain HMAC-SHA256 over the raw body, so the same few lines work in Python, Java, C# or any other language with a crypto library.

Related calculators, guides and trades

More about the configurator

Only need the cutting engine? See the Engine API

LegalConfigurator terms ·Data processing agreement ·Shopper privacy notice ·Third-party licences