Skip to content

Live orders: nova_share.orders_live ​

Today's order lines as the app's Live page sees them: the current UTC day and the three before it, one row per order line, refreshed every minute.

At a glance ​

One rowseller × marketplace × order × child ASIN × SKU: the grain of orders, with the same column names for what both tables carry
Holdsthe order lines of the current UTC day and the three before it. A line arrives seconds after the order, provisional; the order report replaces it within the hour
Not herefees, refunds, settlements: orders is the reconciliation table, this one is today's sales. Cancelled orders: a line that gets cancelled disappears
Historyfour days. A line then leaves the table; orders (nightly) and product_metrics (hourly) keep it
Refreshevery minute
Served oncelive, then from the report: a SUM(quantity) over the table is never doubled
Openon every account

Columns ​

ColumnMeaning
seller_partner_id, seller_name, org_keyYour account.
marketplace_id, marketplace_nameThe marketplace of the order.
order_id, child_asin, skuThe line. child_asin is NULL on a provisional line whose ASIN Nova does not know yet: the notification carries the SKU, not the ASIN.
purchase_at_utc, purchase_at_local, purchase_dayWhen the buyer ordered: UTC, the marketplace's wall clock (Seller Central's time), and the marketplace-local day product_metrics books the sale on.
last_updated_atThe latest notification on a provisional line; Amazon's last update of the order otherwise (UTC).
order_status, item_status, fulfillment_channel, is_business_orderAmazon's statuses (Pending, Unshipped, Shipped), Amazon (FBA) or Merchant (FBM), 1 on an Amazon Business order.
quantityUnits ordered on the line.
product_salesItem price total of the line, positive, in currency. An estimate while is_provisional = 1.
item_promotion_discount, ship_promotion_discountThe promotions on the line, negative, in currency; NULL while provisional.
currencyYour organization's primary currency.
is_provisional, provisional_source1 and live_events while the line comes from the notification; 0 and empty once the report holds it.

Provisional lines ​

A line arrives from Amazon's order notification with is_provisional = 1. Its product_sales is an estimate: units × the SKU's latest price, a Business order at its latest Business price, in your primary currency. A SKU with no sale in the last 60 days reads 0 until the report. Its promotions are NULL. Within the hour the order report brings the line's own price and promotions, and the row reads is_provisional = 0.

A provisional line stays 6 hours at most. When Amazon's report is late, the line leaves the table after 6 hours. It comes back when the report brings it, with is_provisional = 0.

Read it ​

sql
-- A live view of the day, one query a minute
SELECT purchase_day,
       SUM(quantity)                                                   AS units,
       SUM(product_sales)                                              AS sales,
       SUM(CASE WHEN is_provisional = 1 THEN product_sales ELSE 0 END) AS sales_estimated
FROM nova_share.orders_live
WHERE seller_partner_id = 'A1XXXXXXXXXXXX'
  AND purchase_day >= CURDATE() - INTERVAL 1 DAY
GROUP BY purchase_day
ORDER BY purchase_day DESC;

The feed of the latest lines is the same table: ORDER BY purchase_at_utc DESC LIMIT 20.

Two things to know

purchase_day is the marketplace's day. Around midnight, an account on a European marketplace already has lines on a purchase_day later than CURDATE() in UTC: filter on a range and group by the day, as above. The comparison with the same day a week ago is a question for orders or product_metrics, not for this four-day window.

Sync ​

  • Do not sync this table: read it live. For history, orders and product_metrics.
  • dataset_freshness: the orders_live row, every_minute.
  • orders: the same lines, with fees, refunds and settlements, for 24 months.
  • product_metrics: the same sales, booked by purchase_day.