Skip to content

Documents and forecast: vendor_purchase_orders, vendor_invoices, vendor_remittances, vendor_forecast ​

Amazon's documents as Vendor Central shows them (purchase orders, invoices, payments), and Amazon's forecast of your customers' demand. On request, with the two tables of Product metrics and inventory.

At a glance ​

TableOne row perDated atAmounts
vendor_purchase_orderspurchase order line (seller_partner_id, purchase_order_number, item_sequence_number), the order's header repeated on each linepurchase_order_datethe purchase order's currency
vendor_invoicesinvoice and organization (org_key, invoice_id), on the account that owns itissue_datethe invoice's currency
vendor_remittancespayment line (marketplace_id, payment_id, line_key), the payment's header repeated on each linepayment_datethe line's currency (the payment's)
vendor_forecastaccount × marketplace × ASIN × forecast week (week_start_date), the latest forecast onlyweek_start_dateunits, no money

Two rules hold on the four tables:

  • A document stays in its own currency. Every row carries currency, the currency the purchase order, the invoice or the payment was written in. No amount is converted. Group by currency before you add documents up. vendor_product_metrics holds the same money converted to your organization's currency, at the document's date. The forecast has no money: it is in units.
  • NULL means Amazon did not report it, never zero. The cases are given per table below.

nova_share.vendor_purchase_orders ​

Amazon's purchase orders to your Vendor Central accounts, line by line.

GroupColumns and rules
Header, repeated on every linepurchase_order_date, purchase_order_type, purchase_order_state (Amazon's own header state: New, Acknowledged, Closed), is_open (1 or 0: the app's open or closed reading), the ship window, vendor_code, ship_to_party_id, payment_method, currency, marketplace_id. For one row per order, GROUP BY purchase_order_number and take ANY_VALUE() of them, never SUM()
Lineitem_sequence_number; sku, your own product code on the line (the code vendor_product_metrics.sku shows for the ASIN: the code of its latest purchase order); the units and values, which add up
Ask and shipordered_units is Amazon's gross ask, before its cancellations. accepted_not_received_units and accepted_not_received_value are what is still to ship
NULLthe acknowledgement and receiving side of a line (cancelled, accepted, rejected and received units, what is still to ship, their values, the statuses and their dates, is_past_due) is NULL as a whole until Amazon serves that side. In a formula, wrap these columns in COALESCE(x, 0): LEAST() and GREATEST() skip a NULL argument (LEAST(NULL, 5) is 5). marketplace_id is your account's marketplace (Amazon's purchase orders carry none), NULL until the account has a row in vendor_product_metrics
Not hereDirect Fulfillment purchase orders, and those older than Amazon's API history. Not the whole sell-in
sql
-- Your open purchase orders and what is left to ship, per currency
SELECT currency, count(DISTINCT purchase_order_number) AS open_purchase_orders,
       sum(accepted_not_received_units) AS units_to_ship, sum(accepted_not_received_value) AS value_to_ship
FROM vendor_purchase_orders
WHERE is_open = 1 AND accepted_not_received_units > 0
GROUP BY currency;

nova_share.vendor_invoices ​

The invoices you sent Amazon, as its Invoices API registers them, and what its payments say of each.

GroupColumns and rules
One rowinvoice × organization, on the account the app shows it on. Two of your accounts paid to the same payee receive the same invoices: the table keeps one copy. Sum over your organization, not over one of the two accounts
Scopeyour vendor group's invoices only. An invoice of another vendor code paid to the same payee is left out, as in the app
The registerAmazon's money, all positive: invoice_amount, amount_paid, queued_for_payment, quick_pay_discount, shortage_claim_amount, price_claim_amount
The settlementwhat Amazon's payments say: settlement_status to claims_reversed. cash_paid is the sum of the invoice's lines in vendor_remittances
NULLthe settlement columns are NULL, not zero, where Nova holds no payment of Amazon's from the invoice's time (Amazon serves two years of payments). amount_paid, the register's figure, is there all the same

What Amazon still owes you is not a column, because the app's rule is young. Today it reads:

sql
-- What Amazon still owes you, as the app reads it today, per currency
SELECT currency, count(*) AS open_invoices,
       sum(invoice_amount - amount_paid - quick_pay_discount) AS owed
FROM vendor_invoices
WHERE invoice_status != 'PAID'
  AND issue_date >= CURDATE() - INTERVAL 400 DAY
  AND NOT (queued_for_payment = 0 AND due_date IS NOT NULL AND due_date < CURDATE() - INTERVAL 180 DAY)
  AND COALESCE(settlement_status, '') != 'paid'
  AND NOT (program = 'direct_fulfillment' AND invoice_status = 'IN_PROGRESS'
           AND queued_for_payment = 0 AND COALESCE(settlement_status, '') != 'unpaid')
GROUP BY currency;

nova_share.vendor_remittances ​

Amazon's payments to you, line by line, and what each line settled.

GroupColumns and rules
A lineone tranche of a document: an invoice you sent, paid (positive) or reversed; or what Amazon deducts (negative): shortage and price claims, co-op and other agreements, chargebacks, advertising, returns, provisions, the early-payment discount. line_class and family sort them with the names the app shows
The paymentpayment_amount and payment_line_count belong to the whole payment: take ANY_VALUE() per payment_id, never SUM()
Identityon every line, cash_paid = net_amount_paid - terms_discount_taken
The app's countthe money of a period is on the lines where is_payment_executed = 1, at payment_date
NULLinvoice_id and parent_invoice_number on a line that names no invoice (an agreement, a chargeback, a return); elsewhere invoice_id joins vendor_invoices.invoice_id. payment_amount when Amazon states no cash for the payment
sql
-- What Amazon deducted from its payments over the last 12 months, by family and currency
SELECT currency, family, -sum(net_amount_paid) AS deducted
FROM vendor_remittances
WHERE is_payment_executed = 1 AND family != 'invoice' AND net_amount_paid < 0
  AND payment_date >= CURDATE() - INTERVAL 365 DAY
GROUP BY currency, family
ORDER BY deducted DESC;

nova_share.vendor_forecast ​

Amazon's forecast of your customers' demand, week by week, over 48 weeks.

GroupColumns and rules
Latest onlyeach weekly read replaces every row of the account: the weeks shift, the figures change. Never add up two pulls you stored
Weeksweek 0 starts on forecast_snapshot_date, the day Nova asked for the forecast (a Tuesday today); a week is 7 days. Compare with actual days by date, never by week_number. Never join forecast_snapshot_date with vendor_inventory.snapshot_date (a Saturday)
Sumsmean_forecast_units adds up over weeks and ASINs. The percentiles (p70_forecast_units, p80_forecast_units, p90_forecast_units) do not: the sum of four weekly P70s is a planning line (the app's "P70 forecast, 4 weeks"), not the P70 of the four weeks
NULLa week Amazon gave no figure for has its four statistics NULL together. An ASIN Amazon does not forecast has no row
sql
-- The demand Amazon forecasts for the next four weeks, per ASIN
SELECT child_asin, sum(mean_forecast_units) AS expected_units_4w, sum(p70_forecast_units) AS p70_planning_line_4w
FROM vendor_forecast
WHERE week_number BETWEEN 0 AND 3
GROUP BY child_asin
ORDER BY expected_units_4w DESC;

Sync ​

  • Each table is dated on its own clock: purchase_order_date, issue_date, payment_date, week_start_date.
  • vendor_forecast: replace your copy at each pull, it holds the latest forecast only.
  • dataset_freshness: vendor_purchase_orders, vendor_invoices and vendor_remittances are daily, vendor_forecast weekly.