Optimize images used in your TikTok Shop by changing the background to white. This is especially useful for images displayed in the product image gallery as it enhances product visibility. Note:
- The images to be optimized must first be uploaded to TikTok Shop through the Upload Product Image API. You will not be able to optimize any images that are not hosted by TikTok Shop.
- Images that were previously optimized will not be processed again.
- The optimization is processed asynchronously and typically completes within a few seconds. If no stored optimization result exists,
optimize_statusisPROCESSING, indicating that optimization is underway. If a stored final result already exists, the API may return it immediately. Whenoptimize_statusisPROCESSING, call the API again after a few seconds to get the final optimization status.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Identifies the shop. Obtain it from the Get Authorized Shops API.
Request Body
Section titled “Request Body”object
The list of images to be optimized. Use the Upload Product Image API to upload the images first and obtain the corresponding image URIs. Max count: 200
object
The URI of the image. Retrieve the URI from the Upload Product Image API.
The optimization type. Possible values:
- WHITE_BACKGROUND: Change the background to white.
Example
{ "images": [ { "uri": "tos-maliva-i-o3syd03w52-us/53b55d6e8cdf1f315affa7e70b45707d", "optimization_mode": [ "WHITE_BACKGROUND" ] } ]}Responses
Section titled “Responses”Success
object
Status code; 0 means success.
Success or failure message.
Request log ID.
object
The list of images to be optimized.
object
The height of the original image, in pixels.
The width of the original image, in pixels.
The original URI of the image to be optimized.
The original URL of the image to be optimized.
The URI of the image after optimization. Pass this value when creating or editing a product to associate the image with the product.
Applicable only if optimize_statusis SUCCESS.
The URL of the image after optimization.
Use this URL in product descriptions by embedding it within an HTML <img> tag.
Applicable only if optimize_statusis SUCCESS.
The optimization status. Possible values:
- SUCCESS: The image has been successfully optimized.
- IGNORE: The image already has a white background, so no optimization was applied.
- PROCESSING: The optimization is in progress, and typically completes within a few seconds. Call this API again to obtain the final optimization status.
Example
{ "code": 0, "data": { "images": [ { "height": 600, "width": 600, "original_uri": "tos-maliva-i-o3syd03w52-us/53b55d6e8cdf1f315affa7e70b45707d", "original_url": "https://p16-graph-va.ibyteimg.com/tos-maliva-i-1por3rr4fy-us/v2/53b55d6e8cdf1f315affa7e70b45707d~tplv-1por3rr4fy-image.webp", "optimized_uri": "tos-maliva-i-o3syd03w52-us/0266127022264e54ad2f639f5e0fb5e6", "optimized_url": "https://p16-graph-va.ibyteimg.com/tos-maliva-i-1por3rr4fy-us/v2/0266127022264e54ad2f639f5e0fb5e6~tplv-1por3rr4fy-image.webp", "optimize_status": "SUCCESS" } ] }, "message": "Success", "request_id": "202203070749000101890810281E8C70B7"}