Sales Metrix Documentation
Everything you need to build on Sales Metrix — REST API, webhooks, SDKs, and integration guides.
Up and running in 5 minutes
Four steps from zero to your first live API response.
Get your API key
Navigate to Settings → API Keys in your Sales Metrix dashboard and create a new secret key. Keep it safe — it won't be shown again.
Install the SDK
Choose your language below. The SDK handles authentication, retries, rate limiting, and type safety automatically.
Make your first call
Use the example to list your orders. Swap in your API key and you'll see live data from your connected channels.
Subscribe to webhooks
Register a webhook endpoint to receive real-time events — order.created, order.shipped, inventory.low, and 40+ more.
https://api.salesmetrix.com/v2Content-Typeapplication/jsonAuthorizationBearer {API_KEY}SM-Version2026-04-01import SalesMetrix from "@salesmetrix/sdk";
const client = new SalesMetrix({
apiKey: process.env.SM_API_KEY,
});
// List orders from all channels
const orders = await client.orders.list({
status: "pending",
limit: 20,
});
console.log(orders.data);{
"data": [
{
"id": "ord_01HXYZ8821",
"status": "pending",
"channel": "shopify",
"customer": { "name": "Acme Corp", "email": "ops@acme.com" },
"total": 4200.00,
"currency": "USD",
"created_at": "2026-04-30T09:12:44Z"
}
],
"meta": { "total": 142, "limit": 20, "next_cursor": "cur_..." }
}REST API endpoints
All resources follow REST conventions. JSON in, JSON out. Paginated lists use cursor-based pagination.
Bearer token authentication
All endpoints require an Authorization: Bearer {API_KEY} header. Keys are scoped — read-only keys cannot write data. Generate keys in Settings → API Keys.
Real-time event subscriptions
Subscribe to any combination of 40+ events. We deliver to your endpoint with automatic retries and signature verification.
order.createdA new order was placed on any connected channel
order.updatedOrder status, metadata, or line items changed
order.fulfilledAll items in the order have been picked and packed
order.cancelledOrder was cancelled and inventory released
shipment.createdA shipping label was purchased for an order
shipment.in_transitCarrier scanned the package at a facility
shipment.deliveredCarrier confirmed delivery at the destination
shipment.exceptionCarrier reported a delay, hold, or failed delivery
return.initiatedCustomer submitted a return request
return.receivedWarehouse scanned the returned item
return.refundedRefund posted to the original payment method
inventory.lowSKU stock dropped below the configured threshold
inventory.stockoutSKU reached zero stock across all locations
inventory.restockedStock was added or transferred to a location
payment.failedPayment gateway declined or returned an error
fraud.flaggedOrder scored above the fraud risk threshold
Example payload
{
"id": "evt_01HXYZ99KM",
"type": "order.created",
"created_at": "2026-04-30T09:12:44Z",
"api_version": "2026-04-01",
"data": {
"id": "ord_01HXYZ8821",
"status": "pending",
"channel": "shopify",
"customer": {
"name": "Acme Corp",
"email": "ops@acme.com"
},
"items": [
{ "sku": "ENT-KIT-003", "qty": 3, "price": 1400.00 }
],
"total": 4200.00,
"currency": "USD"
}
}Signature verification
Each request includes an SM-Signature header. Verify it with your webhook secret to ensure the payload is authentic.
import crypto from "crypto";
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac("sha256", secret)
.update(payload)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Integration & how-to guides
Connect Shopify and sync orders in real time
Install the Sales Metrix Shopify app, configure channel settings, and enable live order sync with two-way inventory updates.
Read guideAmazon Seller Central: fulfilment and inventory sync
Connect via Amazon SP-API, map your ASINs to SKUs, and configure FBA vs. FBM routing rules.
Read guideBuild multi-warehouse routing rules
Define routing priority by proximity, stock level, carrier SLA, and order value — with override conditions.
Read guideRate shopping: configure carrier preferences
Set carrier weight rules, account credentials, and tie-breaking logic when two carriers quote the same rate.
Read guideLaunch a self-service returns portal
Brand your returns page, configure approval rules, and set up automatic restocking on scan.
Read guideRegister and verify webhook endpoints
Set up HTTPS endpoints, configure event filters, and implement signature verification in Node.js or Python.
Read guideIdempotency and safe retries
Use the Idempotency-Key header to safely retry POST requests without creating duplicate orders or shipments.
Read guideConfigure fraud scoring rules
Set risk score thresholds, define block-list patterns, and route flagged orders to a manual review queue.
Read guideERP sync: NetSuite, SAP, and QuickBooks
Map Sales Metrix order data to your ERP's purchase orders, sales orders, and inventory accounts.
Read guideLibraries in your language
All SDKs are open-source, typed, and maintained by the Sales Metrix team.
Start with a free API key
Create a sandbox account, generate your key, and make your first call in under 5 minutes. No credit card needed.