SnapPar LogoSnapPar
Public Developer Reference • OpenAPI 3.1

SnapPar Enterprise REST API & Webhooks

Integrate NetSuite, SAP, shop-floor scales, RFID gates, and automated purchasing workflows directly with SnapPar bins, spatial warehouse health maps, and immutable compliance audit trails.

Authentication & Quickstart

Issue scoped machine tokens (sk_live_...) from Admin Settings → Enterprise API Keys. Send tokens via X-API-Key or Authorization: Bearer. Workspaces must hold an active Enterprise Fleet subscription (403 ENTERPRISE_PLAN_REQUIRED otherwise).

Primary Web & API Proxy
https://snappar.app
Direct Cloud Run API
https://api.snappar.io
Local Go API Server
http://localhost:8080

Quickstart Examples

# 1. Export OUT & LOW bins with supplier order URLs
curl -sS "https://snappar.app/api/v1/reports/deficits?urgency=OUT" \
  -H "X-API-Key: sk_live_your_key"

# 2. Push ERP stock counts back to SnapPar
curl -sS -X POST "https://snappar.app/api/v1/bins/bulk-stock" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"bin_qr_id":"A01-B02-04","current_stock":24,"par_level":20}]}'

API Key Scopes, Rate Limits & Error Codes

Machine keys default to 120 requests/minute per key with X-RateLimit-Remaining andX-RateLimit-Reset headers. Human-session Admin routes (/api-keys,/team, /billing, /workspace) reject API keys with403 SESSION_AUTH_REQUIRED to prevent privilege escalation.

Enterprise API Key Scope Matrix
ScopePermitted OperationsCovered Routes
bins:readRead-only bin catalog, barcode locate, product lookup & deficit CSV/JSONGET /bins, /bins/{id}, /bins/locate, /products/{code}, /reports/deficits
bins:writeCreate/update bins, bulk ERP stock sync, IoT telemetry, CSV import & ASN trackingPOST/PUT/DELETE /bins*, /bins/bulk-stock, /telemetry/bins, /receiving/asn
requests:readList and filter replenishment requests by status & unix timestampGET /requests?status=&since=
requests:writeCreate, approve, deny, receive, and attach external ERP POs to requestsPOST /requests*, PATCH /requests/{id}/external-po
audit:readQuery paginated compliance audit logs in JSON or formula-safe CSVGET /audit-logs
locations:readRead facility tree, live bay stockout health, and dock walk-orderGET /orgs/{orgId}/locations/{tree,health,walk-order}
locations:writeModify location nodes, layouts, cloning & bin bindings (Pro/Enterprise)POST/PUT/PATCH/DELETE /orgs/{orgId}/locations*
webhooks:manageAdmin-role key required: register, test ping, inspect deliveries & delete hooksGET/POST/DELETE /webhooks/endpoints*, /webhooks/deliveries
*Wildcard machine scope across API routes (still blocked on session-only Admin routes)All scoped REST endpoints except /api-keys, /team, /billing, /workspace
Standard Error & Rate-Limit Codes
HTTPCodeCauseResolution
401INVALID_API_KEYMissing, malformed, expired, or revoked sk_live_ tokenRotate or re-issue a key from Admin Settings -> Enterprise API Keys
403ENTERPRISE_PLAN_REQUIREDWorkspace is on Solo/Pro or downgraded from Enterprise FleetUpgrade workspace subscription to Enterprise Fleet
403INSUFFICIENT_SCOPEAPI key lacks the required granular scope (e.g. bins:write)Issue a new key including the required scope shown per endpoint
403SESSION_AUTH_REQUIREDMachine key called a human-session route (/api-keys, /team, /billing, /workspace)Use an interactive Admin JWT session instead of X-API-Key
409CONFLICTDuplicate active pending reorder request or rotating a revoked API keyUpdate the existing request or issue a fresh API key
429RATE_LIMIT_EXCEEDEDExceeded 120 requests/min sliding window for this keyBack off until X-RateLimit-Reset unix timestamp

