Start a customer session
Always MFA-aware: a customer with two-factor enrolled receives a challenge rather than tokens.
POST/api/v3/users/login
Send your own credential. No customer is involved.
How authentication works- Yours
x-api-keyorAuthorization: Bearer
Language
Environment
Credentials
Your credential
Choose an environment first.
curl -X POST https://api.btcdirect.eu/api/v3/users/login \ -H "x-api-key: $BTCD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "emailAddress": "customer@example.com", "password": "the-customer-s-password" }'Response
{ "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5ZmM", "refreshToken": "v3.rt.8f2c1d9a4b7e6301f5a2c8d4b9e0736a", "uuid": "9fc3a1b8-52d7-4e60-9a13-7c8b4d2e5f09", "deviceToken": "v3.dt.1a7f4c92e08b5d63a4f1c7e920b8d365", "twoFactorRequired": false, "emailCodeRequired": false, "challengeId": "6c1f0b9e-2a47-4d1e-9b3c-5e8f7a2d4c10"}Request
emailAddressemailrequired
Examplecustomer@example.com
passwordpasswordrequired
Responses
200Tokens, or a challenge.400Invalid request.401Bad credentials.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
uuidstring
Example9fc3a1b8-52d7-4e60-9a13-7c8b4d2e5f09
deviceTokenstring
Examplev3.dt.1a7f4c92e08b5d63a4f1c7e920b8d365
twoFactorRequiredboolean
When true, no tokens are issued — complete the challenge first.
emailCodeRequiredboolean
When true, no tokens are issued: a 6-digit code was mailed to the account's address to confirm this device.
challengeIdstring
The challenge the second step redeems; set with twoFactorRequired or emailCodeRequired.
Example6c1f0b9e-2a47-4d1e-9b3c-5e8f7a2d4c10
Every failure answers with a message and a code. Switch on the code — messages are written for people and can change.