Quickstart

From an empty terminal to the first page of products in a few minutes. You need the store admin with the right to manage the API and a plan that includes it.

Loading the search index…

Quickstart

Get a token

  1. In the store admin, open Settings → API and webhooks and create an app. Name it after your system, for example ERP sync.
  2. Choose the scopes the app needs, for example catalog:read and inventory:write, and no more: see apps, tokens and scopes.
  3. Issue a token for the app. It is shown once: copy it into the secret storage of your system.

The examples read the token from the SALEYA_API_TOKEN environment variable. Every request sends it in the Authorization: Bearer header; a token in the address is rejected.

Check the token

GET /me works with any token and tells who it speaks for: the app, its scopes and locations, and its rate limits.

Request
curl "https://api.saleya.app/v1/me" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Response
HTTP/1.1 200 OK

{
  "app": {
    "id": 12,
    "name": "ERP sync",
    "description": null,
    "scopes": [
      "catalog:read",
      "catalog:write",
      "inventory:read",
      "inventory:write",
      "orders:read"
    ],
    "allowed_ips": [
      "203.0.113.10"
    ],
    "all_locations": true,
    "location_ids": [],
    "created_at": "2026-11-02T09:15:00Z"
  },
  "token": {
    "name": "Production",
    "prefix": "saleya_at_3kQ9",
    "expires_at": null
  },
  "store_id": 7,
  "rate_limits": {
    "app": {
      "per_minute": 300,
      "burst": 100
    },
    "store": {
      "per_minute": 1200,
      "burst": 400
    }
  }
}

A 401 here means the token was not accepted: check that it was copied whole. The type of the response says what exactly is wrong — see errors.

Read the store settings

GET /store returns what the other responses are read with:

  • money is an integer in the minor units of currency: 129900 in ARS is 1,299.00; fields ending in _micro, such as cost prices, are in millionths of a minor unit;
  • moments are in UTC, RFC 3339: 2026-11-11T14:30:00Z; business days and hours of the store follow its timezone;
  • names and descriptions are objects by language, {"es": "…", "en": "…"}, in the languages of supported_locales.
Request
curl "https://api.saleya.app/v1/store" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Response
HTTP/1.1 200 OK

{
  "id": 7,
  "name": {
    "es": "Almacén Norte",
    "en": "North Grocery"
  },
  "currency": "ARS",
  "timezone": "America/Argentina/Buenos_Aires",
  "country": "AR",
  "default_locale": "es",
  "supported_locales": [
    "es",
    "en"
  ],
  "marketing_consent_mode": "opt_in"
}

Read the products

A list returns a page of records in data and the cursor of the next page. Ask for the first page of products:

Request
curl "https://api.saleya.app/v1/products?limit=50" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"

To keep a copy of the catalog, read the list to the end and save the sync cursor of the last page: pagination and sync shows the loop.

Next steps

  • Send an Idempotency-Key with every write, so that a retry does not apply it twice — idempotency.
  • A change of a record with a version needs its ETag in If-Match — versions and If-Match.
  • Subscribe to events instead of polling — webhooks.
  • Test against a separate store of your account — development store.
Next guideApps, tokens and scopes