REST Endpoint Reference

Generated directly from openapi_spec.json. All endpoints accept and return UTF-8 JSON (and RFC-4180 formula-safe CSV where noted via ?format=csv).

Download OpenAPI 3.1 JSON

Bins & ERP Sync

Catalog CRUD, barcode resolution, workflow transitions, ERP stock upserts, and deficit reporting.

GET/api/v1/binsList workspace binsbins:read

Returns all bins in the caller's workspace, optionally filtered by substring query `?q=`.

Parameters
  • q(query, string)Filter by title, QR ID, or barcode.
  • workspace_id(query, string)Workspace scope (ProductAdmin only for cross-org).
cURL Request
curl -X GET "https://snappar.app/api/v1/bins" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Workspace bin catalog
{
  "bins": [
    {
      "id": "bin_bolt_m8",
      "bin_qr_id": "A01-B02-04",
      "current_stock": 4,
      "par_level": 20
    }
  ],
  "count": 1
}
401Unauthorized
{
  "error": "API key missing required scope: bins:write",
  "code": "INSUFFICIENT_SCOPE"
}
403Missing bins:read scope or cross-workspace denied
{
  "error": "API key missing required scope: bins:write",
  "code": "INSUFFICIENT_SCOPE"
}
429Rate limit exceeded
{
  "error": "API key missing required scope: bins:write",
  "code": "INSUFFICIENT_SCOPE"
}
POST/api/v1/binsCreate inventory binbins:write

Creates a physical bin mapping with QR code, barcode, par level, and vendor URL. Floor Scanners are blocked.

cURL Request
curl -X POST "https://snappar.app/api/v1/bins" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"id":"bin_bolt_m8","workspace_id":"ws_acme","bin_qr_id":"A01-B02-04","upc_barcode":"049000028904","title":"M8x25 Stainless Hex Bolt (50pk)","category":"Fasteners","primary_vendor_url":"https://www.mcmaster.com/91287A142","default_price":14.5,"par_level":20,"current_stock":4,"location_short_code":"A01-B02-04","location_display":"North Plant > Aisle 1 > Bay 2","status":"LOW"}'
Request JSON Body
{
  "id": "bin_bolt_m8",
  "workspace_id": "ws_acme",
  "bin_qr_id": "A01-B02-04",
  "upc_barcode": "049000028904",
  "title": "M8x25 Stainless Hex Bolt (50pk)",
  "category": "Fasteners",
  "primary_vendor_url": "https://www.mcmaster.com/91287A142",
  "default_price": 14.5,
  "par_level": 20,
  "current_stock": 4,
  "location_short_code": "A01-B02-04",
  "location_display": "North Plant > Aisle 1 > Bay 2",
  "status": "LOW"
}
Responses
201Created bin
{
  "id": "bin_bolt_m8",
  "workspace_id": "ws_acme",
  "bin_qr_id": "A01-B02-04",
  "upc_barcode": "049000028904",
  "title": "M8x25 Stainless Hex Bolt (50pk)",
  "category": "Fasteners",
  "primary_vendor_url": "https://www.mcmaster.com/91287A142",
  "default_price": 14.5,
  "par_level": 20,
  "current_stock": 4,
  "location_short_code": "A01-B02-04",
  "location_display": "North Plant > Aisle 1 > Bay 2",
  "status": "LOW"
}
400Missing bin_qr_id or title
403Forbidden (Scanner or missing bins:write)
GET/api/v1/bins/{id}Fetch single bin by ID, QR ID, or UPCbins:read
Parameters
  • id(path, required, string)
