Customer sales and order requests
GET /cx/v1/customers/sales/{range}
Section titled “GET /cx/v1/customers/sales/{range}”| Param | Default | Notes |
|---|---|---|
groupBy |
summary |
summary, order (orders with their lines) or product (what the account buys) |
customerId |
One account number: that account’s sales only | |
status |
booked |
booked (everything not cancelled), invoiced, open, or a comma list of your own status words |
q |
Order id, SKU or description contains | |
top |
25 | Rows returned: 1 to 100 for the summary, up to 500 when grouped |
format |
csv on the grouped views |
curl "https://api.plunk.io/cx/v1/customers/sales/this_year?customerId=D-1042&groupBy=order&status=open" \ -H "Authorization: Bearer sk_live_••••"// Server-side: the signed-in dealer's open ordersconst url = new URL('https://api.plunk.io/cx/v1/customers/sales/this_year');url.search = new URLSearchParams({ customerId: dealer.accountNumber, groupBy: 'order', status: 'open' });const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.PLUNK_SECRET_KEY}` } });const { items } = await res.json();res = requests.get( "https://api.plunk.io/cx/v1/customers/sales/this_year", params={"customerId": "D-1042", "groupBy": "order", "status": "open"}, headers={"Authorization": f"Bearer {os.environ['PLUNK_SECRET_KEY']}"},)The summary view:
{ "range": "ytd", "summary": { "revenue": 1804210.00, "orders": 902, "units": 1911, "customers": 781, "aov": 2000.23, "repeatCustomers": 84, "repeatRatePct": 10.8 }, "topCustomers": [ { "customerId": "C-2201", "revenue": 41210.00, "orders": 6, "units": 14, "aov": 6868.33, "lastOrder": "2026-08-12" } ]}A dealer’s open orders, with ?customerId=D-1042&groupBy=order&status=open:
{ "range": "this_year", "groupBy": "order", "status": "open", "customerId": "D-1042", "count": 1, "items": [ { "orderId": "SO-55120", "orderDate": "2026-09-28", "customerId": "D-1042", "customerName": "Main Street Interiors", "status": "Open", "repCode": "R07", "storeId": null, "channel": "erp", "revenue": 4796.00, "units": 4, "lineCount": 2, "lines": [ { "productId": "SF-1042", "title": "Harbor Sofa", "quantity": 2, "price": 2398.00, "status": "Open", "image": "https://…" } ] } ], "orderRequests": []}groupBy=product returns items: [{ productId, title, category, image, availability, revenue, units, orders, lastOrder }].
GET /cx/v1/orders/requests
Section titled “GET /cx/v1/orders/requests”Order requests from the Plunk Commerce order desk (accepted quotes and portal reorders) waiting for, or already in, your ERP.
| Param | Default | Notes |
|---|---|---|
status |
pending_erp |
Filter by request status |
customerId |
One account’s requests | |
top |
100 | Rows returned |
{ "status": "pending_erp", "count": 1, "items": [ { "orderRequestId": "…", "number": "OR-1042", "quoteNumber": "Q-3310", "quoteVersion": 2, "source": "portal_reorder", "customerId": "D-1042", "customerName": "Main Street Interiors", "repCode": "R07", "poNumber": "PO-7781", "requestedDate": "2026-10-20", "shipTo": { "…": "…" }, "lines": [ "…" ], "totalNet": 4796.00, "erpOrderId": null, "status": "pending_erp", "statusDate": "…", "createdDate": "…" } ]}404 not_tracked when your account doesn’t run the order desk. When your ERP accepts a request, report it through /ingest/order-status with orderRequest set, and the request links to the order.
Related
Section titled “Related”Was this helpful?
Still stuck? Contact support and include the job or page you were on.