Report orders
lumieo can only see sales your webshop tells it about. Report each order from your server, and Reports shows revenue from your widgets and from QR codes on your screens.
You need a secret key with the order::write permission (see API keys).
1. Remember the session on the cart line
Section titled “1. Remember the session on the cart line”Every lumieo visit has a session id. Store it on the cart line when the shopper adds a product, so you can send it with the order.
From a widget, the add-to-cart event carries it:
Lumieo.handle("action:add-to-cart", async (event) => { await myCart.add(event.variant.externalId, event.quantity, { // Saved on the line, e.g. as a Shopify line item property lumieo_session: event.sessionId, }); return { ok: true };});From a QR code on a screen, the product page opens with ?lumieo_session=… in its address. Keep that value for the visit (a first-party cookie is enough) and put it on the lines the shopper adds.
The session id is random and new on every page load. It says nothing about who the shopper is.
2. Send the order
Section titled “2. Send the order”When the order is placed, call POST /v1/orders from your server:
curl -X POST https://api.loomieo.com/v1/orders \ -H "Authorization: Bearer $LUMIEO_KEY" \ -H "Content-Type: application/json" \ -d '{ "siteId": "SITE_ID", "externalOrderId": "10045", "currency": "SEK", "totalMinor": 84800, "lines": [ { "productExternalId": "TEE-01", "variantExternalId": "TEE-01-M", "quantity": 1, "amountMinor": 34900, "sessionId": "6f1c2a8e-4b7d-4e0a-9a51-2f3c8d9e1b70" }, { "productExternalId": "SCARF-02", "variantExternalId": "SCARF-02", "quantity": 1, "amountMinor": 49900 } ] }'- Amounts are whole numbers in minor units, after discounts:
34900is 349.00 SEK. sessionIdgoes only on lines that have one. Lines without one are fine.- Safe to retry. The same
externalOrderIdfor the same market is recorded once, so retry freely after a timeout. - Send every order, not only ones with a session. lumieo works out which ones count.
How sales are counted
Section titled “How sales are counted”Reports shows two figures side by side and never adds them together:
- Direct revenue: lines whose variant was added to the cart with a widget’s add-to-cart button, within 7 days.
- Orders with video: the whole total of orders that had any lumieo session.
3. Report refunds
Section titled “3. Report refunds”Refunds and returns take revenue back off:
curl -X POST https://api.loomieo.com/v1/orders/10045/refunds \ -H "Authorization: Bearer $LUMIEO_KEY" \ -H "Content-Type: application/json" \ -d '{ "siteId": "SITE_ID", "externalRefundId": "R-311", "amountMinor": 34900, "lines": [{ "variantExternalId": "TEE-01-M", "amountMinor": 34900 }] }'amountMinor comes off the order; the optional lines say which lines it was for, so direct revenue drops too. Direct revenue is never more than what is left of the order: after a full refund it is 0, even without lines. Each externalRefundId is recorded once.
Full request and response details are under Orders.
Shopify and WooCommerce
Section titled “Shopify and WooCommerce”There’s no ready-made app yet, so use your platform’s order webhook (Shopify’s orders/create, WooCommerce’s Order created) to call POST /v1/orders from a small server function. Read lumieo_session from the line item properties you saved in step 1.