cURL Request
curl -X GET "https://snappar.app/api/v1/bins/bin_bolt_m8" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Matched bin
{
  "id": "bin_bolt_m8",
  "workspace_id": "ws_acme",
  "bin_qr_id": "A01-B02-04",
  "upc_barcode": "049000028904",
  "title": "M8x25 Stainless Hex Bolt (50pk)",
  "category": "Fasteners",
  "primary_vendor_url": "https://www.mcmaster.com/91287A142",
  "default_price": 14.5,
  "par_level": 20,
  "current_stock": 4,
  "location_short_code": "A01-B02-04",
  "location_display": "North Plant > Aisle 1 > Bay 2",
  "status": "LOW"
}
403Forbidden
404Bin not found
PUT/api/v1/bins/{id}Update bin configurationbins:write
Parameters
  • id(path, required, string)
cURL Request
curl -X PUT "https://snappar.app/api/v1/bins/bin_bolt_m8" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"id":"bin_bolt_m8","workspace_id":"ws_acme","bin_qr_id":"A01-B02-04","upc_barcode":"049000028904","title":"M8x25 Stainless Hex Bolt (50pk)","category":"Fasteners","primary_vendor_url":"https://www.mcmaster.com/91287A142","default_price":14.5,"par_level":20,"current_stock":4,"location_short_code":"A01-B02-04","location_display":"North Plant > Aisle 1 > Bay 2","status":"LOW"}'
Request JSON Body
{
  "id": "bin_bolt_m8",
  "workspace_id": "ws_acme",
  "bin_qr_id": "A01-B02-04",
  "upc_barcode": "049000028904",
  "title": "M8x25 Stainless Hex Bolt (50pk)",
  "category": "Fasteners",
  "primary_vendor_url": "https://www.mcmaster.com/91287A142",
  "default_price": 14.5,
  "par_level": 20,
  "current_stock": 4,
  "location_short_code": "A01-B02-04",
  "location_display": "North Plant > Aisle 1 > Bay 2",
  "status": "LOW"
}
Responses
200Updated bin
{
  "id": "bin_bolt_m8",
  "workspace_id": "ws_acme",
  "bin_qr_id": "A01-B02-04",
  "upc_barcode": "049000028904",
  "title": "M8x25 Stainless Hex Bolt (50pk)",
  "category": "Fasteners",
  "primary_vendor_url": "https://www.mcmaster.com/91287A142",
  "default_price": 14.5,
  "par_level": 20,
  "current_stock": 4,
  "location_short_code": "A01-B02-04",
  "location_display": "North Plant > Aisle 1 > Bay 2",
  "status": "LOW"
}
400Invalid payload
403Forbidden
DELETE/api/v1/bins/{id}Delete binbins:write
Parameters
  • id(path, required, string)
cURL Request
curl -X DELETE "https://snappar.app/api/v1/bins/bin_bolt_m8" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Deleted
{
  "deleted": true
}
403Forbidden
404Bin not found
POST/api/v1/bins/bulk-stockBatch sync stock, par levels, prices & supplier URLsbins:write

Synchronizes ERP stock counts, par levels, pricing, and vendor URLs in one batch. Records audit trail entries and fires `bin.stock_out`, `bin.stock_low`, or `bin.restocked` webhooks on state transitions.

cURL Request
curl -X POST "https://snappar.app/api/v1/bins/bulk-stock" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"bin_qr_id":"A01-B02-04","current_stock":0,"par_level":24,"default_price":15.25}]}'
Request JSON Body
{
  "items": [
    {
      "bin_qr_id": "A01-B02-04",
      "current_stock": 0,
      "par_level": 24,
      "default_price": 15.25
    }
  ]
}
Responses
200Batch summary
{
  "updated": 1,
  "updated_bins": [
    {
      "id": "bin_bolt_m8",
      "bin_qr_id": "A01-B02-04",
      "current_stock": 0
    }
  ]
}
400Empty items or malformed JSON
403Fleet plan or bins:write scope required
{
  "error": "API key missing required scope: bins:write",
  "code": "INSUFFICIENT_SCOPE"
}
GET/api/v1/bins/locateResolve UPC/case barcode to matching bins sorted by urgencybins:read
Parameters
  • barcode(query, required, string)Scanned UPC, EAN, or alternate case barcode.
