v3

Exchange partner credentials for a token

Partner API access. This is not the customer login — see POST /api/v3/users/login.

POST/api/v3/auth/tokens

No credential — this is the call that gets you one.

How authentication works

Your partner credentials in, a token out. Send the token as Authorization: Bearer <token> on subsequent calls.

This is not the customer login

It authenticates you, not one of your customers. The customer's own login is log a customer in, and its token travels in User-Authorization. Sending a partner token where a customer token belongs is the most common cause of a 401 that looks inexplicable.

You do not need this call at all if you use an api key: x-api-key and Authorization are alternatives, and sending both is a 403. See authentication.

Language

Environment

Credentials

Choose an environment first.

cURL request
curl -X POST https://api.btcdirect.eu/api/v3/auth/tokens \  -H "Content-Type: application/json" \  -d '{    "username": "your-partner-username",    "password": "your-partner-password"  }'
Choose an environment to run this.

Response

A partner token.
{  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5ZmM",  "refreshToken": "v3.rt.8f2c1d9a4b7e6301f5a2c8d4b9e0736a"}

Request

usernamestringrequired

Your partner credential, not a customer email.

Exampleyour-partner-username

passwordpasswordrequired

Responses

200A partner token.
400Invalid request.
401Bad credentials.
429`too_many_attempts` — too many failed partner logins from this address. The attempt was refused before the password was checked; wait `Retry-After` seconds before trying again. Told apart from bad credentials (401) so a client backs off instead of retrying into the limit.
503`maintenance` — full maintenance is on, and every endpoint refuses every request until it ends (`endsAt`, when it has an end). Nothing is wrong with the request and nothing was done; the same request is accepted afterwards. `temporarily_unavailable` — the sign-in could not be decided because the identity service was unreachable; the credentials were neither accepted nor refused. Retry after `Retry-After` seconds. Told apart from any other 503, and from bad credentials (401), by `code`.

Body of the success response

tokenstring

ExampleeyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5ZmM

refreshTokenstring

Examplev3.rt.8f2c1d9a4b7e6301f5a2c8d4b9e0736a

Every failure answers with a message and a code. Switch on the code — messages are written for people and can change.