brandfinedocs
REST API

Shop

The Shop plugin's site endpoints, for the catalog, live cart prices and orders.

Every endpoint takes the site key in X-Api-Key (its shop scope) and works from a server or a browser. Prices are integers in minor units. The SDK wraps them: see Shop.

EndpointWhat it does
GET /external/shop/config{ enabled: false }, or currency, pricesIncludeVat, checkoutMode, fields, legalLinks, whatsappOrders
GET /external/shop/productsOn-sale products: ?category=&post=&slugs=&locale=&limit=&offset= → { enabled, currency, pricesIncludeVat, items, total }
GET /external/shop/products/:slugOne on-sale product (404 otherwise), with currency
GET /external/shop/categories[{ id, slug, name, parent, position, productCount }]
POST /external/shop/quote{ lines: [{ variantId, quantity }], locale? } → the cart priced from the catalog
POST /external/shop/ordersSends an order: { lines, customer, shipping?, billing?, note?, consents?, locale?, sourceUrl? } → 201 { number, token, next: 'done' | 'whatsapp', url? }
GET /external/shop/orders/:tokenThe buyer's own order: number, status, lines, total

The reads and the quote are metered per client IP, like the content reads. POST /external/shop/orders with X-Brandfine-Dry-Run: 1 checks the order exactly as a real one and creates nothing (200 { ok: true, dryRun: true }).

Errors

StatuscodeWhen
403shop.not_activeThe workspace's shop is off
400shop.invalidA field to fix: params.field names it
409shop.line_unavailableA cart line is gone, unavailable or over its limit: params.variantId, params.problem
429external.rate_limitedToo many orders from one visitor or to one shop

On this page