API
Türkçe

API reference · Products

Update a product

Rewrites an existing product's data, variants and specs with the values you send. It does not change images or the product code.

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

This is not a partial update; it rewrites the whole product. Required fields and 00003 messages are the same as in AddProduct (ProductSourceId, CurrencyId, Price > 0, Code, Name, Category). Optional fields you omit are cleared: Barcode, Brand, Model, Subtitle, Code2, Mpn, SellerNote and VariantName1–VariantName6 become empty; TaxRate, MarketPrice, Volume, Width, Length, Height, Weight become 0; DispatchPeriod becomes -1; Description becomes empty (unless you send UpdateProductDescription: false). Read the product with GetProduct first and send all fields back.

Some values managed only in the StockMount panel are also reset on every update: sold count (SoldCount), minimum sale price, product page URL, meta/SEO fields, invoice name and warranty data. Updated variants also get their sold count reset to 0.

Not changed: images (Images and variant image fields are ignored; use UpdateProductImages), Price2–Price5, and the product code (use SetProductCode).

The product is found by ProductId, and Code must be the product's current code in the source. If the code does not exist in the source, 70005 is returned (Message: There is no product with the given ProductId); if the code belongs to another product, 70004 is returned with Result: false (Message: Product code does not exist). With UpdateProductByCode: true, ProductId is not needed: the product is found by ProductSourceId + Code, and 70005 is returned if it does not exist. For these two errors the text is in Message, not ErrorMessage.

The status is recalculated from stock: Quantity below 1 gives 3 (stopped / out of stock), otherwise 2 (changed). So a product stopped with StopProduct becomes active again when you send stock above 0.

If you send Variants, they are matched by Code: matches are updated, new codes are added without an image, and existing variants missing from the list are made passive. Passive variants are not deleted and still appear in GetProduct. Empty or omitted Variants leaves variants untouched. If you send Specs, the whole spec list is replaced; if you omit it, stored specs are kept.

On success Response is the product's ProductId, and the product is queued for sync to the active stores where it is listed. This call never returns 70013 (not changed); the record is rewritten even if nothing changed. Category auto-creation, length limits and HTML cleaning work as in AddProduct.

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 Session code returned by DoLogin.
ProductId integer ID of the product to update. Required unless UpdateProductByCode is true; a value below 1 returns 00003 (ErrorMessage: ProductId is missing).
ProductSourceId required integer StockMount-type source that holds the product (GetProductSources). Returns 70002 if the source is not in your account and 70003 if it is not a StockMount-type source.
Code required string The product's current code in the source. It is used to verify the product; you cannot change the code with this call (use SetProductCode). Max 50 characters.
Name required string Product name. Max 400 characters.
Category required string Category name (not an ID). Created automatically if the source does not have it yet. See GetProductCategories for existing names.
Price required number Sale price. Must be greater than 0, otherwise 00003 (Price is missing) is returned. Stored with 2 decimals.
CurrencyId required integer Currency ID (GetCurrencies; e.g. 4 = TRY, 2 = USD, 3 = EUR). A value below 1 returns 00003. The API does not check that the ID exists, so send a valid one.
Quantity integer Stock quantity. Defaults to 0. Negative values are not rejected. For products with variants, send the total yourself; it is not calculated from variant stock. The status is recalculated from it (below 1 gives 3, otherwise 2).
MarketPrice number Market (list) price, usually higher than Price and used to show a discount. Defaults to 0. In UpdateProduct, omitting it resets the value to 0.
TaxRate number VAT rate as a percentage (e.g. 20). The API does not enforce a list of allowed values. Stored as 0 when omitted. In UpdateProduct, omitting it resets the value to 0.
Barcode string Product barcode. Max 30 characters. No format or special-character check is done. In UpdateProduct, omitting it clears the stored value.
Brand string Brand. Max 30 characters. In UpdateProduct, omitting it clears the stored value.
Model string Model. Max 30 characters. In UpdateProduct, omitting it clears the stored value.
Code2 string Secondary product code. Max 50 characters. In UpdateProduct, omitting it clears the stored value.
Mpn string Manufacturer part number (MPN). Max 50 characters. In UpdateProduct, omitting it clears the stored value.
Subtitle string Subtitle. Max 400 characters. In UpdateProduct, omitting it clears the stored value.
Description string Product description; may contain HTML. Unsafe HTML (e.g. scripts) is removed. Stored as empty when omitted. If UpdateProductDescription is false, the stored description is kept.
UpdateProductDescription boolean Send false to leave the description unchanged. Default true.
DispatchPeriod integer Dispatch (handling) time in days. Defaults to -1 (not set). In UpdateProduct, omitting it resets the value to -1.
Volume number Volume / volumetric weight (desi). Defaults to 0. In UpdateProduct, omitting it resets the value to 0.
Width number Width. Defaults to 0. In UpdateProduct, omitting it resets the value to 0.
Length number Length. Defaults to 0. In UpdateProduct, omitting it resets the value to 0.
Height number Height. Defaults to 0. In UpdateProduct, omitting it resets the value to 0.
Weight number Weight. Defaults to 0. In UpdateProduct, omitting it resets the value to 0.
SellerNote string Seller note. Max 150 characters. In UpdateProduct, omitting it clears the stored value.
VariantName1 string Name of variant attribute 1 (e.g. Color). Max 30 characters. Required when any variant has VariantValue1; otherwise 00003 (VariantName1 is missing) is returned. In UpdateProduct, omitting it clears the stored value.
VariantName2 string Name of variant attribute 2 (e.g. Size). Max 30 characters. Required when any variant has VariantValue2; otherwise 00003 (VariantName2 is missing) is returned. In UpdateProduct, omitting it clears the stored value.
VariantName3 string Name of variant attribute 3 (e.g. Size). Max 30 characters. Required when any variant has VariantValue3; otherwise 00003 (VariantName3 is missing) is returned. In UpdateProduct, omitting it clears the stored value.
VariantName4 string Name of variant attribute 4 (e.g. Size). Max 30 characters. Required when any variant has VariantValue4; otherwise 00003 (VariantName4 is missing) is returned. In UpdateProduct, omitting it clears the stored value.
VariantName5 string Name of variant attribute 5 (e.g. Size). Max 30 characters. Required when any variant has VariantValue5; otherwise 00003 (VariantName5 is missing) is returned. In UpdateProduct, omitting it clears the stored value.
VariantName6 string Name of variant attribute 6 (e.g. Size). Max 30 characters. Required when any variant has VariantValue6; otherwise 00003 (VariantName6 is missing) is returned. In UpdateProduct, omitting it clears the stored value.
Variants object[] Variant list. When sent, variants are matched by Code: matches are updated, new codes are added without an image, and existing variants missing from the list are made passive. Empty or omitted leaves variants untouched. Image fields (ImageUrl, ImageBase64) are ignored.
Variants[]. Code string Variant code. Updates match variants by this code, so send a non-empty value that is unique within the product. Max 50 characters.
Variants[]. Barcode string Variant barcode. Leading and trailing spaces are trimmed. Max 30 characters.
Variants[]. Quantity integer Variant stock. Negative values are stored as 0.
Variants[]. Price number Variant price. Stored as 0 when omitted.
Variants[]. VariantValue1 string Value of variant attribute 1 (e.g. Black). Max 100 characters.
Variants[]. VariantValue2 string Value of variant attribute 2 (e.g. M). Max 100 characters.
Variants[]. VariantValue3 string Value of variant attribute 3 (e.g. M). Max 100 characters.
Variants[]. VariantValue4 string Value of variant attribute 4 (e.g. M). Max 100 characters.
Variants[]. VariantValue5 string Value of variant attribute 5 (e.g. M). Max 100 characters.
Variants[]. VariantValue6 string Value of variant attribute 6 (e.g. M). Max 100 characters.
Variants[]. Code2 string Secondary variant code. Max 50 characters. If empty, the variant's position in the array (0, 1, 2…) is stored.
Variants[]. Mpn string Variant manufacturer part number. Max 50 characters.
Specs object[] Product specs. When sent, the whole stored spec list is replaced; when omitted, stored specs are kept.
Specs[]. Name string Spec name (e.g. Material). Max 50 characters.
Specs[]. Value string Spec value (e.g. Cotton). Max 100 characters.
UpdateProductByCode boolean When true, ProductId is not needed; the product is found by ProductSourceId + Code. Returns 70005 if not found. Default false.

