DeimOS Connect

The buyer API.

Each retailer has a hashed key, an assortment, and six routes. This page is the contract in sentences. The machine file is OpenAPI 3.1.

Turnkey store connectors

WooCommerce and Shopify, no developer needed

Your buyers install one pre-configured package. Catalog, stock and prices sync on their own, and retail orders come back as clean purchase orders.

Request pilot access

WooCommerce plugin

A ready-made .zip with the buyer's key and schedule already inside.

  • Imports products, images and buyer prices
  • Signed real-time stock webhooks
  • Routes each product to the right distributor

Shopify app link

Connect with an Admin API token and one order webhook.

  • Inventory synced to Shopify locations
  • Paid orders forwarded instantly or in batches
  • Several DeimOS distributors in one store
  1. 01AuthenticateA buyer-scoped key that sees only their assortment.
  2. 02InstallUpload the plugin or paste the Shopify token.
  3. 03Route and sendOrders go out instantly, daily, weekly or monthly.

Auth

A key is a channel.

Authorization: Bearer carries a per-buyer secret. We store a hash. The tenant sees a prefix. Rotate writes a new row and revokes the old one. A revoked key, or a buyer that is not active, is 401.

The address ceiling is 300 requests a minute. The channel has its own limit on top. POST /v1/orders without an Idempotency-Key is 400 before the bearer is read.

RequestGET /v1/products
Authorization: Bearer dei_...

200
{
  "products": [{
    "sku": "AB-100",
    "currency": "EUR",
    "net_minor": 450,
    "stock": 12,
    "available": true
  }],
  "next_cursor": null
}

HTTP

Six routes

Every route is scoped to one buyer key. Copy a path straight into your client.

OpenAPI 3.1 spec
GET/v1/products

Catalog for this key, 50 at a time. The cursor is opaque. A bad cursor is 400.

Scopeproducts:read
GET/v1/products/{sku}

One product. 404 when it is outside the assortment.

Scopeproducts:read
GET/v1/stock

Quantity under the channel rule: count, available, threshold, or hide zero.

Scopestock:read
GET/v1/prices

Net price in minor units from the assigned price list.

Scopeprices:read
POST/v1/orders

Idempotency-Key required. Unknown SKU is 400. The same key replays as 200. A new order is 201.

Scopeorders:write
GET/v1/orders/{id}

An order that belongs to this channel. Any other id is 404.

Scopeorders:read

Status

What the codes mean

Seven codes, each with one meaning. Build your retry logic on these.

Success

2
  • 201Created

    New order.

  • 200OK

    Same Idempotency-Key. The original order comes back.

Client errors

4
  • 400Bad Request

    Missing Idempotency-Key, a key longer than 256 characters, invalid JSON, unknown SKU, bad cursor, or a body over 100,000 bytes.

  • 401Unauthorized

    Missing, unknown, or revoked key, or a buyer that is not active.

  • 404Not Found

    SKU or order outside this channel.

  • 409Conflict

    That external id is already stored under a different Idempotency-Key.

Rate limit

1
  • 429Too Many Requests

    Over 300 requests a minute from one IP, or over the channel limit.

Webhooks

Signed, then retried.

The signature is HMAC-SHA256 of the timestamp, a dot, and the raw body. The header value starts with sha256=. Delivery id, event, and timestamp are on the request. Failures back off, then the endpoint disables. The tenant can replay.

There is no order.received. The shop already has the POST response. Status after that is the event that matters.

Events8

Click an event to copy its name.

Starter kit

Copy, run, sync.

cURL, Node.js, PHP, and a WooCommerce plugin that call the live Buyer API. Set the host and a key, then copy a snippet or download a zip. The examples call GET /v1/products with next_cursor, poll stock and prices, and verify X-Deimos-Signature.

Auth, catalog pages, stock and price polls, and a check of the webhook signature. Requires curl, jq, and openssl for the looped examples.

Auth test

# GET /v1/products is a signed-in first page. A missing or revoked key is 401.
curl -sS \
  -H 'Authorization: Bearer dei_replace_me' \
  -H 'Accept: application/json' \
  'https://deimosb2b.com/v1/products'

Full catalog, then the next cursor

# There is no separate delta route. Page GET /v1/products with the opaque next_cursor.
# Incremental changes arrive as product.upserted, stock.changed, and price.changed webhooks.
BASE='https://deimosb2b.com'
AUTH='Authorization: Bearer dei_replace_me'

curl -sS -H "$AUTH" -H 'Accept: application/json' "$BASE/v1/products"

# When next_cursor is a string, request the next page:
# curl -sS -H "$AUTH" -H 'Accept: application/json' "$BASE/v1/products?cursor=CURSOR"

cursor=""
while :; do
  if [ -n "$cursor" ]; then
    url="$BASE/v1/products?cursor=$(printf '%s' "$cursor" | jq -sRr @uri)"
  else
    url="$BASE/v1/products"
  fi
  page=$(curl -sS -H "$AUTH" -H 'Accept: application/json' "$url")
  printf '%s\n' "$page"
  cursor=$(printf '%s' "$page" | jq -r '.next_cursor // empty')
  [ -z "$cursor" ] && break
done

Stock and price poll

# GET /v1/stock returns sku, stock, available. GET /v1/prices returns sku, currency, net_minor, moq, and tiers.
# Money is integer minor units. Add ?sku=AB-100 to read one row. A SKU outside the assortment is 404.
BASE='https://deimosb2b.com'
AUTH='Authorization: Bearer dei_replace_me'

curl -sS -H "$AUTH" -H 'Accept: application/json' "$BASE/v1/stock"
curl -sS -H "$AUTH" -H 'Accept: application/json' "$BASE/v1/prices"
curl -sS -H "$AUTH" -H 'Accept: application/json' "$BASE/v1/stock?sku=AB-100"
curl -sS -H "$AUTH" -H 'Accept: application/json' "$BASE/v1/prices?sku=AB-100"

Webhook HMAC-SHA256 verification

# Signature is HMAC-SHA256 of "{unix timestamp}.{raw body}".
# Header: X-Deimos-Signature: sha256=<hex>
# Also sent: X-Deimos-Event, X-Deimos-Id, X-Deimos-Timestamp, User-Agent: DeimOS-Webhooks
SECRET='whsec_replace_me'
TIMESTAMP=$DEIMOS_TIMESTAMP   # value of X-Deimos-Timestamp
BODY_FILE='body.json'
SIGNATURE=$DEIMOS_SIGNATURE   # value of X-Deimos-Signature

expected="sha256=$(printf '%s.' "$TIMESTAMP" | cat - "$BODY_FILE" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')"

# Compare $expected to $SIGNATURE in a language with a constant-time equality check.
# Events: product.upserted, stock.changed, price.changed, assortment.changed,
# order.accepted, order.rejected, order.fulfilled, order.cancelled.
# There is no order.received event.
printf '%s\n' "$expected"

ERP

XML and CSV out.

Accept writes the order as XML or as a semicolon CSV, and can POST that document to a URL you set. A status file can mark it fulfilled or cancelled. Later ERP maps read the same orders. They do not become a second database.

Pilot

One distributor. Shops posting orders.

Request a pilot and we review it by hand. Approved pilots get a 7-day workspace.