SALAF EMSDevelopers
salafems.com

Inventory

Stock levels per variant per location, and the append-only movement ledger behind them.

Paste a key and every snippet on this page switches from the placeholder to your key — and the Try it panel under each endpoint is ready to send. It is stored in this browser only and goes nowhere except, if you press Send, straight to the API host you pick there.

Adjust stock at a location

POST/ext/v1/inventory/adjustmentsinventory:write

The staff adjustment path verbatim: row-locked, ledgered, activity-logged. A reason is always required here; on-hand can never go below zero or below the reserved quantity; damage must remove stock; purchase requires a unit_cost and folds into the moving-average cost.

Headers

NameTypeDescription
Idempotency-KeyrequiredstringREQUIRED. A unique value per logical request (a UUID is ideal); reuse it verbatim when retrying. A retry replays the original response with Idempotent-Replayed: true instead of running twice.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
location_idrequireduuidLocation (warehouse) to adjust.
variant_idrequireduuidThe variant being adjusted.
quantity_changerequirednumberSigned change to on-hand. Positive adds stock, negative removes; never zero. Cannot take on-hand below zero or below reservations — the same rules staff adjustments obey.
typestringdefault adjustmentLedger category. purchase adds stock at a required unit_cost; damage must remove stock; default adjustment.purchasereturnadjustmentdamage
reasonrequiredstringStored on the ledger entry. Required.
unit_costnumberPer-unit cost of the moved units. REQUIRED for purchase (stock cannot enter at no cost); otherwise the variant's current cost values the movement. Write-only — cost never appears in any response (Q6).
low_stock_thresholdnumberOptionally update the low-stock threshold for this level.

Request

export SALAF_API_KEY="salaf_sk_YOUR_API_KEY"

curl -sS -X POST "https://api.salafems.com/ext/v1/inventory/adjustments" \
  -H "Authorization: Bearer $SALAF_API_KEY" \
  -H "Idempotency-Key: e7a1…-your-uuid" \
  -H "Content-Type: application/json" \
  -d '{
  "location_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
  "variant_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
  "quantity_change": -5,
  "reason": "Cycle count correction — shelf B4."
}'
Try itruns from your browser
POSThttps://api.salafems.com/ext/v1/inventory/adjustments

Stored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.

Valid JSON
Idempotency-Keyrequired
generating…

A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.

Paste a key above to enable Send.

Responses

  • 201The adjusted stock level, in the same shape as GET /v1/inventory/levels rows.
  • 401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.
  • 403The key's scopes do not cover this endpoint.
  • 404Unknown location or variant.
  • 422Validation failed — error.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
  "store_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
  "location_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
  "variant_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
  "sku": "TSHIRT-RED-M",
  "on_hand": 10,
  "reserved": 7,
  "available": 3,
  "low_stock_threshold": 5,
  "is_low_stock": false,
  "status": "active",
  "location": {
    "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
    "name": "Main Warehouse",
    "code": "WH-01"
  },
  "variant": {
    "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
    "sku": "TSHIRT-RED-M",
    "barcode": null,
    "name": "Red / M",
    "product_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001"
  },
  "created_at": "2026-08-11T10:00:00.000Z",
  "updated_at": "2026-08-11T10:00:00.000Z"
}

List stock levels (one row per variant per location)

GET/ext/v1/inventory/levelsinventory:read

Each row carries on_hand, reserved and the available difference — sell against available, not on_hand.

Query parameters

NameTypeDescription
limitnumberdefault 25max 100Page size.
starting_afterstringReturn the page AFTER this object id (the previous page's next_cursor).
ending_beforestringReturn the page BEFORE this object id.
sortstringdefault -created_atNewest first by default. Only created_at is sortable — a cursor over a mutable key (like updated_at) cannot page reliably. Use updated_after to sync changes.created_at-created_at
store_idstringRestrict to one store. Required breadth control for company-scoped keys; on a store-scoped key it must match the key's own store.
warehouse_idstringOnly levels at this location.
variant_idstringOnly levels for this variant.
low_stockbooleanOnly levels at or below the variant's low-stock threshold — the reorder query, answered server-side so an integrator does not page the whole catalog to find twelve rows.

Request

export SALAF_API_KEY="salaf_sk_YOUR_API_KEY"

curl -sS "https://api.salafems.com/ext/v1/inventory/levels?limit=25" \
  -H "Authorization: Bearer $SALAF_API_KEY"
Try itruns from your browser
GEThttps://api.salafems.com/ext/v1/inventory/levels

Stored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.

Query parameters

Blank fields are left out of the request.

Paste a key above to enable Send.

Responses

  • 200A cursor page of stock levels.
  • 401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.
  • 403The key's scopes do not cover this endpoint.
  • 422Validation failed — error.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "data": [
    {
      "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "store_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "location_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "variant_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "sku": "TSHIRT-RED-M",
      "on_hand": 10,
      "reserved": 7,
      "available": 3,
      "low_stock_threshold": 5,
      "is_low_stock": false,
      "status": "active",
      "location": {
        "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
        "name": "Main Warehouse",
        "code": "WH-01"
      },
      "variant": {
        "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
        "sku": "TSHIRT-RED-M",
        "barcode": null,
        "name": "Red / M",
        "product_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001"
      },
      "created_at": "2026-08-11T10:00:00.000Z",
      "updated_at": "2026-08-11T10:00:00.000Z"
    }
  ],
  "meta": {
    "has_more": true,
    "next_cursor": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001"
  }
}

List stock movements (the append-only ledger behind the levels)

GET/ext/v1/inventory/movementsinventory:read

Every quantity change with before/after readings — reservations, sales, adjustments, transfers. Costs never appear here.

Query parameters

NameTypeDescription
limitnumberdefault 25max 100Page size.
starting_afterstringReturn the page AFTER this object id (the previous page's next_cursor).
ending_beforestringReturn the page BEFORE this object id.
sortstringdefault -created_atNewest first by default. Only created_at is sortable — a cursor over a mutable key (like updated_at) cannot page reliably. Use updated_after to sync changes.created_at-created_at
store_idstringRestrict to one store. Required breadth control for company-scoped keys; on a store-scoped key it must match the key's own store.
warehouse_idstringOnly movements at this location.
variant_idstringOnly movements for this variant.

Request

export SALAF_API_KEY="salaf_sk_YOUR_API_KEY"

curl -sS "https://api.salafems.com/ext/v1/inventory/movements?limit=25" \
  -H "Authorization: Bearer $SALAF_API_KEY"
Try itruns from your browser
GEThttps://api.salafems.com/ext/v1/inventory/movements

Stored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.

Query parameters

Blank fields are left out of the request.

Paste a key above to enable Send.

Responses

  • 200A cursor page of movements.
  • 401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.
  • 403The key's scopes do not cover this endpoint.
  • 422Validation failed — error.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "data": [
    {
      "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "store_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "location_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "variant_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "type": "adjustment",
      "quantity": -2,
      "quantity_before": 12,
      "quantity_after": 10,
      "reference_type": "manual",
      "reference_id": null,
      "note": "Damaged in transit",
      "created_at": "2026-08-11T10:00:00.000Z"
    }
  ],
  "meta": {
    "has_more": true,
    "next_cursor": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001"
  }
}