WalletPassAPI Docs

API reference · Images

Upload an image

POST/v1/assetsFreeSafe to retry with Idempotency-Key

Stores an image for a pass, resized for every screen. Put its reference in the pass's image field.

Query

typeone of: icon, logo, strip, background, thumbnail, wideLogo, googleHerorequired

Which image it is: it sets the size. logo goes in logoURL, strip in stripURL, and so on.

Body

The image's bytes, PNG or JPEG, up to 2 MB, with its Content-Type. Or JSON, { "url": "https://…" }, and we fetch it. It's resized to its type's shape, so crop it to that first: icon 87 × 87, logo 660 × 660, strip 1125 × 369, background 1074 × 1344, thumbnail 270 × 270, wideLogo 1280 × 400, googleHero 1032 × 812 pixels.

Answer

201Stored

width and height are its size in points; it's stored at 1, 2 and 3 times that.

Errors

Every error has the same shape: see Errors.

StatusCodeWhen
400validation_errortype isn't one of these.
400invalid_assetNo image, or the URL isn't HTTPS, isn't public or redirects too often.
409idempotency_conflictThe Idempotency-Key was already used for a different request.
413asset_too_largeOver 2 MB.
422invalid_assetIt isn't an image we can read.
  • Then: "logoURL": "asset:asset_k3m9q2w7x4n8p1r6" in the pass or template.
  • An image no pass or template uses is deleted after 36 hours, so use it soon after uploading it. One that's in use stays while it is.