API v2.4 · Last updated Apr 2026

Sales Metrix Documentation

Everything you need to build on Sales Metrix — REST API, webhooks, SDKs, and integration guides.

Quick Start

Up and running in 5 minutes

Four steps from zero to your first live API response.

01

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.

02

Install the SDK

Choose your language below. The SDK handles authentication, retries, rate limiting, and type safety automatically.

03

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.

04

Subscribe to webhooks

Register a webhook endpoint to receive real-time events — order.created, order.shipped, inventory.low, and 40+ more.

Base URL
https://api.salesmetrix.com/v2
Content-Typeapplication/json
AuthorizationBearer {API_KEY}
SM-Version2026-04-01
import 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);
Response200 OK
{
  "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_..." }
}
API Reference

REST API endpoints

All resources follow REST conventions. JSON in, JSON out. Paginated lists use cursor-based pagination.

AUTH

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.

1,000 req/min
Rate limit
Per API key — burst up to 2,000
Cursor-based
Pagination
Use next_cursor from meta object
Header-pinned
API versioning
SM-Version: YYYY-MM-DD
Webhooks

Real-time event subscriptions

Subscribe to any combination of 40+ events. We deliver to your endpoint with automatic retries and signature verification.

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)
  );
}
Retry attempts
With exponential back-off
30s
Timeout
Per delivery attempt
At-least-once
Ordering
Use idempotency keys
JSON
Format
UTF-8, no gzip
Guides

Integration & how-to guides

Integrations8 min

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 guide
Integrations12 min

Amazon Seller Central: fulfilment and inventory sync

Connect via Amazon SP-API, map your ASINs to SKUs, and configure FBA vs. FBM routing rules.

Read guide
Fulfilment10 min

Build multi-warehouse routing rules

Define routing priority by proximity, stock level, carrier SLA, and order value — with override conditions.

Read guide
Fulfilment7 min

Rate shopping: configure carrier preferences

Set carrier weight rules, account credentials, and tie-breaking logic when two carriers quote the same rate.

Read guide
Returns9 min

Launch a self-service returns portal

Brand your returns page, configure approval rules, and set up automatic restocking on scan.

Read guide
Developer6 min

Register and verify webhook endpoints

Set up HTTPS endpoints, configure event filters, and implement signature verification in Node.js or Python.

Read guide
Developer5 min

Idempotency and safe retries

Use the Idempotency-Key header to safely retry POST requests without creating duplicate orders or shipments.

Read guide
Security11 min

Configure fraud scoring rules

Set risk score thresholds, define block-list patterns, and route flagged orders to a manual review queue.

Read guide
Integrations15 min

ERP sync: NetSuite, SAP, and QuickBooks

Map Sales Metrix order data to your ERP's purchase orders, sales orders, and inventory accounts.

Read guide
Official SDKs

Libraries in your language

All SDKs are open-source, typed, and maintained by the Sales Metrix team.