API
Türkçe

API reference · Products

Update product images

Replaces the product's image list (up to 12) and, optionally, its variant images.

POST https://out.stockmount.com/api/Product/UpdateProductImages
Changes data Product package required

The product is identified by ProductId; if ProductId is less than 1, by Code + ProductSourceId. UpdateProductImages and UpdateProductImagesByCode run the same code and accept the same fields; they behave identically.

Each call updates a single product; you cannot send several products in one call.

The image list is replaced as a whole: existing images that are not in the request are removed, new ones are added, and the product's image slots 1–12 are rewritten in request order. Unused slots are cleared.

If any item after the first has neither Url nor Base64, the call fails with 99999.

Base64 images are uploaded to the StockMount image server and the stored URL starts with http://. If the upload fails, the image is stored with an empty URL and no error is returned.

This call does not check image format or protocol. Some marketplaces reject non-http(s) URLs or .webp images when a listing is sent (70016, 70015); those errors appear during marketplace submission, not in this call.

The response does not reflect whether variant images were saved: Result: true can be returned even if a variant image could not be stored.

This call does not queue a marketplace update. The images are marked as manually edited, so later imports from the product source (XML/feed) do not overwrite them.

The application enforces no separate request-size limit for this endpoint. Base64 images make the request large; prefer Url where you can.

Accounts without an active Product package get error 70018; if the package cannot be verified, 99999 is returned.

Request fields

Field Type Description
ApiCode required string The API code returned by User/DoLogin.
ProductId integer StockMount product ID. If less than 1, the product is looked up by Code + ProductSourceId.
Code string Product code. Required when ProductId is not sent.
ProductSourceId integer Product source ID (GetProductSources). Required when looking up by Code.
Images required object[] The product's new image list. At least one item is required and the first item must have Url or Base64. At most 12 images are used; the rest are ignored. Order is the array order; the first image is the main image. The Order field on items is not read.
Images[]. Url string Image URL, up to 512 characters. If it starts with //, http: is prepended. Format and protocol are not checked by this call.
Images[]. Base64 string Used when Url is empty. Raw Base64 image data without a data: prefix. PNG and JPEG are recognised; anything else is saved with a .png extension.
Variants object[] Optional variant images. A listed variant with no image gets its image cleared. Variants not in the list are not touched.
Variants[]. ProductVariantId integer Variant ID. If omitted or 0, the variant is matched by Code.
Variants[]. Code string Variant code. Used for matching when ProductVariantId is not set.
Variants[]. ImageUrl string Variant image URL, up to 512 characters. If it contains XML-special characters such as & or <, the variant image is not saved and no error is returned.
Variants[]. ImageBase64 string Used when ImageUrl is empty. Raw Base64 image data without a data: prefix.

Response fields (Response)

Field Type Description
Response integer Response is the ID of the updated product itself (a number).

Error codes for this endpoint

CodeWhen
00003 ProductId is less than 1 and Code is empty (ProductId is missing), Code is set but ProductSourceId is less than 1 (ProductSourceId is missing), or Images is empty or its first item is empty (Images is missing).
70005 No product was found for Code + ProductSourceId. The text is in Message, not ErrorMessage (Product could not be found).
70018 Your account has no active Product package.
99999 Images could not be saved (Operation failed!), an item after the first is empty, Base64 is invalid, or an unexpected server error occurred.

For session errors (00001, 00006) and every other code see error codes.

Related endpoints

Example request

{
  "ApiCode": "API_CODE",
  "ProductId": 184522,
  "Images": [
    {
      "Url": "https://cdn.example.com/p/184522-1.jpg"
    },
    {
      "Url": "https://cdn.example.com/p/184522-2.jpg"
    }
  ],
  "Variants": [
    {
      "Code": "TSHIRT-RED-M",
      "ImageUrl": "https://cdn.example.com/p/184522-red-m.jpg"
    }
  ]
}

Example response

{
  "Result": true,
  "Response": 184522
}

Try it

The request goes straight from your browser to out.stockmount.com. The ApiCode is not stored by this site; it is kept only while this tab is open.

Get an ApiCode before sending requests.

This endpoint changes real data in your account.

Use ↑ ↓ to move, Enter to open, Esc to close.

Connect to the Out API

DoLogin is called and the returned ApiCode is kept in this tab. Your API password is never sent to this site.