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 eldowalletMethod names are the operation ids shown in the API reference. Other languages: SDKs and tools.
1. Get a token
- curl
- SDK Node.js
- nodejs
- php
- python
- java
- csharp
- go
- ruby
- CURL
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..."
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.
- curl
- SDK Node.js
- nodejs
- php
- python
- java
- csharp
- go
- ruby
- CURL
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.
- curl
- SDK Node.js
- nodejs
- php
- python
- java
- csharp
- go
- ruby
- CURL
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.
- curl
- SDK Node.js
- nodejs
- php
- python
- java
- csharp
- go
- ruby
- CURL
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
- The full flow (coupons, tiers, stores): Retail use case.
- Segment your members (Silver, Gold): customer types.
- Import your existing customers: CSV import or bulk operations.
- Bring the card up near your stores: locations.
- Get notified when a card is installed: webhooks.
- Ready to go live: environments.