Send product images as Base64 for WooCommerce

The Tinx Media API plugin extends the default WooCommerce API product endpoint so you can upload product images as base64-encoded data instead of image URLs.

This is useful when:

  • Images aren't publicly accessible via a URL.
  • Images are generated dynamically.
  • You want to avoid external dependencies during product creation.

To install the Tinx Media API plugin in WordPress

Install the Tinx Media API plugin. To have access to the extension, contact the Tinx Support Team. You will receive a zip file that you upload as a plugin in WordPress.

  1. In your WordPress backend, select Plugins, and then select Add New Plugin.

  2. Select Upload Plugin.

  3. Select Choose File, and then select the file you received from the Tinx support team.

  4. Select Install Now.

    Uploading the plugin file in WordPress.
  5. Activate the plugin.

    Activating the plugin in WordPress.

Image handling modes

With each API request, you can control how images are processed using the image_mode parameter.

The following table describes the available options.

Option Description
replace All existing product images are removed and replaced with the images provided in the request. This is the default behavior, if the image_mode parameter isn't included in the request.
append The provided images are added to the existing product images, without removing the current ones.

Featured image

You can define the main (featured) image of the product using the is_featured property.

  • Set "is_featured": true on an image to mark it as the featured image.
  • If multiple images are marked as featured, the last one in the list is used as the product's featured image.

Example request

{
  "name": "Test Product with Encoded Images",
  "type": "simple",
  "regular_price": "29.99",
  "description": "Product created with base64 encoded images",
  "short_description": "Test product",
  "encoded_images": [
    {
      "data": "{{sample_base64_image}}",
      "filename": "product-main.png",
      "alt_text": "Product main image",
      "caption": "Main product photo",
      "description": "Primary product image",
      "is_featured": true
    },
    {
      "data": "{{sample_base64_image}}",
      "filename": "product-gallery-1.png",
      "alt_text": "Gallery image 1"
    },
    {
      "data": "{{sample_base64_image}}",
      "filename": "product-gallery-2.png",
      "alt_text": "Gallery image 2"
    }
  ],
  "image_mode": "replace"
}

Notes

  • Each image must include a valid base64 string in the data field.
  • The filename field is required to correctly store the image.
  • Additional fields such as alt_text, caption, and description are optional but recommended for SEO and accessibility.
  • The first image isn't automatically the featured image; you must explicitly define it using is_featured.

Related information

Synchronize images
Connect Business Central with WooCommerce
WooCommerce legacy mapping
Key concepts in Tinx Connector
Troubleshooting checklist


Questions or comments

If you have any questions or comments about this article or need further help, contact Support or write directly to us at docs@tinx-it.nl.


Last updated on April 17, 2026