v3

Confirm a registration

Confirms the account with the code `POST /api/v3/users` mailed and the `confirmationToken` it returned, and signs the customer in. Every failure — wrong, expired or superseded code, a wrong confirmationToken, an unknown address, or an account not awaiting confirmation — answers the same 400 `invalid_code`, so a wrong guess never reveals which part was wrong.

POST/api/v3/users/confirm

Send two credentials: your own, and the customer's.

How authentication works
Yours
x-api-keyorAuthorization: Bearer
The customer's
User-Authorization: BearerorUser-Identifier

Language

Environment

Credentials

Your credential

The customer's credential

Choose an environment first.

cURL request
curl -X POST https://api.btcdirect.eu/api/v3/users/confirm \  -H "x-api-key: $BTCD_API_KEY" \  -H "User-Authorization: Bearer $BTCD_USER_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "email": "customer@example.com",    "code": "123456",    "confirmationToken": "the-confirmationToken-the-register-call-returned"  }'
Choose an environment to run this.

Response

Confirmed. The same session shape a login returns.
{  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5ZmM",  "refreshToken": "v3.rt.8f2c1d9a4b7e6301f5a2c8d4b9e0736a",  "uuid": "9fc3a1b8-52d7-4e60-9a13-7c8b4d2e5f09",  "deviceToken": "v3.dt.1a7f4c92e08b5d63a4f1c7e920b8d365"}

Request

emailemailrequired

Examplecustomer@example.com

codestringrequired

confirmationTokenstringrequired

The value `POST /api/v3/users` returned alongside `resendAvailableAt`. Only the screen that submitted the registration holds it.

deviceTokenstring

The device credential a previous call issued to this browser, if it has one. The response returns a rotated value which the caller must store in place of the old one.

Responses

200Confirmed. The same session shape a login returns.
400`invalid_code` — identical for every failure reason.
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. Told apart from any other 503 by `code`.

Body of the success response

tokenstring

ExampleeyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5ZmM

refreshTokenstring

Examplev3.rt.8f2c1d9a4b7e6301f5a2c8d4b9e0736a

uuidstring

Example9fc3a1b8-52d7-4e60-9a13-7c8b4d2e5f09

deviceTokenstring

Examplev3.dt.1a7f4c92e08b5d63a4f1c7e920b8d365

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