Response fields (Response)

Field Type Description
Response integer The updated product's ProductId.

Error codes for this endpoint

CodeWhen
70002 ProductSourceId is not a source in your account.
70003 The source is not a StockMount-type source.
70004 Code belongs to another product in the source (Result: false, Message: Product code does not exist).
70005 Code does not exist in the source (e.g. you tried to change the code) or no product was found with UpdateProductByCode (Message: There is no product with the given ProductId).
70018 Your account has no active Product package (ErrorMessage is Turkish: Ürün entegrasyonu için aktif Ürün Paketi gereklidir.).
99999 An unexpected error occurred. Also returned when the product record cannot be updated.

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

Related endpoints

Example request

{
  "ApiCode": "API_CODE",
  "ProductId": 987654,
  "ProductSourceId": 1234,
  "Code": "TSHIRT-001",
  "Name": "Basic Pamuklu Tişört",
  "Category": "Tişört",
  "Price": 229.9,
  "MarketPrice": 299.9,
  "CurrencyId": 4,
  "TaxRate": 20,
  "Quantity": 25,
  "Barcode": "8690000000017",
  "Brand": "Örnek Marka",
  "Model": "BSC-01",
  "Description": "<p>%100 pamuk, regular fit.</p>",
  "DispatchPeriod": 2,
  "Volume": 1,
  "VariantName1": "Renk",
  "VariantName2": "Beden",
  "Variants": [
    {
      "Code": "TSHIRT-001-BLK-M",
      "Barcode": "8690000000024",
      "Quantity": 5,
      "Price": 229.9,
      "VariantValue1": "Siyah",
      "VariantValue2": "M"
    },
    {
      "Code": "TSHIRT-001-BLK-L",
      "Barcode": "8690000000031",
      "Quantity": 20,
      "Price": 229.9,
      "VariantValue1": "Siyah",
      "VariantValue2": "L"
    }
  ],
  "Specs": [
    {
      "Name": "Materyal",
      "Value": "Pamuk"
    }
  ]
}

Example response

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

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.