Offer Images

This article is a guide to item-level images. For information about storefront-level images, e.g. your game logo, see here.

Neon provides image hosting for all of your Item and Offer images. You can upload images to Neon either via the dashboard or via the Assets API. Each image must have a unique file name. When you create or update Items and Offers, you'll use the file names you created on upload to link your images to your offers. In this doc, we'll discuss how to create and manage assets via the API.

Before beginning, you'll need to have an active API key for the environment you want to manage. Assets are linked to a particular environment, so you can reuse file names between different environments. This also means that your sandbox images won't be usable in production mode, so make sure to upload images once per environment you plan to use them in.

To upload an image, call the POST /assets/inventory-images endpoint:

curl --request POST \
     --url https://api.neonpay.com/assets/inventory-images \
     --header 'accept: application/json' \
     --header 'content-type: multipart/form-data'
     --header 'x-api-key: <<API KEY>>' \
     --form "file=@/path/to/your/file.png"
     --form "fileName=custom-name.png"
     
HTTP/1.1 201 Created
{
  "id": "<image ID>",
  "url": "<full image URL">,
  "fileName": "custom-name.png",
  ...
}

The ID returned in the response is the ID you'll use for API operations using the Assets API. However, when attaching images to items or offers via API, you'll reference the image file name instead.

To delete the image, call the DELETE /assets/inventory-images/{imageId} endpoint:

curl --request DELETE \
     --url https://api.neonpay.com/assets/inventory-images/<image ID> \
     --header 'accept: application/json' \
     --header 'content-type: multipart/form-data'
     --header 'x-api-key: <<API KEY>>'
     
HTTP/1.1 204 No Content

Once an image is deleted, it cannot be used for any current or future items or offers.