cURL Request
curl -X GET "https://snappar.app/api/v1/bins/locate" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Urgency-sorted bin matches
{
  "barcode": "049000028904",
  "bins": [
    {
      "id": "bin_bolt_m8",
      "bin_qr_id": "A01-B02-04"
    }
  ],
  "count": 1
}
400Missing barcode parameter
403Missing bins:read scope
POST/api/v1/bins/{id}/statusTrigger bin workflow status update (Good, Low, Out)bins:write

Executes `notice_flag`, `milkman_audit`, `kanban_loop`, `receiving_reset`, or `sensor_webhook` (Fleet-gated).

Parameters
  • id(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/bins/bin_bolt_m8/status" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"fill_status":"Low","workflow":"milkman_audit","current_stock":5,"notes":"Morning aisle check"}'
Request JSON Body
{
  "fill_status": "Low",
  "workflow": "milkman_audit",
  "current_stock": 5,
  "notes": "Morning aisle check"
}
Responses
200Updated bin, generated request, and scan event
400Invalid status or missing bin
403Insufficient scope or Fleet required for sensor_webhook
GET/api/v1/reports/deficitsExport OUT and LOW replenishment deficits (JSON or CSV)bins:read
Parameters
  • urgency(query, string)
  • supplier(query, string)Filter by vendor host substring (e.g. mcmaster, amazon).
  • location_prefix(query, string)
  • format(query, string)
cURL Request
curl -X GET "https://snappar.app/api/v1/reports/deficits" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Deficit report JSON or formula-safe CSV
{
  "workspace_id": "ws_acme",
  "generated_at": 1795300000,
  "total_bins": 1,
  "total_deficit_units": 24,
  "total_estimated_cost": 366,
  "by_supplier": {
    "mcmaster.com": 1
  },
  "items": [
    {
      "bin_qr_id": "A01-B02-04",
      "title": "M8x25 Hex Bolt",
      "status": "OUT",
      "deficit_qty": 24,
      "estimated_cost": 366
    }
  ]
}
403Fleet plan or bins:read scope required

Replenishment & Requests

Reorder queue inspection, approval/denial/receiving actions, and external ERP PO linking.

GET/api/v1/requestsList reorder requests with ?status= & ?since= filterrequests:read
Parameters
  • status(query, string)
  • since(query, integer)Unix timestamp lower bound on created_at.
cURL Request
curl -X GET "https://snappar.app/api/v1/requests" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Filtered requests
{
  "requests": [
    {
      "id": "req_1795300200",
      "product_id": "bin_bolt_m8",
      "quantity": 20,
      "status": 1
    }
  ],
  "count": 1
}
403Missing requests:read scope
POST/api/v1/requestsCreate replenishment requestrequests:write
cURL Request
curl -X POST "https://snappar.app/api/v1/requests" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"bin_bolt_m8","quantity":20,"notes":"Flagged at bay 2"}'
Request JSON Body
{
  "product_id": "bin_bolt_m8",
  "quantity": 20,
  "notes": "Flagged at bay 2"
}
Responses
201Created request
{
  "id": "req_1795300200",
  "workspace_id": "ws_acme",
  "product_id": "bin_bolt_m8",
  "quantity": 20,
  "status": 1,
  "notes": "Below par on North Aisle 1",
  "created_at": 1795300200
}
403Missing requests:write scope
409Active pending request already exists
POST/api/v1/requests/{id}/approveApprove request and generate fulfillment cart linkrequests:write
Parameters
  • id(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/requests/bin_bolt_m8/approve" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Approved request and cart URL
{
  "request": {
    "id": "req_1795300200",
    "status": 2
  },
  "cart_link": "https://www.mcmaster.com/91287A142"
}
403Scanner role or missing requests:write scope
404Request not found
POST/api/v1/requests/{id}/denyDecline reorder requestrequests:write
Parameters
  • id(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/requests/bin_bolt_m8/deny" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Declined request
{
  "request": {
    "id": "req_1795300200",
    "status": 4
  },
  "status": "declined"
}
403Forbidden
404Request not found
POST/api/v1/requests/{id}/receiveMark request received and restock target binrequests:write
Parameters
  • id(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/requests/bin_bolt_m8/receive" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Received request and updated bin stock
403Missing requests:write scope
404Request not found
PATCH/api/v1/requests/{id}/external-poAttach ERP PO number and optionally mark ORDEREDrequests:write
Parameters
  • id(path, required, string)
cURL Request
curl -X PATCH "https://snappar.app/api/v1/requests/bin_bolt_m8/external-po" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"po_number":"ERP-PO-4490","vendor":"McMaster-Carr","mark_ordered":true}'
Request JSON Body
{
  "po_number": "ERP-PO-4490",
  "vendor": "McMaster-Carr",
  "mark_ordered": true
}
Responses
200Updated request with PO tag
{
  "request": {
    "id": "req_1795300200",
    "status": 3,
    "notes": "[PO: ERP-PO-4490 · McMaster-Carr]"
  }
}
400Missing po_number
403Fleet plan or requests:write scope required
404Request not found

IoT Telemetry & Receiving

Idempotent sensor/PLC readings and supplier Advanced Shipping Notice (ASN) ingestion.

POST/api/v1/telemetry/binsBatch ingest IoT scale/RFID/PLC telemetry with idempotencybins:write

Ingests measured quantities or fill statuses from shop-floor scales, RFID gates, or PLCs with per-workspace idempotency deduplication.

cURL Request
curl -X POST "https://snappar.app/api/v1/telemetry/bins" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"readings":[{"bin_id":"A01-B02-04","measured_qty":3,"sensor_id":"scale-bay2","idempotency_key":"scale-bay2-1795300120"}]}'
Request JSON Body
{
  "readings": [
    {
      "bin_id": "A01-B02-04",
      "measured_qty": 3,
      "sensor_id": "scale-bay2",
      "idempotency_key": "scale-bay2-1795300120"
    }
  ]
}
Responses
200Ingestion counts
{
  "processed": 1,
  "deduplicated": 0
}
400Empty readings or bad JSON
403Fleet plan or bins:write scope required
POST/api/v1/orgs/{orgId}/receiving/asnIngest supplier Advanced Shipping Notice & tracking numbersbins:write

Attaches carrier tracking numbers to one or more matching bins, logs an audit entry, and emits a `shipment.tracked` webhook.

Parameters
  • orgId(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/orgs/ws_acme/receiving/asn" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"tracking_number":"1Z999AA10123456784","po_number":"PO-2026-8841","items":[{"bin_qr_id":"A01-B02-04"}]}'
Request JSON Body
{
  "tracking_number": "1Z999AA10123456784",
  "po_number": "PO-2026-8841",
  "items": [
    {
      "bin_qr_id": "A01-B02-04"
    }
  ]
}
Responses
200ASN tracking applied
{
  "matched_bin_ids": [
    "bin_bolt_m8"
  ],
  "tracking": [
    "1Z999AA10123456784"
  ],
  "unmatched": []
}
400Missing tracking number or items
403Fleet plan or bins:write scope required
404No matching bins found

Spatial Warehouse

Hierarchical facility tree, live bay stockout rollups, and dock-anchored walk sequences.

GET/api/v1/orgs/{orgId}/locations/treeFetch hierarchical warehouse tree & 2D floor planlocations:read
Parameters
  • orgId(path, required, string)
cURL Request
curl -X GET "https://snappar.app/api/v1/orgs/ws_acme/locations/tree" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Hierarchical location tree
{
  "tree_version": 4,
  "roots": {
    "site_north": {
      "id": "site_north",
      "name": "North Plant",
      "type": "site"
    }
  }
}
403Cross-org forbidden or missing locations:read scope
GET/api/v1/orgs/{orgId}/locations/{siteId}/healthLive bay & aisle stockout rollup for a warehouse sitelocations:read
Parameters
  • orgId(path, required, string)
  • siteId(path, required, string)
cURL Request
curl -X GET "https://snappar.app/api/v1/orgs/ws_acme/locations/site_north/health" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Bay stockout summary
{
  "site_id": "site_north",
  "summary": {
    "OUT": 1,
    "LOW": 2,
    "TRANSIT": 1,
    "OK": 8,
    "EMPTY": 0
  },
  "bays": [
    {
      "bay_id": "bay_2",
      "bay_name": "Bay 2",
      "short_code": "B02",
      "aisle_name": "Aisle 1",
      "status": "OUT",
      "bin_count": 6,
      "deficit_qty": 24
    }
  ]
}
403Fleet plan or locations:read scope required
404Site not found
GET/api/v1/orgs/{orgId}/locations/{siteId}/walk-orderOrdered spatial walk-path sequence anchored to dock/doorlocations:read
Parameters
  • orgId(path, required, string)
  • siteId(path, required, string)
cURL Request
curl -X GET "https://snappar.app/api/v1/orgs/ws_acme/locations/site_north/walk-order" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Nearest-neighbor walk sequence
{
  "site_id": "site_north",
  "walk_order": [
    "bay_1",
    "bay_2",
    "bay_5"
  ],
  "count": 3
}
403Fleet plan or locations:read scope required
404Site not found

Compliance & Audit

Immutable bin, workflow, and machine-token traceability records in JSON or formula-safe CSV.

GET/api/v1/audit-logsQuery paginated bin traceability audit logs (JSON or CSV)audit:read
Parameters
  • bin_id(query, string)
  • workflow(query, string)
  • actor(query, string)
  • q(query, string)
  • from(query, integer)
  • to(query, integer)
  • limit(query, integer)
  • offset(query, integer)
  • format(query, string)
cURL Request
curl -X GET "https://snappar.app/api/v1/audit-logs" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Audit log entries
{
  "entries": [
    {
      "id": "aud_1795300120",
      "workflow": "bulk_stock_sync",
      "action": "updated",
      "actor": "API Key: NetSuite ERP"
    }
  ],
  "total": 1,
  "count": 1
}
403Fleet plan or audit:read scope required
GET/api/v1/openapi.jsonFetch public OpenAPI 3.1 contractpublic
cURL Request
curl -X GET "https://snappar.app/api/v1/openapi.json"
Responses
200OpenAPI 3.1 JSON document

Outbound Webhooks

HMAC-SHA256 signed event endpoint subscriptions, synchronous ping tests, and delivery logs.

GET/api/v1/webhooks/endpointsList outbound webhook subscriptionswebhooks:manage
cURL Request
curl -X GET "https://snappar.app/api/v1/webhooks/endpoints" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Registered endpoints (secrets omitted)
{
  "endpoints": [
    {
      "id": "wh_1795300400",
      "url": "https://erp.acme.com/hooks/snappar",
      "events": [
        "bin.stock_out"
      ]
    }
  ],
  "count": 1
}
403Admin + Fleet + webhooks:manage required
POST/api/v1/webhooks/endpointsRegister HTTPS webhook endpoint & receive whsec_ secretwebhooks:manage

Validates URL against HTTPS and SSRF rules (blocking internal/metadata IPs) and returns the HMAC signing secret once.

cURL Request
curl -X POST "https://snappar.app/api/v1/webhooks/endpoints" \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://erp.acme.com/hooks/snappar","description":"SAP Purchasing Bus","events":["bin.stock_out","bin.stock_low","request.created"]}'
Request JSON Body
{
  "url": "https://erp.acme.com/hooks/snappar",
  "description": "SAP Purchasing Bus",
  "events": [
    "bin.stock_out",
    "bin.stock_low",
    "request.created"
  ]
}
Responses
201Created endpoint with one-time signing_secret
{
  "endpoint": {
    "id": "wh_1795300400",
    "secret_prefix": "whsec_98ab12cd"
  },
  "signing_secret": "whsec_98ab12cd..."
}
400Invalid or blocked target URL
403Admin + Fleet + webhooks:manage required
DELETE/api/v1/webhooks/endpoints/{id}Delete webhook endpointwebhooks:manage
Parameters
  • id(path, required, string)
cURL Request
curl -X DELETE "https://snappar.app/api/v1/webhooks/endpoints/bin_bolt_m8" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Deleted
{
  "deleted": true,
  "id": "wh_1795300400"
}
403Forbidden
404Endpoint not found
POST/api/v1/webhooks/endpoints/{id}/testSend synchronous HMAC-signed webhook.test payloadwebhooks:manage
Parameters
  • id(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/webhooks/endpoints/bin_bolt_m8/test" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Delivery attempt result
{
  "delivery": {
    "id": "dlv_1795300500",
    "event": "webhook.test",
    "status_code": 200,
    "success": true
  }
}
403Forbidden
404Endpoint not found
GET/api/v1/webhooks/deliveriesInspect recent webhook delivery attemptswebhooks:manage
Parameters
  • endpoint_id(query, string)
  • limit(query, integer)
cURL Request
curl -X GET "https://snappar.app/api/v1/webhooks/deliveries" \
  -H "X-API-Key: sk_live_your_key"
Responses
200Delivery attempts
{
  "deliveries": [
    {
      "id": "dlv_1795300500",
      "event": "webhook.test",
      "status_code": 200,
      "success": true
    }
  ],
  "count": 1
}
403Forbidden

API Keys (Session Only)

Interactive Admin session endpoints for minting, rotating, and revoking sk_live_ tokens.

GET/api/v1/api-keysList Enterprise API keys (Admin session)session:admin

Requires an interactive Admin browser/user session (`403 SESSION_AUTH_REQUIRED` if called with `X-API-Key`).

cURL Request
curl -X GET "https://snappar.app/api/v1/api-keys" \
  -H "Authorization: Bearer $ADMIN_SESSION_TOKEN"
Responses
200Key metadata list (hashes omitted)
{
  "api_keys": [
    {
      "id": "key_1795300300",
      "name": "NetSuite ERP",
      "prefix": "sk_live_4a9c2f10",
      "active": true
    }
  ],
  "count": 1
}
403SESSION_AUTH_REQUIRED or FLEET_PLAN_REQUIRED
{
  "error": "API key missing required scope: bins:write",
  "code": "INSUFFICIENT_SCOPE"
}
POST/api/v1/api-keysCreate scoped sk_live_ API key (Admin session)session:admin
cURL Request
curl -X POST "https://snappar.app/api/v1/api-keys" \
  -H "Authorization: Bearer $ADMIN_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"NetSuite ERP","role":"Admin","scopes":["bins:read","bins:write","requests:read"],"expires_in_days":90}'
Request JSON Body
{
  "name": "NetSuite ERP",
  "role": "Admin",
  "scopes": [
    "bins:read",
    "bins:write",
    "requests:read"
  ],
  "expires_in_days": 90
}
Responses
201Created key metadata + one-time plaintext_key
{
  "api_key": {
    "id": "key_1795300300",
    "prefix": "sk_live_4a9c2f10"
  },
  "plaintext_key": "sk_live_4a9c2f10..."
}
400Invalid scope or missing name
403SESSION_AUTH_REQUIRED or non-Admin
POST/api/v1/api-keys/{id}/rotateRotate active API key secret (Admin session)session:admin
Parameters
  • id(path, required, string)
cURL Request
curl -X POST "https://snappar.app/api/v1/api-keys/bin_bolt_m8/rotate" \
  -H "Authorization: Bearer $ADMIN_SESSION_TOKEN"
Responses
200Updated metadata + new plaintext_key
403SESSION_AUTH_REQUIRED
404API key not found
409Cannot rotate an already-revoked API key
DELETE/api/v1/api-keys/{id}Revoke API key (Admin session)session:admin
Parameters
  • id(path, required, string)
cURL Request
curl -X DELETE "https://snappar.app/api/v1/api-keys/bin_bolt_m8" \
  -H "Authorization: Bearer $ADMIN_SESSION_TOKEN"
Responses
200Revoked key
{
  "revoked": true,
  "api_key": {
    "id": "key_1795300300",
    "active": false
  }
}
403SESSION_AUTH_REQUIRED
404API key not found

Signed Outbound Webhooks

Subscribe HTTPS endpoints to live warehouse stockouts, reorder approvals, and supplier ASN shipments. Every delivery includes X-SnapPar-Event, X-SnapPar-Delivery, andX-SnapPar-Signature: t=<unix>,v1=<hmac_sha256_hex> signed with yourwhsec_... secret.

SSRF & Redirect Guardrails

Production and staging enforce HTTPS endpoints, reject embedded credentials, private/CGNAT/ULA/link-local/metadata IPs (at registration and DNS dial time), and disable HTTP redirects.

Signature Formula

Compute HMAC-SHA256 over {timestamp}.{raw_json_body} using your UTF-8 signing secret, compare with constant-time equality, and reject timestamps older than 300 seconds.

Outbound Webhook Event Catalog
EventTriggerKey Data Fields
bin.stock_outBin drops to 0 stock via scan, telemetry, or bulk syncbin_id, bin_qr_id, title, workflow, current_stock, par_level
bin.stock_lowBin transitions into LOW state at or below par levelbin_id, bin_qr_id, title, workflow, current_stock, par_level
bin.restockedBin returns to OK above par via restock or bulk syncbin_id, bin_qr_id, title, workflow, current_stock, par_level
bin.supplier_swappedPrimary/fallback vendor redirect target switched for binbin_id, bin_qr_id, active_vendor_target, active_url
request.createdNew replenishment request queued by worker or sensorrequest_id, product_id, quantity, requester
request.approvedManager or Admin approves a replenishment requestrequest_id, product_id, quantity
request.deniedManager or Admin declines a replenishment requestrequest_id, product_id, quantity
request.receivedOrdered request marked received and bin stock incrementedrequest_id, product_id, quantity
shipment.trackedSupplier ASN ingests carrier tracking numbers for binsbin_ids, tracking_numbers, po_number, note
webhook.testManual synchronous verification ping from Admin or APImessage

Webhook Payload Envelope

{
  "id": "dlv_1795300500",
  "event": "bin.stock_out",
  "workspace_id": "ws_acme",
  "timestamp": 1795300500,
  "data": {
    "bin_id": "bin_bolt_m8",
    "bin_qr_id": "A01-B02-04",
    "title": "M8x25 Stainless Hex Bolt (50pk)",
    "workflow": "sensor_webhook",
    "status": "OUT",
    "current_stock": 0,
    "par_level": 20
  }
}

Verify X-SnapPar-Signature

import crypto from 'node:crypto';

export function verifySnapParSignature(rawBody, headerValue, secret, maxAgeSec = 300) {
  const parts = Object.fromEntries(headerValue.split(',').map(p => p.split('=')));
  const ts = Number(parts.t);
  if (!ts || Math.abs(Math.floor(Date.now() / 1000) - ts) > maxAgeSec) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${ts}.${rawBody}`).digest('hex');
  return parts.v1?.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(parts.v1, 'utf8'), Buffer.from(expected, 'utf8'));
}

Ready to connect your ERP or shop-floor sensors?

Start a 14-day Enterprise Fleet trial in Admin Settings to mint scoped sk_live_ keys and register signed webhooks.

Explore Enterprise Fleet