API reference · Products
Upload a product source file
Uploads the product content you send (e.g. XML) as a file to your product source address on StockMount.
https://out.stockmount.com/api/Integration/SetProductSourceProducts
Requires an active Product package; otherwise 70018 is returned.
The path of ProductSourceUrl must be /{userId}/out/{fileName}, where {userId} is your StockMount user ID left-padded with zeros to 8 digits (e.g. 00012345). The host name is not checked. A mismatch returns 60501.
ProductsText is written as UTF-8 to the /{userId}/out/ folder, using the file name from the URL. The content is not validated. On success Response is empty.
Error messages are inconsistent: a bad URL also returns ErrorMessage ProductsText. Rely on the code (60501).
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 |
API code returned by DoLogin.
|
ProductSourceUrl
required
|
string |
Address of the product source file; path /{8-digit userId}/out/{fileName}.
|
ProductsText
required
|
string | Full file content (e.g. XML text). |
Response fields (Response)
On success the Response field is empty; read the outcome from Result.
Error codes for this endpoint
| Code | When |
|---|---|
60501 |
ProductSourceUrl path does not match your folder (/{userId}/out/…), or the user folder could not be created. |
60502 |
The out folder could not be created. |
60503 |
The file could not be uploaded. |
70018 |
No active Product package. |
99999 |
Unexpected error. |
For session errors (00001, 00006) and every other code see error codes.
Example request
{
"ApiCode": "API_CODE",
"ProductSourceUrl": "https://files.example.com/00012345/out/products.xml",
"ProductsText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Products><Product><Code>KUPA-350</Code><Name>Seramik Kupa 350 ml</Name><Price>129.90</Price><Quantity>40</Quantity></Product></Products>"
}
curl -X POST 'https://out.stockmount.com/api/Integration/SetProductSourceProducts' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"ProductSourceUrl": "https://files.example.com/00012345/out/products.xml",
"ProductsText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Products><Product><Code>KUPA-350</Code><Name>Seramik Kupa 350 ml</Name><Price>129.90</Price><Quantity>40</Quantity></Product></Products>"
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"ProductSourceUrl": "https://files.example.com/00012345/out/products.xml",
"ProductsText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Products><Product><Code>KUPA-350</Code><Name>Seramik Kupa 350 ml</Name><Price>129.90</Price><Quantity>40</Quantity></Product></Products>"
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/SetProductSourceProducts",
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",
"ProductSourceUrl": "https://files.example.com/00012345/out/products.xml",
"ProductsText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Products><Product><Code>KUPA-350</Code><Name>Seramik Kupa 350 ml</Name><Price>129.90</Price><Quantity>40</Quantity></Product></Products>"
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/SetProductSourceProducts');
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",
"ProductSourceUrl": "https://files.example.com/00012345/out/products.xml",
"ProductsText": "\u003C?xml version=\u00221.0\u0022 encoding=\u0022UTF-8\u0022?\u003E\u003CProducts\u003E\u003CProduct\u003E\u003CCode\u003EKUPA-350\u003C/Code\u003E\u003CName\u003ESeramik Kupa 350 ml\u003C/Name\u003E\u003CPrice\u003E129.90\u003C/Price\u003E\u003CQuantity\u003E40\u003C/Quantity\u003E\u003C/Product\u003E\u003C/Products\u003E"
}
response = requests.post("https://out.stockmount.com/api/Integration/SetProductSourceProducts", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"ProductSourceUrl": "https://files.example.com/00012345/out/products.xml",
"ProductsText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Products><Product><Code>KUPA-350</Code><Name>Seramik Kupa 350 ml</Name><Price>129.90</Price><Quantity>40</Quantity></Product></Products>"
};
const response = await fetch("https://out.stockmount.com/api/Integration/SetProductSourceProducts", {
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
}
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.