Create Product Image

Creates a *Product Image*. **Required Fields** - `image_file`, or - `image_url` **Usage Notes** - `image_url` - `255` character limit - `Content-Type` - For `image_file`, use the `multipart/form-data` media type. For `image_url`, use the `application/json` type. See [Adding product images](/developer/docs/admin/catalog-and-inventory#adding-product-images) for more information. - You can create only one image at a time. A product can have up to 1000 images. - Supported image file types are BMP, GIF, JPEG, PNG, WBMP, XBM, and WEBP. - Each image file or image uploaded by URL can be up to 8 MB.

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Products | modify | `store_v2_products` | | Products | read-only | `store_v2_products_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

product_idstringRequired

Request

This endpoint expects an object.
date_modifieddatetimeOptional
The date on which the product image was modified.
descriptionstringOptional
The description for the image.
image_urlstringOptional<=255 characters

The URL for an image displayed on the storefront when the conditions are applied. Limit of 8MB per file.

Cannot be used with image_file.

is_thumbnailbooleanOptional

Flag for identifying whether the image is used as the productʼs thumbnail.

product_idintegerOptional
The unique numeric identifier for the product with which the image is associated.
sort_orderintegerOptional-2147483648-2147483647

The order in which the image will be displayed on the product page. Higher integers give the image a lower priority. When updating, if the image is given a lower priority, all images with a sort_order the same as or greater than the imageʼs new sort_order value will have their sort_orders reordered.

Response

Success
dataobject
metaobject
Response metadata.

Errors

400
Bad Request Error
404
Not Found Error
422
Unprocessable Entity Error