Common API errors
The full list of codes is in the error reference. Here are the cases that come up most, and how to fix them.
Every error has the same shape: a readable message (in the language of the x-lang header), an errorCode formatted STATUS:CODE (e.g. 404:MODEL_NOT_FOUND), the path called and the date.
Number one: JSON sent to a multipart endpoint
Creates and updates that accept an image expect multipart/form-data:
| Endpoint | Content-Type |
|---|---|
POST/coupons, POST/events, POST/transits, POST/hotels | multipart/form-data |
PATCH/store-cards, PATCH/wallets, PATCH/clients/{id}/specific | multipart/form-data |
POST/communications, POST/csv-operations/import-csv | multipart/form-data |
| Customers, passes, notifications, trips | application/json |
Related errors: INVALID_MULTIPART (missing or malformed boundary), UNSUPPORTED_MEDIA_TYPE (415), FILE_REQUIRED (required image missing).
Three multipart rules:
- Let the tool write the header. With
curl -For a JavaScriptFormData, theContent-Typeand itsboundaryare added for you. A hand-written header without a boundary breaks the request. - Nested objects as JSON strings.
colors,security,locations,displayOptions,iosHeader,date: one form field holding JSON. - Booleans as text:
"true"/"false". Images PNG or JPEG, 1 KB to 5 MB.
- curl
- SDK Node.js
- nodejs
- php
- python
- java
- csharp
- go
- ruby
- CURL
curl -L 'https://api-v2.test.eldowallet.fr/coupons' \
-H 'Accept: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>' \
-F 'strip=@"strip.png"' \
-F 'name="Welcome"' \
-F 'description="10% off your next purchase"' \
-F 'barcodeFormat="QR_CODE"' \
-F 'isWelcomeCoupon="true"' \
-F 'colors="{\"backgroundColor\":\"\#59358B\",\"foregroundColor\":\"\#FFFFFF\",\"labelColor\":\"\#F2FBCE\"}"'
401: not authenticated
Authorization: Bearer $ELDO_TOKENheader missing or malformed:UNAUTHORIZED.- Token expired: log in again (POST
/auth/login), or use a wallet token for server integrations (POST/wallets/tokens). See Authentication.
403: forbidden
You are authenticated, but the resource is not yours (template or customer from another wallet), or your role is not enough: FORBIDDEN.
A customer from another wallet returns CLIENT_DOES_NOT_BELONG_TO_THIS_WALLET.
404: not found
MODEL_NOT_FOUND: unknown id. Ids are ObjectIds: 24 hexadecimal characters.PATH_NOT_FOUND: unknown URL. Check the base URL (https://api-v2.test.eldowallet.frin test, see Environments) and the path.PASS_NOT_FOUND: the scanned barcode matches no pass on that template.STORECARD_NOT_FOUND: the wallet’s loyalty card is not configured yet (PATCH/store-cards).
409: conflict
EMAIL_ALREADY_EXISTS,CLIENT_ALREADY_EXISTS: this customer already exists in the wallet. Update instead of recreating.BARCODE_ALREADY_EXISTS: this barcode is already taken.OVERLAPPING_DATES: the hotel room is already booked on those dates.PUSH_NOTIFICATION_SCHEDULE_CONFLICT: a notification is already scheduled too close to that time.STORE_CARD_ALREADY_EXISTS: a wallet has only one loyalty card. Edit it with PATCH/store-cards.
400: bad request
VALIDATION_ERROR,MISSING_REQUIRED_FIELDS: required field missing or value not in the list. The details name the fields.UNEXPECTED_FIELD: an unknown field was sent. Check spelling, e.g.barcodeFormat(coupon, transit) vsbarcodeType(event, loyalty card).INVALID_JSON: malformed JSON body.PASS_ALREADY_REDEEMED: second POST/passes/template/{templateId}/redeem/{barcode}on the same pass. If the first scan was a mistake, cancel with POST/passes/template/{templateId}/unredeem/{barcode}.PASS_NOT_REDEEMED: POST/passes/template/{templateId}/unredeem/{barcode}on a pass never redeemed.SYNC_EXECUTION_NOT_ALLOWED:forceSync: trueon a bulk operation of 1,000 items or more.
5xx: server or external service error
500(UNKNOWN_ERROR): retry. If it persists, contact support with thepath, thedateand the body sent.502: the SMS provider failed (SMS_SEND_FAILED…). Try again later.503(PASS_BUILDER_ERROR): the pass generation service is down. Try again later.