Overview & authentication

The read API v1 lives on your organization's own origin — every endpoint is under https://{your-org}.leidang.app/api/v1/. It is read-only by design: the integration groundwork for pulling inventory into other systems, not a write channel.

Tokens

Create tokens under Admin → API tokens (requires the api_access plan feature). A token is shown once at creation — it is stored hashed and cannot be recovered, only revoked and reissued. Each token carries the read scopes you grant it (for example items.view, stock.view); economy fields appear in responses only when the token also holds economy.view.

Request
curl https://your-org.leidang.app/api/v1/items?status=active \
  -H "Authorization: Bearer ldg_XXXXXXXXXXXXXXXX"

Pagination

  • List endpoints return up to limit rows (1–200, default 50), ordered by id.
  • A response with more rows available carries nextCursor — pass it back as ?cursor= to continue. A missing nextCursor means you have everything.
  • updatedSince (ISO-8601) turns any list into an incremental sync feed.

Errors

Errors are JSON with a human-readable message. 401 — missing, malformed, unknown, or revoked token (the response carries WWW-Authenticate: Bearer); 403 — the token lacks the scope the endpoint checks; 400 — a filter you sent is invalid, with the reason spelled out.

Treat tokens like passwords: server-side only, one token per integration, revoke what you stop using.