Percent, amount, BOGO, threshold gifts, coupon codes, stacking rules — evaluated deterministically against any cart in one API call. Cents-exact, every time.
# 1. Sign up (14-day free trial, no card)
curl -X POST /api/auth/signup -H "Content-Type: application/json" \
-d '{"email":"you@store.com","password":"s3cure-pass","companyName":"My Store"}'
# 2. Create an API key (JWT from step 1)
curl -X POST /api/keys -H "Authorization: Bearer <jwt>"
# 3. Evaluate a cart
curl -X POST /v1/evaluate -H "Authorization: Bearer sk_pk_..." \
-H "Content-Type: application/json" \
-d '{"cart":{"currency":"CAD","codes":["SUMMER20"],
"lines":[{"id":"1","sku":"latte","qty":2,"unitPrice":450,"tags":["drinks"]}]}}'
| Endpoint | What it does |
|---|---|
POST /api/auth/signup · login | Dashboard auth → JWT (7d) |
POST/GET/DELETE /api/keys | Manage API keys (sk_pk_…, shown once) |
GET /api/usage | Current-month metering vs plan limits |
POST /api/billing/checkout · portal | Subscribe / manage plan (Stripe) |
POST/GET/PATCH/DELETE /v1/campaigns | Campaign CRUD + /pause, /activate, /stats |
POST /v1/coupons/generate | Mint up to 500 codes per call (custom patterns) |
GET /v1/coupons | List codes with uses, filter by campaign |
POST /v1/evaluate | Price a cart — dry run, consumes nothing |
POST /v1/redeem | Commit at checkout — idempotent, consumes uses atomically |
| Type | Behaviour |
|---|---|
percent_off | % off matched lines, largest-remainder cents distribution — line discounts always sum exactly |
amount_off | Fixed cents off matched subtotal, distributed proportionally |
free_item_on_threshold | Spend ≥ X ⇒ free item (discounted if in cart, reward line if not) |
bogo | Buy N of X, get M of Y free — cheapest matching units |
Every campaign supports targeting (all | skus | tags), schedule windows, code requirements, stacking flags, priority, and total/per-customer usage limits.
Every account starts with a 14-day free trial. No card required.
GET /api/health for status