Marketplace orders, hub and ERP invoices
Source of truth per channel, deduplication and reconciliation with confidence
Sales by marketplace, account, store and day, once each
Marketplace dashboard, AI agent and pending items list
What it solves
- Each marketplace sale appears once, even though it exists in the marketplace, the hub and the ERP.
- It becomes clear how much each marketplace, each account and each store sold, consolidated and separately.
- Channel orders with no match in the ERP (and vice versa) appear in a list, with a confidence level.
Business questions it answers
Ask your agent these questions once the case is live.
What you need
- The marketplaces and the hub or ERP connected to Nekt
- The list of hub stores or channels that correspond to each marketplace and account
- The dates when any channel changed systems or started invoicing without an order
What you get
- A table by order and channel with value, status, date and source of origin
- A marketplace x hub or ERP reconciliation table with confidence level
- Dashboard by marketplace, account and store, with individual filter and consolidated view
- A coverage indicator per source that separates a day with no sales from a day with no data
Where to activate
Revenue, orders, ticket and cancellations by channel, account and store, with individual filter and consolidated view on every card.
Answers how much each channel sold, with the source used and a warning when the load is late.
Every week, channel orders with no match in the ERP and invoices without an order, for finance to resolve.
Each channel is simple on its own. The work is in choosing the source of truth per channel and period and in matching identifiers across marketplace, hub and ERP. The detailed view has the business rules, the pitfalls and the acceptance test. Or send everything straight to your agent with the Nekt MCP.
The marketplace order is copied to the hub, which creates the order in the ERP, which issues the invoice. Each layer has its own identifier: the order ID and the pack on Mercado Livre, the store order number in the hub, the order number and the invoice in the ERP. Channels change operations mid-year (they start invoicing without an order, switch hub accounts) and each source has its own date: purchase, confirmation, invoicing, balance release. Adding everything duplicates; choosing just one source loses sales.
How it is usually done, and the rule
Each row is a mistake that already happened in practice.
For each marketplace, declare which source defines the sale (the marketplace itself via API, the hub or the ERP) and from when. The other sources are for reconciling, never for adding. Store this choice in a channels table with start and end dates, so the rule is read by the dashboard and by the agent.
In the hub, each marketplace and each account is a store with its own ID. Classify the channel by store ID in a mapping table (store → marketplace → account), not by free text. In the ERP, when there is no store, the channel comes from a documented combination: order origin, integration salesperson, project or a note that mentions the marketplace. Write the criteria in the context document.
On Mercado Livre, a cart with several items generates several orders grouped by pack_id, and one shipment can cover the whole pack. The hub may store either the order ID or the pack_id in the store order number. Count orders by the channel's order ID, and use the pack to match with the hub and the shipment. The channel's orders table comes with repeated versions: keep the latest version of each ID.
Match the hub order to the marketplace order in order of strength: store order number equals order ID (high), store order number equals pack_id (high), same value and close date in the same account (medium), no match (pending). Store the rule that matched and the evidence in columns. Reports state how much is reconciled; the AI never claims a pair is confirmed when confidence is medium.
Some channels, from a certain date, start being invoiced directly via NF-e (e-invoice, usually in a dedicated series) with no sales order in the ERP. The channel's base is the union of identified orders with outbound invoices in that series issued without an order. An invoice that already has an order does not go in again. A sales CFOP (fiscal operation code) flag separates sales from shipments, transfers or stock sent to the marketplace warehouse: filter sales only.
When the channel migrates from one hub account to another, or from the hub to the marketplace API, each source contributes only its own period. Declare the cutoff date (last day in the old source, first in the new one) and make sure no day appears in both or in neither.
The reference date for revenue is the order confirmation date. Payout follows each marketplace's balance release rule, which can land weeks later. Keep both timelines in separate columns and never compare a month's revenue with the same month's payout as if they were the same money.
Some channels' reports count each line item as an order (Amazon's orders report replicates the "Quantity Ordered" of e-commerce BI tools). Define per channel whether "orders" means distinct orders or line items and write it in the column description. Amazon revenue is itemPrice excluding tax; tax comes separately. A SKU without a product mapping goes to "Uncategorized" with a flag, never disappears.
Count valid and cancelled orders in separate columns, by order date. Cancelled orders do not go into revenue, but they do go into the cancellation rate. Load incrementally by the order's update date (in the hub, the modified field), not by creation date: old orders change status, and this is the only way the change comes through.
For each source and account, record the period covered, days with data, days with no records and the latest load. A day with no rows in an account that sells every day is a load failure until proven otherwise. The dashboard shows the channel as "no data", not as zero, and the AI warns when the source is late.
How to match each channel with the hub or ERP
Reconciliation key and caveat for each source.
Definitions
Pitfalls that already happened
The marketplace started being invoiced by invoice only, with no order in the ERP. The order-based report showed the channel collapsing from that date, while sales had not dropped.
Union of channel orders with the channel series invoices issued without an order.
The channel switched hub accounts and both accounts stayed active for a few days. Adding both duplicated sales for the week of the switch.
Cutoff date declared per source, with an overlap test.
Orders with the same value on the same day were matched to the wrong hub order, and the confirmed conversion in the report did not exist.
Reconcile by ID or pack first; a value match stays at medium confidence and is shown as such.
Invoices for stock sent to the marketplace warehouse went in as channel sales and inflated the month in which stock was replenished.
Sales CFOP flag; shipments and transfers outside revenue.
An account went days without syncing and the dashboard showed zero sales. Leadership pressed the channel team before anyone looked at the load.
Coverage table per source and a "no data" state in the dashboard and in AI answers.
Acceptance test
The case is done when every item passes.
- For one marketplace, one account and one closed month, valid orders and revenue match the marketplace's own sales report (difference below 1%).
- Each channel order ID appears exactly once in the consolidated table.
- The sum by marketplace equals the consolidated total for the same period, and the individual store filter adds up to the consolidated total.
- In the days around each system cutoff date, no order appears in two sources and no day is left without a source.
- The month's % reconciled is reported, and every pending order appears in the pending items list with the rule attempted.
Agent package
Paste into Claude, ChatGPT or any client with the Nekt MCP connected.
Consolidated marketplaces - Grain: one row per channel order (order ID in the marketplace). Items in the order line item table. - The source of truth per channel and period is in the channels table. Do not add marketplace, hub and ERP orders together: the other sources only reconcile. - Channel = hub store mapped to marketplace and account. In the ERP, channel by the documented criteria (origin, integration salesperson, project, note). - Mercado Livre: order = ID, latest version; pack_id groups orders and is used to match with the hub. - Reconciliation with the hub by store order number = ID or pack_id (high confidence); by value and date (medium confidence). Never claim a confirmed conversion at medium confidence. - Channels invoiced without an order: add the outbound invoices in the channel's series issued without an order. Sales CFOP only. - Revenue by order confirmation date. Payout by balance release date. Do not treat them as the same date. - Amazon: "orders" follows the definition declared on the column; revenue = itemPrice excluding tax. - Cancelled orders stay out of revenue, but count toward the cancellation rate. - A day with no data is not a day with no sales: check the coverage table before answering zero, and say when the source is late. - Commissions and fees per channel follow the rules of the contribution margin case. Client exceptions: - <client>: channel <marketplace> invoiced without an order since <date>, series <series>. - <client>: hub accounts <account A> until <date>, <account B> from <date>. - <client>: hub stores <list of ids> = <marketplace> account <account>.
Build the "Consolidated marketplaces" case in my Nekt workspace following the rules at https://academy.nekt.com/en/industrias/varejo/marketplaces-consolidados.md. 1) Find the source tables and confirm the columns the rules use. 2) Create a transformation at the stated grain applying every rule. 3) Run the acceptance test and show me the result of each item. 4) Create the case's context document in the workspace, leaving my clients' exceptions open for me to fill in.
Variations
Listing x day grain with visits, valid and cancelled orders, units and Ads, aggregable by account, family and SKU without double counting.
A snapshot that writes a new row only when title, price, listing type or logistics changed, to link changes to results.
Candidate pairs of sales proposal → order from the same contact within a 90-day window, with a confidence level.