API reference · Products
Update product name (by product code)
Changes the name of the product found by Code and ProductSourceId.
https://out.stockmount.com/api/Product/UpdateProductNameByCode
Each call updates a single product; you cannot send several products in one call.
The product is identified by Code + ProductSourceId; any ProductId you send is ignored. If Code is empty, ErrorMessage says ProductId; this means the code is missing.
Only the product's main name (Name) changes. Stock, prices and variants are not changed; other fields are ignored. The one exception is CurrencyId: if you send a value greater than 0, the product currency changes too. Do not send it.
If the name actually changed, a product update is queued for each active marketplace listing of the product. Marketplaces are updated by background jobs, not during this call.
If the product is not found or does not belong to your account, the response is Result: false with ErrorCode: "70005" and ErrorMessage: "ProductNotFound". Database errors return ErrorCode 99999.
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.
|
Code
required
|
string |
Product code (SKU), up to 50 characters. The product is looked up by Code together with ProductSourceId. ProductId is ignored by this endpoint.
|
ProductSourceId
required
|
integer |
ID of the product source the product belongs to (GetProductSources). Code is looked up within this source.
|
Name
required
|
string | New product name. Must not be empty. Values longer than 400 characters are truncated. |
Response fields (Response)
| Field | Type | Description |
|---|---|---|
ProductId
|
integer | ID of the updated product. |
Variants
|
object[] | Variants updated by this call. Empty array if you sent no variants. |
Variants[].
Code
|
string | Variant code. |
Variants[].
ProductVariantId
|
integer | Variant ID. |
Error codes for this endpoint
| Code | When |
|---|---|
70005 |
The product was not found or does not belong to your account (ErrorMessage: ProductNotFound). |
00003 |
Code is empty (ErrorMessage: "ProductId") or ProductSourceId is less than 1 (ErrorMessage: "ProductSourceId"). Name is empty (ErrorMessage: "Name"). |
70018 |
Your account has no active Product package. |
99999 |
An unexpected server error occurred. |
For session errors (00001, 00006) and every other code see error codes.
Related endpoints
Example request
{
"ApiCode": "API_CODE",
"Code": "TSHIRT-RED",
"ProductSourceId": 3051,
"Name": "Pamuklu Basic T-Shirt Kırmızı"
}
curl -X POST 'https://out.stockmount.com/api/Product/UpdateProductNameByCode' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"Code": "TSHIRT-RED",
"ProductSourceId": 3051,
"Name": "Pamuklu Basic T-Shirt Kırmızı"
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"Code": "TSHIRT-RED",
"ProductSourceId": 3051,
"Name": "Pamuklu Basic T-Shirt Kırmızı"
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Product/UpdateProductNameByCode",
new StringContent(json, Encoding.UTF8, "application/json"));
var result = await response.Content.ReadAsStringAsync();
// Result == false ise ErrorCode ve ErrorMessage alanlarına bakın.
Console.WriteLine(result);
<?php
$body = <<<'JSON'
{
"ApiCode": "API_CODE",
"Code": "TSHIRT-RED",
"ProductSourceId": 3051,
"Name": "Pamuklu Basic T-Shirt Kırmızı"
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Product/UpdateProductNameByCode');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$result['Result']) {
echo $result['ErrorCode'] . ' ' . $result['ErrorMessage'];
}
import requests
payload = {
"ApiCode": "API_CODE",
"Code": "TSHIRT-RED",
"ProductSourceId": 3051,
"Name": "Pamuklu Basic T-Shirt K\u0131rm\u0131z\u0131"
}
response = requests.post("https://out.stockmount.com/api/Product/UpdateProductNameByCode", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"Code": "TSHIRT-RED",
"ProductSourceId": 3051,
"Name": "Pamuklu Basic T-Shirt Kırmızı"
};
const response = await fetch("https://out.stockmount.com/api/Product/UpdateProductNameByCode", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const result = await response.json();
if (!result.Result) {
console.error(result.ErrorCode, result.ErrorMessage);
}
Example response
{
"Result": true,
"Response": {
"ProductId": 184522,
"Variants": []
}
}
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.
Recent requests
Requests sent from this tab; click one to load its body again.