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 by | Stock | Price | Stock + price |
|---|---|---|---|
Product code + ProductSourceId recommended |
Update |
Update |
Update |
StockMount ProductId |
Update |
Update |
Update |
| Product code + variant barcode | Update |
— | — |
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 Get.
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
- Send every price you use, every time. The price endpoints write all of
Price,MarketPriceandPrice2–Price5; a price you leave out becomes0. The same applies to variant prices. - For products with variants, send
SetProductQuantityFromVariants: true. If you only send variant stock without it, the product's own stock becomes0. Withtrue, product stock is the sum of its variants. - 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.
- 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.
- Do not send
CurrencyIdto stock endpoints. Some stock endpoints read it and change the product's currency. UpdateProductQuantityByBarcodealso writes the extra prices. It overwritesPrice2–Price5with 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;Responseholds the product'sProductIdand the updated variants. - If the product is not found you get
Result: false,ErrorCode: "70005"andErrorMessage: "ProductNotFound". - Items in
Variantsthat 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
Resulton 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.