Skip to main content

Create an Apple Wallet and Google Wallet loyalty card in 10 minutes

The loyalty card is eldo wallet's most used pass. In three calls, you'll design it, create a customer and email them their card. Allow 10 minutes.

Prerequisites: an eldo wallet account on the test environment (https://api-v2.test.eldowallet.fr), which every example below uses.

Every example is available in cURL, Node.js, PHP, Python, Java, C#, Go, Ruby and with the Node.js SDK: pick your language once and it's remembered across the site. The Try it button opens the endpoint page, where you can call it with your token.

0. (Optional) Install the Node.js SDK​

Using Node.js? Generate a typed client, with autocompletion on every endpoint and field, then use the SDK Node.js tab of the examples below.

npx api install https://developers.eldowallet.fr/openapi.en.yaml --identifier eldowallet

Method names are the operation ids shown in the API reference. Other languages: SDKs and tools.

1. Get a 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"
}'

Response:

{"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}

Keep this token: it replaces <token> in the next examples.

export ELDO_TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
On a server, use a wallet token

A login token is tied to a user. For a server integration, create a dedicated wallet token.

2. Design your loyalty card​

The loyalty card is unique per wallet: you set its design once, and each customer gets their own copy. Choose the type (STORE_CARD for a store card with a balance, MEMBER_CARD for a membership card), the program name, the colors, the balance unit and the fields shown on the card.

This endpoint receives an image (strip, the card's banner): the body is multipart/form-data, and objects (colors, descriptions) are sent as a JSON string.

Design the Café Lumière card
PATCH/store-cardsTry it
curl -L -X PATCH 'https://api-v2.test.eldowallet.fr/store-cards' \
-H 'Accept: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>' \
-F 'strip=@"cafe-lumiere-strip.png"' \
-F 'cardType="STORE_CARD"' \
-F 'programName="Café Lumière"' \
-F 'barcodeType="QR_CODE"' \
-F 'gainLabel="POINTS"' \
-F 'gainUnit="POINTS"' \
-F 'startRow="GAIN"' \
-F 'endRow="CREATION_DATE"' \
-F 'descriptions="[{\"title\":\"Program\",\"value\":\"€1 spent = 10 points\"}]"' \
-F 'colors="{\"backgroundColor\":\"\#59358b\",\"labelColor\":\"\#9ee00d\",\"foregroundColor\":\"\#ffffff\"}"'

The logo, icon and contact details shown on the card are set on the wallet (PATCH/wallets). Design tips: design guidelines.

3. Create a customer and send their card​

This time the body is JSON. eldo wallet generates the customer's card; with sendCard: true, it emails them the install link.

Create Camille and send her card
POST/clientsTry it
curl -L 'https://api-v2.test.eldowallet.fr/clients' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>' \
--data-raw '{
"firstName": "Camille",
"lastName": "Martin",
"email": "camille.martin@example.com",
"source": "CRM",
"sendCard": true
}'

The response contains the customer (_id, barcode) and their card's install link (shortLink), which you can also share in your own channels. Camille opens the link and the card is added to Apple Wallet or Google Wallet.

export CLIENT_ID="6650f1c2a9e4b5d1c3a7e921"

4. (Optional) Update their points​

After a purchase, send the customer's new balance: the value replaces the previous balance (it isn't added to it), and each value is kept in the history. The card updates on their phone.

Update Camille's points
PATCH/clients/{id}/gainTry it
curl -L -X PATCH 'https://api-v2.test.eldowallet.fr/clients/$CLIENT_ID/gain' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>' \
-d '{
"gain": 1250
}'

From a checkout that scans the card, use the barcode instead: PATCH/clients/barcode/{barcode}/gain.

Next steps​

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