Custom-sections of type IMAGE represent a way to add custom images to the digital receipt. Images are scaled to the width of the receipt. In addition, image description and text can be added via the field label. The following image types are allowed: PNG, JPEG, JPG, WEBP, GIF.
How to upload and re-use images in custom-sections:
- Upload an image via the UploadMedia API endpoint.
- Save the id and the media_location obtained in UploadMedia response.
- Create a custom-section with type IMAGE, either by adding it in the custom_elements array during receipt creation, or by configuring a default custom-section.
- Create the custom-section by passing the content of type CustomMediaContent. For the fields media_id and media_location pass the previously saved values from step 2.
- Optionally, specify a label and its corresponding alignment, label_alignment. The label will be shown in addition to the image on the receipt.
- Optionally, specify an alt_text, which is shown in case the image cannot be shown.
For more information about custom-sections have a look at this article.
Popular use-cases
- Recommending items the customer might also like [Sample]