API
Türkçe

Guides

Stock and price sync

When stock or price changes in your own system, send it to StockMount. StockMount passes the change on to the product's active marketplace listings.

Which endpoint should I use?

Pick the endpoint by how you identify the product. Product endpoints need an active Product package; without one they return 70018.

I identify the product byStockPriceStock + price
Product code + ProductSourceId recommended UpdateProductQuantityByCode UpdateProductPriceByCode UpdateProductQuantityAndPriceByCode
StockMount ProductId UpdateProductQuantity UpdateProductPrice UpdateProductQuantityAndPrice
Product code + variant barcode UpdateProductQuantityByBarcode — —

The product code is the stock code in your ERP and is unique within a product source. Get your product sources and their IDs with GetProductSources.

Example: update stock and price by product code

A request that updates the stock and price of two sizes of a product with variants in one call:

{
  "ApiCode": "API_CODE",
  "Code": "TSHIRT-RED",
  "ProductSourceId": 3051,
  "SetProductQuantityFromVariants": true,
  "Price": 349.90,
  "MarketPrice": 449.90,
  "Variants": [
    { "Code": "TSHIRT-RED-M", "Quantity": 15, "Price": 349.90 },
    { "Code": "TSHIRT-RED-L", "Quantity": 0, "Price": 359.90 }
  ]
}

Rules to know

  1. Send every price you use, every time. The price endpoints write all of Price, MarketPrice and Price2–Price5; a price you leave out becomes 0. The same applies to variant prices.
  2. For products with variants, send SetProductQuantityFromVariants: true. If you only send variant stock without it, the product's own stock becomes 0. With true, product stock is the sum of its variants.
  3. The quantity you send becomes the new sellable stock. StockMount resets the sales it had deducted so far. A product whose stock drops below 1 is closed for sale.
  4. Validate values yourself. The API does not reject zero or negative prices, negative stock, or a market price below the sale price. Such values fail later, when they are sent to the marketplace.
  5. Do not send CurrencyId to stock endpoints. Some stock endpoints read it and change the product's currency.
  6. UpdateProductQuantityByBarcode also writes the extra prices. It overwrites Price2–Price5 with the request values. If you use those prices, send their current values too.

When does the marketplace see it?

The response means the value was written to the product in StockMount. If stock or price actually changed, an update is queued for the product's active listings and background jobs update the marketplaces. If an update for the same product is already waiting, no new one is added; the latest value is sent.

Checking the response

  • On success you get Result: true; Response holds the product's ProductId and the updated variants.
  • If the product is not found you get Result: false, ErrorCode: "70005" and ErrorMessage: "ProductNotFound".
  • Items in Variants that do not match are skipped without an error. Check the list in the response to see which variants were updated.

Tips

  • Send only the products that changed. Resending the whole catalogue on a schedule fills the marketplace queues for nothing.
  • Each call updates one product. For bulk updates, send requests one after another or with low parallelism, and check Result on every response.
  • Before going live, try a new integration with a few test products and check the result in the panel and on the marketplace.

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.