SelSup Developers

Integration fundamentals · Guides

Getting started

Authentication, the first request, localized errors, pagination, and a safe production rollout.

4 sectionsDeveloper guide

Start with a dedicated token and a read operation. Add mutations only after error handling and retry behavior have been tested.

Backend developers and integrators

01

Authentication and token storage

Send the API token directly in the Authorization header without a Bearer prefix.

Create a separate token for every integration. You can then revoke one connection without interrupting others and grant only the permissions it needs.

Store the token in server-side secrets. Never ship it in browser JavaScript, a mobile application, a URL, logs, or analytics.

!
This is not OAuth

Do not add Bearer or Basic. The Authorization value is the SelSup token itself.

First request · cURL
curl --request GET 'https://api.selsup.ru/api/brand/find?limit=50&page=1' \
  --header 'Authorization: YOUR_API_TOKEN'

02

Errors and message locale

Branch on the stable error field and use localMessage only for human-readable output.

An application error normally contains error, localMessage, and params. The server translates localMessage using the lang field of the user who owns the token.

The documentation language and Accept-Language do not change the error locale. Never compare localMessage in code or persist it as a machine status.

i
Diagnostic context

Record the HTTP status, error, params, request time, and your correlation ID. Never log the token or personal data.

Application error contract · JSON
{
  "error": "brand_already_exists",
  "localMessage": "Brand Base already exists",
  "params": {
    "name": "Base"
  }
}

03

Paginating large collections

Use stable sorting and stop when hasNextPage is false or the returned page is shorter than the limit.

count=true can trigger an additional count query. Send it on the first request only when total is actually needed.

Data can change between pages. For recurring synchronization, sort by an immutable identifier and process changes in a separate incremental flow.

Pagination loop · JavaScript
let page = 1;
let hasNextPage = true;

while (hasNextPage) {
  const url = new URL('https://api.selsup.ru/api/brand/find');
  url.searchParams.set('limit', '500');
  url.searchParams.set('page', String(page));
  url.searchParams.set('sortBy', 'BRANDID');
  url.searchParams.set('ascending', 'true');

  const response = await fetch(url, {
    headers: { Authorization: process.env.SELSUP_API_TOKEN }
  });
  if (!response.ok) throw await response.json();

  const result = await response.json();
  await savePage(result.rows);
  hasNextPage = result.hasNextPage;
  page += 1;
}

04

Production checklist

  1. 1

    Separate reads and writes

    Validate GET requests first. Use test entities and an explicit confirmation step for mutations.

  2. 2

    Configure timeouts and retries

    Retry network failures and safe operations only. A POST without your own idempotency key can create a duplicate.

  3. 3

    Limit concurrency

    Respect endpoint limits and use a queue with exponential backoff and a small random jitter.

  4. 4

    Reconcile results

    After a bulk synchronization, compare counts and sample identifiers, then move discrepancies into a separate queue.

!
Live account data

Try it sends the request to the token owner's account. The documentation adds a confirmation for writes, but you should still use test records.