Skip to content
View as Markdown

Diagnosing 403 and 404 ​

Start with a test call ​

organization/get-all is open to every installed integration, so it checks the URL, the key and the IP in one go.

bash
curl -i 'https://api.bito.uz/integration-api/integration/api/v2/organization/get-all' \
  -H "api-key: $BITO_API_KEY"

Look at code in the response body:

ResponseMeaningNext step
code: 0URL, key and IP are fine. The problem is a specific method or permission403 or 404
Non-zero codeThe request reached the API and was refusedError codes
No code field at allThe request did not hit any API method404

404 ​

A missing record does not give 404 in Bito — it comes back as 400 with its own code (for example 26000). 404 means there is no such method and path pair.

Check in order:

  1. HTTP method. A wrong method gives 404, not 405. Lists are POST, reading one record is GET, updating is PUT, deleting is DELETE. See HTTP methods.
  2. Base URL. https://api.bito.uz/integration-api/integration/api/v2/ — you need both integration-api and integration/api/v2. Dev environment: https://api.systematicdev.uz/....
  3. Path, letter by letter. Words are hyphenated (sale-order, get-by-id), no trailing /.
  4. Id in the path. GET /product/get-by-id/{id} — the id goes in the path itself, not in the body or the query string. Not every method works this way: check each in the reference.

403 ​

First tell the code apart.

code: 10024 — IP not on the list ​

The integration has an ip_whitelist and the call came from another address. data holds the IP Bito saw.

  • Add that IP (or its CIDR range) to the list. Up to 50 entries.
  • The list is IPv4 only: a call over IPv6 is refused.
  • If your server's IP changes, get a static outbound address or leave the list empty.

code: 10003 — missing permission ​

Look at data.

dataCauseFix
A permission name (customer_create, sale)The permission was not approved at installAdd it to required_permissions; it works after the merchant re-approves
A section name (reports, sales, file, webhook)The app declares permissions and this section has no permission key, so it is closedSee below
boss, warehouse_id or another role keyThe user in the user_id header lacks the rightUser roles
Emptyuser_id is not in this account or is blocked; or writing a source without multiple_sources switched onCheck the header and the setting

Which method needs which permission: Permissions.

Sections without a permission key. With even one permission in required_permissions, reports, sources, files, settings, webhooks and similar sections close (except organization/get-all and get-by-id). More in Create an integration.

Webhooks

An app that declares required_permissions cannot call the webhook methods.

Changed the list? Existing installs keep working with the list approved at install until the merchant approves the new one.

User roles ​

A request runs as the account owner, or as the user in the user_id header when you send it.

  • If that user's role, organization or warehouse access is not enough, you get 403. The app's permission does not replace it.
  • Only an owner-level user can manage webhook subscriptions.
  • To check, send the same request without user_id: if it passes, the user's role is the cause.

401 ​

codeCauseFix
10004, data: api-key is not provided in the headerNeither api-key nor Authorization arrivedCheck the header name and that no proxy strips it
10004The session was ended: the secret was rotated or the integration uninstalledAuthorize again
10014The access token is invalid or expiredRefresh the token

Two subtleties:

  • When an Authorization header is present, the call is treated as OAuth and api-key is not read. Do not put the API key in Authorization.
  • A wrong API key returns 400, not 401: 115006 or 11000. An integration that is not installed returns 400 with 115004. See Error codes.

Still stuck? Send support the method, full URL, time, HTTP status and response body — without keys or tokens.

Bito 2.0 Integration API