Skip to main content
The browser SDK sees the page, not the cart’s contents or the order. Four public endpoints on sdk.nextintent.ai fill that in: the cart from the page, orders and refunds from the store’s server, checkout steps from a pixel, and erasure requests. None of them stores anything but the order ledger; each becomes a signal on the bus with source: "sdk".

Authentication

Public routes are rate-limited per site and IP.

The cart beacon

Send it on every page that has a cart, on load and after every change. Line items travel as handle, variant, quantity and price, never a typed name. A discount code never travels: hash it on the page (SHA-256 of the lower-cased, trimmed code, first 16 hex characters in the reference snippet) and send the hash with whether the platform accepted it. Numbers are clamped to 0 to 10,000,000. The body limit is 8 KB. The reference snippet also stamps the visitor id on the cart as a hidden attribute (_nextintent_uid on Shopify) so the order that follows can name the visitor.

Orders

The body is the order, reduced. What NextIntent needs: the order id and number, created_at, currency, total_price, subtotal_price, total_discounts, total_price_usd where the platform states one, financial_status, discount_codes, line_items as handle, product and variant ids, price and quantity, the note_attributes entry that carries the visitor id, and the customer id as a number. Send nothing else: no name, email, phone, addresses or note. NextIntent hashes the customer id on arrival with a per-site key. The order lands in the site’s ledger whether or not the visitor is known. When the cart carried the visitor id it also becomes an order signal, and the engine marks the visitor as bought, withdraws any waiting card, and credits the order to a moment if one qualifies. The order signal is published once per order: a redelivered webhook updates the ledger row and does not count twice.

Refunds

The ledger row gains a refund total; the store view shows gross and net; a refund signal tells the engine the outcome changed. Each refund id is counted once.

Checkout steps

Sent by a pixel that can see checkout (on Shopify, the app’s web pixel). The engine uses the steps to know the visitor is in checkout (no card there) and, on completed, to go quiet for that visitor. A completed step is never treated as a credited purchase on its own; the order feed is the only source of credit, because anyone who knows a site id and a visitor id can post a step.

Erasure

scope: "customer" clears the customer reference and visitor id from the matching ledger rows, removes the visitor records those rows named (and any visitor row that carried the email as a trait), and publishes an erase signal so the engine forgets the visitor’s fold and moments. scope: "shop" erases everything for the site. A failure answers with a 5xx so the caller retries; an erasure is never acknowledged before it has happened.