Skip to main content

Authentication

Every call (except login) must carry a token. There are two kinds of tokens, and you use them the same way.

Login token (JWT)Wallet token
Obtained withPOST/auth/loginPOST/wallets/tokens
Tied toa user (and their role)your wallet
Expiresyes (see below)never, unless you set expiresAt
Revoke bychanging the passwordDELETE/wallets/tokens/{id}
Use it fortesting, one-off scriptsserver integrations

Tokens are specific to each environment: a test token doesn't work in production.

Send the token​

Authorization: Bearer <token>

The API also accepts the x-access-token: <token> header and the ?access_token=<token> query parameter. If several are present, the order of precedence is access_token, then x-access-token, then Authorization.

Avoid ?access_token=

A token in the URL ends up in proxy and server logs. Use the Authorization header.

Login token​

Log in
POST/auth/loginTry it
curl -L 'https://api-v2.test.eldowallet.fr/auth/login' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>' \
-d '{
"username": "your-username",
"password": "your-password"
}'

The response contains the token: {"token": "eyJhbGciOi..."}.

  • The login token expires. There is no refresh token: once the token has expired, the API returns 401:UNAUTHORIZED and you log in again.
  • The token contains your role and the pass types enabled for your wallet. A call to a type that isn't enabled (for example /transits without the Transit option) returns 403:FORBIDDEN.

For a server integration, don't rely on the login token's expiry: use a wallet token.

Wallet tokens​

For a server integration, create a dedicated token, store it in your secrets vault, and rotate it regularly.

Create a wallet token
POST/wallets/tokensTry it
curl -L 'https://api-v2.test.eldowallet.fr/wallets/tokens' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>' \
-d '{
"expiresAt": "2027-06-30T00:00:00.000Z"
}'
{
"_id": "6650f1c2a9e4b5d1c3a7e921",
"token": "3f9c…e1a7",
"tokenable": "6650a0b1c2d3e4f5a6b7c8d9",
"tokenableType": "WALLET",
"expiresAt": "2027-06-30T00:00:00.000Z"
}

Authentication errors​

CodeWhen
401:UNAUTHORIZEDMissing, invalid or expired token, or wrong password
403:FORBIDDENValid token, but insufficient role or pass type not enabled

See all errors.

API news, once a month

New endpoints, upcoming changes, guides and use cases. No spam, one-click unsubscribe.

Report a technical problem

An API error, a pass that does not update, an email that does not arrive? Describe the problem: our technical team will answer.

For a fast answer, include:

  • The method and endpoint (e.g. POST /clients)
  • The error code returned (errorCode) and the body sent
  • The date and time of the call
  • The identifiers involved (customer, template, pass)

Never include an API token or a password.

AI assistant

Beta

Loading…

AI-generated answers (Claude): double-check important details.

Sign in to use the assistant