Skip to main content

Images and multipart/form-data

Endpoints that accept an image (creating a coupon, event, transit, hotel or communication template, updating the wallet…) expect a multipart/form-data body. Each endpoint's reference page states the expected type.

A file can't travel inside JSON

Sending {"strip": "<PNG file>"} as application/json doesn't work. Use multipart/form-data, and let your HTTP client generate the Content-Type header (it contains the boundary).

The three multipart rules​

  1. Files are file fields: -F "strip=@strip.png;type=image/png".
  2. Objects and arrays (colors, security, locations, displayOptions, iosHeader, date…) are sent as JSON strings: -F 'colors={"backgroundColor":"#131313","labelColor":"#9EE00D","foregroundColor":"#FFFFFF"}'
  3. Booleans are sent as the text "true" or "false". Any other value counts as false.
Excerpt: a file and JSON objects in a coupon template
POST/couponsTry it
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 'colors="{\"backgroundColor\":\"\#59358B\",\"labelColor\":\"\#F2FBCE\",\"foregroundColor\":\"\#FFFFFF\"}"' \
-F 'security="{\"enableOneTimeUse\":true}"'

File constraints​

Image formatsPNG or JPEG
Image size1 KB to 5 MB
CSV importtext/csv, 10 MB and 100,000 rows maximum
Per request10 files and 50 MB per file maximum

An image outside these limits returns 400:VALIDATION_ERROR. A malformed multipart body returns 400:INVALID_MULTIPART, and an unsupported Content-Type returns 415:UNSUPPORTED_MEDIA_TYPE.

Updates​

Most PATCH endpoints accept multipart or JSON. Use JSON when you aren't changing an image: it's simpler.

For recommended pass image dimensions, see the knowledge base.

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