Luzingu API
Luzingu is an AI ecommerce platform where entrepreneurs build stores, source products and sell worldwide. The API lets supplier, dropshipping, fulfilment, shipping, accounting and marketing tools connect to a merchant's Luzingu store, with the merchant's approval.
Base URL: https://luzingu.app/api/v1 · Version 2026-11 · JSON over HTTPS
Getting started
- Create a free Luzingu account, then a test store under Developer apps (free, no plan needed; see Sandbox).
- In Dashboard > Settings > Developer apps, create an app: name, redirect links, the permissions you need and an optional webhook link. Copy the client secret and webhook secret (shown once).
- Send the merchant to the connect link, exchange the code for tokens, and call the API.
Sandbox and testing
In Developer apps you can create up to 3 test stores. They work like real stores for your app (OAuth, products, orders, fulfilments, webhooks) but take no real payments, never email anyone and can't be bought from. Connect your app to a test store with your normal connect link, then create paid orders whenever you need them:
POST /api/v1/test/orders (read_orders; test stores only, otherwise 403 not_test_store)
{ "items": [ { "product_id": "…", "variant_id": "…", "quantity": 2 } ], // optional: defaults to the newest product
"customer": { "name", "email", "phone" }, "shipping_address": { … } } // optional sample data
201 { "order": { …status "paid", payment_provider "test"… }, "test": true } // orders/paid is sent to your webhookThe order takes stock like a real sale (so you also get inventory/updated), and you can ship it with POST /orders/{id}/fulfillments. The dashboard also has a Simulate a paid order button, and a test inbox: point your app's webhook at it to see every webhook Luzingu sends, with its signature checked.
Integration self-test. The Run the integration test button makes Luzingu act as an outside dropshipping app against the API of the environment it runs on: (1) register an app, (2) OAuth with PKCE into a test store, (3) import a product with variants and a photo, (4) change its price and stock, (5) place a test order, (6) receive the signed orders/paid webhook, (7) add tracking, (8) connect a second store to the same app and check the two stores can't see each other's products, orders or webhooks, (9) failures and retries: expired token, Idempotency-Key retries, out of stock, a partly fulfilled order, a cancelled order, the app's webhook server down and back, duplicate deliveries, (10) disconnect and check that the tokens no longer work while the other store keeps working. Each step lists the checks it made.
Shareable report. Each run is saved in your dashboard. Share report creates a read-only link that shows the steps and checks (not your keys), so partners can see what was tested and on which environment.
Sample app
luzingu-sample-app.mjs is a complete, dependency-free Node.js integration (one file) you can run against a test store and copy from: OAuth with PKCE and state, tokens kept per store with safe refresh, product import and stock sync, webhook signature checks and duplicate skipping, automatic fulfilment of paid orders with an Idempotency-Key, retries, and clean-up on app/uninstalled.
CLIENT_ID=lz_app_… CLIENT_SECRET=lz_cs_… WEBHOOK_SECRET=lz_whsec_… \
LUZINGU_URL=https://luzingu.app PUBLIC_URL=https://your-tunnel.example \
node luzingu-sample-app.mjs
# register PUBLIC_URL/callback as the redirect link and PUBLIC_URL/webhooks as the webhook link,
# open PUBLIC_URL/connect, approve a test store, then /import?store=<id> and place a test orderAuthorization (OAuth 2.0)
Authorization code flow, one store per approval. PKCE (S256) is supported and recommended for public clients.
1. Send the merchant to Luzingu
GET https://luzingu.app/oauth/authorize
?response_type=code
&client_id=lz_app_…
&redirect_uri=https://yourapp.com/luzingu/callback (must match a registered link exactly)
&scope=read_store read_products write_products read_orders write_fulfillments
&state=<random, check it on return>
&code_challenge=<base64url(sha256(verifier))>&code_challenge_method=S256 (optional)The merchant logs in, picks one of their stores and approves. Luzingu redirects to redirect_uri?code=lz_code_…&state=…, or ?error=access_denied&state=….
2. Exchange the code (within 10 minutes, once)
curl -X POST https://luzingu.app/api/oauth/token \
-d grant_type=authorization_code -d code=lz_code_… \
-d redirect_uri=https://yourapp.com/luzingu/callback \
-d client_id=lz_app_… -d client_secret=lz_cs_… [-d code_verifier=…]
{ "access_token": "lz_at_…", "token_type": "Bearer", "expires_in": 86400,
"refresh_token": "lz_rt_…", "scope": "read_store read_products …",
"store": { "id": "…", "name": "Lumi Naturals", "currency": "USD", "country": "US", "url": "https://lumi.luzingu.app" } }3. Refresh
Access tokens last 24 hours. Refresh tokens rotate: every refresh returns a new refresh token and the old one stops working. Always store the newest pair. See Token security for expiry and reuse rules.
curl -X POST https://luzingu.app/api/oauth/token -d grant_type=refresh_token -d refresh_token=lz_rt_… -d client_id=… -d client_secret=…Client credentials can also be sent with HTTP Basic. To disconnect yourself: POST /api/oauth/revoke with token and your client credentials. Merchants can disconnect any app in Settings > Connected apps; you then receive app/uninstalled.
Token security
| Access token | Expires after 24 hours. Replaced (and the old one stops working) on every refresh. |
| Refresh token | Single use: each refresh returns a new one. Stored by Luzingu only as a SHA-256 hash. |
| Idle expiry | If a connection isn't used (no API call and no refresh) for 90 days, it ends. |
| Maximum lifetime | A merchant's approval lasts at most 365 days. Then refresh fails with invalid_grant and you send the merchant through the approval link again (one click for them; the store and data stay as they are). |
| Reuse detection | A refresh token that was already used is accepted again only within 30 seconds (a retry after a lost response). Later, Luzingu treats it as copied: the connection ends at once, your app gets app/uninstalled with reason: "token_reuse", and the merchant is emailed. An approval code used twice ends the connection it created (code_reuse). |
| Leaked client secret | Dashboard > Developer apps > Make a new secret. The old one stops working at once; refresh tokens can't be used without the current secret. |
| Leaked tokens | Dashboard > Developer apps > Revoke all tokens ends every store connection of the app (reason: "developer"). Merchants approve again to reconnect. |
| Disconnects | The merchant (Settings > Connected apps), your app (POST /api/oauth/revoke) or Luzingu (disabling an app that misuses data) can end a connection. Any call with its tokens then returns 401 invalid_token, or 403 app_disabled for a disabled app. |
app/uninstalled carries a reason: merchant, idle, expired, token_reuse, code_reuse, developer or app_deleted.
Permissions
| Scope | Allows |
|---|---|
read_store | See the store's name, currency, country and link |
read_products | See products, variants, prices and stock |
write_products | Create, update and remove products the app manages |
read_orders | See orders, including the customer's name, email, phone and shipping address |
write_fulfillments | Add tracking to orders and mark them shipped or delivered |
Ask only for what you need: merchants see each permission before approving. An app can change only the products it created.
Requests, limits and errors
curl https://luzingu.app/api/v1/products -H "Authorization: Bearer lz_at_…"- Rate limit: 120 requests per minute per store connection. Headers
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset; over the limit you get429withRetry-After. - Pagination:
limit(1-250, default 50) andcursor; responses includenext_cursor(null on the last page). - Errors:
{ "error": { "code": "missing_scope", "message": "…" } }with 400, 401 (invalid_token,token_expired), 402 (plan_inactive), 403, 404, 409, 422, 429 or 5xx. - Money is in the store's currency as decimal numbers (e.g.
24.9); dates are ISO 8601 UTC.
Retries and idempotency
Send an Idempotency-Key header (any unique string up to 200 characters, e.g. a UUID or ship-<order id>) on POST, PATCH and DELETE. If you retry after a timeout or a lost response with the same key, Luzingu returns the first response (with Idempotent-Replayed: true) instead of doing the work again. Keys last 24 hours. The same key with a different request gets 422 idempotency_key_reused; while the first request is still running you get 409 request_in_progress. Errors are not stored, so a retry after a 4xx or 5xx runs again.
- Retry
429afterRetry-After, and5xxor network errors with backoff, using the same key. - Products also have a natural key:
external_idis unique per app and store (409 already_existsreturns the existing id). - Sending the same tracking number again adds no shipment, no webhook and no customer email.
- Webhooks can arrive more than once (retries, resends): skip ones whose
X-Luzingu-Deliveryyou already handled. - On
401 token_expired, refresh once and retry. Refresh one store at a time: refresh tokens are single-use.
Many stores
Each merchant approves your app for one store, and each approval has its own tokens. Store tokens per store id (from the token response's store.id) and pick them by the X-Luzingu-Store header of each webhook. A token only ever sees its own store: products, orders and fulfilments of other stores return 404, even if you know their ids. external_id values are per store, so the same supplier SKU can be used in every store. Disconnecting one store (app/uninstalled) never affects the others.
Store
GET /api/v1/store (read_store)
{ "store": { "id", "name", "status": "published" | "draft", "currency", "country", "language", "url", "created_at" }, "scopes": [ … ] }Products
GET /api/v1/products?limit=&cursor=&updated_since=&status=active|draft&managed=true&external_id= (read_products)
GET /api/v1/products/{id} (read_products)
POST /api/v1/products (write_products)
PATCH /api/v1/products/{id} (write_products, only products your app created; send only the fields to change)
DELETE /api/v1/products/{id} (write_products, only products your app created)POST /api/v1/products
{
"external_id": "SKU-1042", // your id; unique per app and store (409 already_exists if reused)
"name": "3-in-1 Dog Walking Bottle",
"description": "Water bottle with a fold-out bowl and a bag holder.",
"price": 24.9, "stock": 120, // store currency; stock null = not tracked
"status": "draft", // "active" shows it in the store; "draft" keeps it hidden
"image_url": "https://cdn.yoursite.com/bottle.jpg",
"options": [ { "name": "Colour", "values": ["Blue", "Pink"] } ],
"variants": [
{ "sku": "SKU-1042-BL", "options": { "Colour": "Blue" }, "price": 24.9, "stock": 60, "image_url": "https://…/blue.jpg" },
{ "sku": "SKU-1042-PK", "options": { "Colour": "Pink" }, "price": 24.9, "stock": 60 }
]
}Images are downloaded once and stored by Luzingu (public https links, JPEG/PNG/WebP up to 15 MB); they are only downloaded again when the link changes. When you send variants it replaces the list; variants are matched to existing ones by id or sku. Products per store depend on the merchant's plan: 100 on the free trial, 500 on Starter and 1000 on Growth (test stores: 1000); over the limit you get 422 limit_reached with limit and plan. Up to 100 variants per product.
Orders
GET /api/v1/orders?status=paid,fulfilled&updated_since=&limit=&cursor= (read_orders; only paid orders and later)
GET /api/v1/orders/{id}
{ "id", "number": "LZ-4F2K9A", "status": "paid" | "fulfilled" | "shipped" | "delivered" | "refunded" | "partially_refunded" | "cancelled",
"currency", "subtotal", "shipping", "discount", "tax", "total", "refunded",
"customer": { "name", "email", "phone" }, "shipping_address": { "name", "line1", "line2", "city", "state", "postal_code", "country" },
"items": [ { "id", "product_id", "variant_id", "name", "variant_name", "quantity", "unit_price", "digital",
"fulfilled_by": "this_app" | "merchant" | "supplier" | "other_app" | "download" } ],
"fulfillment": { "status": "unfulfilled" | "partial" | "shipped" | "delivered", "groups": [ { "group", "shipped", "carrier", "tracking_number", "tracking_url", "delivered" } ] },
"paid_at", "shipped_at", "delivered_at", "created_at", "updated_at" }Fulfillments
POST /api/v1/orders/{id}/fulfillments (write_fulfillments)
{ "tracking_number": "9400111899561234567890", "carrier": "USPS",
"tracking_url": "https://…", // optional; Luzingu adds a tracking link if missing
"status": "shipped", // or "delivered"
"group": "this_app" } // default: items from products your app created
// "merchant": the merchant's own items (shipping apps)When every part of the order has shipped, Luzingu marks the order shipped and emails the customer with tracking (customer_emailed in the response).
Webhooks
Set a webhook link on your app. Luzingu sends POST JSON for every connected store:
orders/paid: a new paid order (ship it if it has items from your products).orders/updated: status, shipment or refund changed.products/created,products/updated: a product was added, or its name, description, price, photos, status, options or variants changed (by the merchant, by any app or by a supplier sync). The payload has the full product, as inGET /products/{id}.inventory/updated: stock changed (a sale, a restock or an edit). Payload: the product plus"inventory": { "product_id", "external_id", "stock", "variants": [ { "id", "sku", "stock" } ] }.products/deleted:"product": { "id", "external_id", "managed_by_app", "name", "deleted": true }.app/uninstalled: the connection ended (see reasons); always sent.
Order topics need read_orders, product topics need read_products. You can choose topics per app in your dashboard. Several changes to one product in a short time are combined into one webhook with its latest state; you also receive changes your own app made (compare managed_by_app and updated_at).
POST https://yourapp.com/luzingu/webhooks
X-Luzingu-Topic: orders/paid
X-Luzingu-Delivery: 5b0c… (unique; use it to ignore duplicates)
X-Luzingu-Store: <store id>
X-Luzingu-Signature: t=1763372400,v1=<hex HMAC-SHA256 of "t.body" with your webhook secret>
{ "id": "5b0c…", "topic": "orders/paid", "store_id": "…", "created_at": "…", "order": { …same as GET /orders/{id}… } }// Node.js: verify the signature
import crypto from "node:crypto";
function verify(rawBody, header, secret) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // older than 5 minutes
const want = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return crypto.timingSafeEqual(Buffer.from(want), Buffer.from(v1));
}
# Python
import hmac, hashlib, time
def verify(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
if abs(time.time() - int(parts["t"])) > 300: return False
want = hmac.new(secret.encode(), f'{parts["t"]}.'.encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(want, parts["v1"])Reply with any 2xx within 10 seconds. Otherwise Luzingu retries after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and then daily, up to 8 tries; you can resend any delivery from your dashboard. Webhooks may arrive more than once or out of order: use updated_at and, when in doubt, GET /orders?updated_since=.
How fulfilment works
Merchants are paid directly by their customers (Stripe, PayPal or Multicaixa) and pay their suppliers from their own accounts. Luzingu never holds merchant funds. Products your app creates are fulfilled by your app: their order items show fulfilled_by: "this_app", and the merchant sees your shipments in Orders next to their own and other suppliers'.
Partners
Building a supplier, dropshipping, print-on-demand, shipping or marketing integration? We'd like to hear from you: hello@luzingu.app. Luzingu may disable apps that misuse merchant data or break these rules: ask only for the permissions you need, keep tokens and customer data secure, and delete a store's data when you receive app/uninstalled unless the law requires otherwise.