Guides
Authentication
How to send an API key, which header to use, and what the scopes allow.
Send a key on every call that requires one. The key identifies your integration and the accounts it may use. It is not a person's portal sign-in. Keep it on the server that calls the API. Do not put it in a browser page or a mobile app that you ship.
Two headers are accepted. If you send both, they must be equal. The samples use an environment variable so the key is not written into source.
AuthorizationheaderrequiredBearer token. A test key starts with bk_test_. A live key starts with bk_live_.
X-API-KeyheaderThe same key, if you cannot set Authorization.
curl https://api.backchecked.app/v1/me \
-H "Authorization: Bearer $BACKCHECKED_API_KEY"The variable should hold the key only, for example bk_test_example. Do not include the word Bearer in the variable if the header already says Bearer.
What the key can do
Call the calling key first. GET /v1/me returns the key id, the accounts it may use, the scopes, and the mode. It does not return the key itself. Do this before the first live order so you can see that the mode and the accounts are the ones you expect.
orders:write is required to create an order. orders:read is required to list orders, read one order, read status, or read a report.
Downloading the OpenAPI document does not require a key. Use that when you want the contract without credentials.
A key that starts with bk_live_ places live orders. The try-it panel on a reference page accepts only a key that starts with bk_test_. It keeps that key in memory for the page and does not store it.
A missing or unknown key returns 401 unauthenticated. A key that is valid but missing the scope returns 403 forbidden. An account that is not on the key returns 403 account_not_allowed.