API reference · Orders
Create or update an order
Adds an external order to a StockMount-type store, or updates an existing one.
https://out.stockmount.com/api/Integration/SetOrder
Works only for StockMount-type stores (IntegrationId = 9999). You cannot write orders into marketplace stores (Trendyol, Hepsiburada, etc.); that returns 10001 / Store has to be StockMount store!.
With Order.OrderId 0 or missing a new order is created. If the store already has an order with the same IntegrationOrderCode, nothing is added and an error is returned. With Order.OrderId set, that order is updated; if it is not in the store you get 50006.
On update all lines of the order are deleted and the lines in the request are inserted again, so line OrderDetailId values change. An update does not change CompanyTitle, Nickname or IntegrationOrderCode. Everything runs in one database transaction; on error nothing is kept.
Defaults: if OrderDate is missing or before 2000, the server time (Turkey) is used. Empty Name falls back to Fullname. If a line has no Address, the order's address, city, district, postal code, phone and delivery name (title or full name) are copied. An empty line OrderStatus takes the order status. CargoPayment values other than Seller, Buyer or Unknown become Unknown.
Send dates in Turkey time without an offset (see GetSales). Price and Quantity are stored with 2 decimal places.
On success Response holds the saved order in GetOrder format. Order.Email and the line fields InvoiceNumber, InvoiceTime, PackageNumber, PackageTime, WayBillNumber, WayBillTime and VariantProductCode are not saved; use SetOrderDetailInvoiced for invoice data.
Validation errors use 00003 and ErrorMessage names the field: OrderDetails, StoreId, IntegrationOrderCode, Nickname, OrderStatus, CompanyTitle/Fullname, Address, OrderDetail.IntegrationProductCode, OrderDetail.ProductName, OrderDetail.Quantity.
Request fields
| Field | Type | Description |
|---|---|---|
ApiCode
required
|
string |
API code returned by DoLogin.
|
StoreId
required
|
integer | ID of a StockMount-type store. |
Order
required
|
object | The order. |
Order.
OrderId
|
integer | ID of the order to update. Use 0 or omit for a new order. |
Order.
IntegrationOrderCode
required
|
string | Your order number. Must be unique within the store. Max 50 characters. |
Order.
OrderStatus
required
|
string |
Order status (case-insensitive).
|
Order.
Nickname
required
|
string | Buyer user name / customer code. Max 100 characters. |
Order.
Fullname
|
string |
Buyer full name. Required if CompanyTitle is empty.
|
Order.
CompanyTitle
|
string |
Company title. Required if Fullname is empty. Not changed on update.
|
Order.
Address
required
|
string | Address. Max 500 characters. |
Order.
OrderDate
|
datetime | Order date, Turkey time without offset. Default: now. |
Order.
Name
|
string |
Buyer first name. Falls back to Fullname.
|
Order.
Surname
|
string | Buyer last name. |
Order.
City
|
string | City. |
Order.
District
|
string | District. |
Order.
PostalCode
|
string | Postal code. Max 10 characters. |
Order.
Telephone
|
string | Phone. |
Order.
PersonalIdentification
|
string | National ID number. |
Order.
TaxAuthority
|
string | Tax office. |
Order.
TaxNumber
|
string | Tax number. |
Order.
Notes
|
string | Order note. |
Order.
OrderDetails
required
|
object[] | Order lines; at least one. |
Order.OrderDetails[].
IntegrationProductCode
required
|
string | Product code. Max 50 characters. |
Order.OrderDetails[].
ProductName
required
|
string | Product name. Max 200 characters. |
Order.OrderDetails[].
Quantity
required
|
integer | Quantity; at least 1. |
Order.OrderDetails[].
Price
|
number | Unit price. |
Order.OrderDetails[].
TaxRate
|
number |
VAT rate (e.g. 20).
|
Order.OrderDetails[].
IntegrationOrderDetailId
|
string | Line ID in your system. |
Order.OrderDetails[].
ProductId
|
integer | StockMount product ID to link. Default 0 (no match). |
Order.OrderDetails[].
ProductVariantId
|
integer | StockMount variant ID to link. |
Order.OrderDetails[].
MerchantSku
|
string | Merchant SKU. |
Order.OrderDetails[].
ProductImage
|
string | Product image URL. |
Order.OrderDetails[].
OrderStatus
|
string | Line status. Falls back to the order status. Not validated. |
Order.OrderDetails[].
DetailType
|
integer |
Line type. Default 0.
|
Order.OrderDetails[].
Invoiced
|
boolean | Invoiced flag. Default false. |
Order.OrderDetails[].
DeliveryTitle
|
string | Delivery name or title. |
Order.OrderDetails[].
Address
|
string | Delivery address. When empty the order's address and contact fields are copied. |
Order.OrderDetails[].
City
|
string | Delivery city. |
Order.OrderDetails[].
District
|
string | Delivery district. |
Order.OrderDetails[].
PostalCode
|
string | Delivery postal code. |
Order.OrderDetails[].
Telephone
|
string | Delivery phone. |
Order.OrderDetails[].
CargoCompany
|
string | Shipping company. |
Order.OrderDetails[].
CargoLabelCode
|
string | Tracking code. |
Order.OrderDetails[].
CargoPayment
|
string |
Who pays for shipping.
|
Order.OrderDetails[].
CargoDate
|
datetime | Shipping date; only values after 2000 are saved. |
Order.OrderDetails[].
ShipmentCampaignCode
|
string | Shipping campaign / shipment code. |
Order.OrderDetails[].
PaymentMethod
|
string | Payment method. Max 50 characters. |
Order.OrderDetails[].
VariantName1
|
string | Variant attribute 1 name. |
Order.OrderDetails[].
VariantValue1
|
string | Variant attribute 1 value. |
Order.OrderDetails[].
VariantName2
|
string | Variant attribute 2 name. |
Order.OrderDetails[].
VariantValue2
|
string | Variant attribute 2 value. |
Order.OrderDetails[].
VariantName3
|
string | Variant attribute 3 name. |
Order.OrderDetails[].
VariantValue3
|
string | Variant attribute 3 value. |
Response fields (Response)
| Field | Type | Description |
|---|---|---|
OrderId
|
integer |
StockMount order ID. Use it with GetOrder, SetOrderNotes and similar endpoints.
|
StoreId
|
integer | Store ID. |
IntegrationOrderCode
|
string | Order number on the marketplace. |
OrderDate
|
datetime |
Order date in UTC (with Z). An order placed at 14:30 Turkey time returns …T11:30:00Z.
|
OrderStatus
|
string |
Order-level status from the order record. Line statuses can differ; check them with GetOrderDetailStatus.
|
OrderType
|
integer |
Order type.
|
Name
|
string | Buyer first name. |
Surname
|
string | Buyer last name. |
Fullname
|
string |
Company title for corporate buyers, otherwise the full name. No separate CompanyTitle field is returned.
|
Nickname
|
string | Buyer's user name on the marketplace. |
PersonalIdentification
|
string | Turkish national ID number. |
TaxAuthority
|
string | Tax office. |
TaxNumber
|
string | Tax number. |
Email
|
string | Buyer e-mail address. |
Telephone
|
string | Buyer phone number. |
Address
|
string | Billing address, postal code, district and city joined with spaces. |
District
|
string | District. |
City
|
string | City. |
PostalCode
|
string | Postal code. |
Notes
|
string |
Order note (written by SetOrderNotes).
|
Member
|
string | Raw membership info from the marketplace (e.g. an IdeaSoft JSON string). Usually empty. |
RowSalt
|
string | Internal field (encryption salt, Base64). Normally absent; ignore it if present. |
OrderDetails
|
object[] | All lines of the order. |
OrderDetails[].
OrderDetailId
|
integer | StockMount order line ID. Use this value in the other line endpoints. |
OrderDetails[].
StoreId
|
integer | Store ID. |
OrderDetails[].
IntegrationOrderDetailId
|
string |
The line's ID on the marketplace. Additional service lines may carry a synthetic value containing _, such as {orderNo}_Service.
|
OrderDetails[].
ProductId
|
integer |
Matched StockMount product ID. 0 when the line is not matched to a product.
|
OrderDetails[].
IntegrationProductCode
|
string |
The product's code on the marketplace. Additional service lines use fixed codes: 999999999999 service fee, 999999999998 instalment difference, 999999999997 commission, 999999999996 payment service fee, 999999999995 shipping fee, 999999999994 gift wrapping, 999999999993 account payment service fee.
|
OrderDetails[].
ProductName
|
string | Product name on the marketplace; falls back to the matched StockMount product name. Omitted when both are empty. |
OrderDetails[].
ProductCode
|
string |
Matched StockMount product code. Without a match: MerchantSku, then IntegrationProductCode.
|
OrderDetails[].
ProductCode2
|
string | Second code of the StockMount product. Empty string when not set. |
OrderDetails[].
Barcode
|
string | Barcode of the matched StockMount product. Empty string without a match. |
OrderDetails[].
MerchantSku
|
string | Merchant SKU reported by the marketplace. |
OrderDetails[].
ProductImage
|
string | First image of the matched StockMount product; otherwise the marketplace image URL. |
OrderDetails[].
ProductUnit
|
string | Sales unit, when the marketplace provides one. |
OrderDetails[].
ProductVariantCode
|
string | Variant code of the line. Empty string when not set. |
OrderDetails[].
ProductVariantId
|
integer |
Always 0; do not use.
|
OrderDetails[].
VariantProductCode
|
string | Code of the matched StockMount variant. Empty string when not matched. |
OrderDetails[].
VariantProductBarcode
|
string | Barcode of the matched StockMount variant. Empty string when not matched. |
OrderDetails[].
VariantPhrase
|
string |
Variant text from the marketplace (e.g. Color: Black, Size: M).
|
OrderDetails[].
VariantName1
|
string | Name of variant attribute 1. |
OrderDetails[].
VariantValue1
|
string | Value of variant attribute 1. |
OrderDetails[].
VariantName2
|
string | Name of variant attribute 2. |
OrderDetails[].
VariantValue2
|
string | Value of variant attribute 2. |
OrderDetails[].
VariantName3
|
string | Name of variant attribute 3. |
OrderDetails[].
VariantValue3
|
string | Value of variant attribute 3. |
OrderDetails[].
Price
|
number |
Unit price. Line total = Price × RawQuantity (StockMount's own reports compute it this way).
|
OrderDetails[].
Quantity
|
integer |
Quantity truncated to an integer. Use RawQuantity for fractional quantities.
|
OrderDetails[].
RawQuantity
|
number | Exact (decimal) quantity. |
OrderDetails[].
TaxRate
|
number |
VAT rate (e.g. 20). The matched StockMount product's rate when it is above 0; otherwise the rate the marketplace sent.
|
OrderDetails[].
DetailType
|
integer |
Line type.
|
OrderDetails[].
OrderStatus
|
string |
The order-level status (from the order record), not the line's own status. Use GetOrderDetailStatus for line status.
|
OrderDetails[].
Invoiced
|
boolean |
true when the line is marked as invoiced.
|
OrderDetails[].
InvoiceNumber
|
string | Invoice number. Empty string when not set. |
OrderDetails[].
InvoiceTime
|
datetime |
Invoice date in UTC (with Z). When there is no value it returns 1899-12-31T22:03:00Z instead of null (1900-01-01 Turkey time converted to UTC).
|
OrderDetails[].
PackageNumber
|
string |
Package number written by SetOrderDetailInvoiced. Empty string when not set. Note: GetSales returns the marketplace package number in this field instead.
|
OrderDetails[].
PackageTime
|
datetime |
Package date in UTC. When there is no value it returns 1899-12-31T22:03:00Z instead of null (1900-01-01 Turkey time converted to UTC).
|
OrderDetails[].
WayBillNumber
|
string | Waybill number. Empty string when not set. |
OrderDetails[].
WayBillTime
|
datetime |
Waybill date in UTC. When there is no value it returns 1899-12-31T22:03:00Z instead of null (1900-01-01 Turkey time converted to UTC).
|
OrderDetails[].
Unread
|
boolean |
true when the line is flagged as unread in the StockMount panel.
|
OrderDetails[].
SmUserSchemaId
|
integer |
Template (schema) ID of the matched StockMount product. 0 without a match.
|
OrderDetails[].
SchemaName
|
string | Template name of the matched product. Empty string when not set. |
OrderDetails[].
DeliveryTitle
|
string | Recipient name or title on the delivery address. |
OrderDetails[].
Address
|
string | Delivery address, postal code, district and city joined with spaces. Can consist only of spaces when the line has no address. |
OrderDetails[].
District
|
string | Delivery district. |
OrderDetails[].
City
|
string | Delivery city. |
OrderDetails[].
PostalCode
|
string | Postal code of the order (not of the line). |
OrderDetails[].
Telephone
|
string | Delivery phone number. |
OrderDetails[].
CargoCompany
|
string | Shipping company name. |
OrderDetails[].
CargoLabelCode
|
string | Shipment tracking / label code. Empty when no shipment info has been set for the line. |
OrderDetails[].
CargoPayment
|
string |
Who pays for shipping; usually Seller, Buyer or Unknown.
|
OrderDetails[].
CargoDate
|
datetime |
Date the shipment info was set, in UTC. When there is no value it returns 1899-12-31T22:03:00Z instead of null (1900-01-01 Turkey time converted to UTC).
|
OrderDetails[].
ShipmentCampaignCode
|
string | Shipping campaign / shipment code from the marketplace. |
OrderDetails[].
LastModificationTime
|
datetime |
Not populated by this endpoint; always 0001-01-01T00:00:00. Use GetSales for the real value.
|
OrderDetails[].
RowSalt
|
string | Internal field (encryption salt, Base64). Normally absent; ignore it if present. |
Error codes for this endpoint
| Code | When |
|---|---|
10001 |
StoreId is not a store in your account (ErrorMessage: Invalid store.). |
50001 |
The order could not be saved. Also returned when the store already has the same IntegrationOrderCode; Response is then an array with the existing order ID (e.g. [4567999]). |
50002 |
The buyer record could not be written. |
50003 |
An order line could not be written. |
50004 |
Old lines could not be deleted during update. |
50006 |
The order given in Order.OrderId is not in this store (Order does not exist !). |
99999 |
Unexpected error; also returned when the store belongs to another user. |
For session errors (00001, 00006) and every other code see error codes.
Related endpoints
Example request
{
"ApiCode": "API_CODE",
"StoreId": 67890,
"Order": {
"IntegrationOrderCode": "WEB-2026-000123",
"OrderStatus": "New",
"OrderDate": "2026-11-05T14:30:00",
"Nickname": "musteri-4411",
"Fullname": "Mehmet Demir",
"Name": "Mehmet",
"Surname": "Demir",
"Address": "Atatürk Cad. No:12",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"PersonalIdentification": "11111111111",
"TaxNumber": "11111111111",
"Notes": "Kapıya bırakılabilir.",
"OrderDetails": [
{
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"Quantity": 3,
"Price": 129.9,
"TaxRate": 20,
"DetailType": 1,
"CargoPayment": "Seller"
}
]
}
}
curl -X POST 'https://out.stockmount.com/api/Integration/SetOrder' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"StoreId": 67890,
"Order": {
"IntegrationOrderCode": "WEB-2026-000123",
"OrderStatus": "New",
"OrderDate": "2026-11-05T14:30:00",
"Nickname": "musteri-4411",
"Fullname": "Mehmet Demir",
"Name": "Mehmet",
"Surname": "Demir",
"Address": "Atatürk Cad. No:12",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"PersonalIdentification": "11111111111",
"TaxNumber": "11111111111",
"Notes": "Kapıya bırakılabilir.",
"OrderDetails": [
{
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"Quantity": 3,
"Price": 129.9,
"TaxRate": 20,
"DetailType": 1,
"CargoPayment": "Seller"
}
]
}
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"StoreId": 67890,
"Order": {
"IntegrationOrderCode": "WEB-2026-000123",
"OrderStatus": "New",
"OrderDate": "2026-11-05T14:30:00",
"Nickname": "musteri-4411",
"Fullname": "Mehmet Demir",
"Name": "Mehmet",
"Surname": "Demir",
"Address": "Atatürk Cad. No:12",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"PersonalIdentification": "11111111111",
"TaxNumber": "11111111111",
"Notes": "Kapıya bırakılabilir.",
"OrderDetails": [
{
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"Quantity": 3,
"Price": 129.9,
"TaxRate": 20,
"DetailType": 1,
"CargoPayment": "Seller"
}
]
}
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/SetOrder",
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",
"StoreId": 67890,
"Order": {
"IntegrationOrderCode": "WEB-2026-000123",
"OrderStatus": "New",
"OrderDate": "2026-11-05T14:30:00",
"Nickname": "musteri-4411",
"Fullname": "Mehmet Demir",
"Name": "Mehmet",
"Surname": "Demir",
"Address": "Atatürk Cad. No:12",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"PersonalIdentification": "11111111111",
"TaxNumber": "11111111111",
"Notes": "Kapıya bırakılabilir.",
"OrderDetails": [
{
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"Quantity": 3,
"Price": 129.9,
"TaxRate": 20,
"DetailType": 1,
"CargoPayment": "Seller"
}
]
}
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/SetOrder');
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",
"StoreId": 67890,
"Order": {
"IntegrationOrderCode": "WEB-2026-000123",
"OrderStatus": "New",
"OrderDate": "2026-11-05T14:30:00",
"Nickname": "musteri-4411",
"Fullname": "Mehmet Demir",
"Name": "Mehmet",
"Surname": "Demir",
"Address": "Atat\u00FCrk Cad. No:12",
"District": "Nil\u00FCfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"PersonalIdentification": "11111111111",
"TaxNumber": "11111111111",
"Notes": "Kap\u0131ya b\u0131rak\u0131labilir.",
"OrderDetails": [
{
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"Quantity": 3,
"Price": 129.9,
"TaxRate": 20,
"DetailType": 1,
"CargoPayment": "Seller"
}
]
}
}
response = requests.post("https://out.stockmount.com/api/Integration/SetOrder", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"StoreId": 67890,
"Order": {
"IntegrationOrderCode": "WEB-2026-000123",
"OrderStatus": "New",
"OrderDate": "2026-11-05T14:30:00",
"Nickname": "musteri-4411",
"Fullname": "Mehmet Demir",
"Name": "Mehmet",
"Surname": "Demir",
"Address": "Atatürk Cad. No:12",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"PersonalIdentification": "11111111111",
"TaxNumber": "11111111111",
"Notes": "Kapıya bırakılabilir.",
"OrderDetails": [
{
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"Quantity": 3,
"Price": 129.9,
"TaxRate": 20,
"DetailType": 1,
"CargoPayment": "Seller"
}
]
}
};
const response = await fetch("https://out.stockmount.com/api/Integration/SetOrder", {
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": {
"OrderId": 4567999,
"StoreId": 67890,
"IntegrationOrderCode": "WEB-2026-000123",
"OrderDate": "2026-11-05T11:30:00Z",
"OrderStatus": "New",
"OrderType": 0,
"Name": "Mehmet",
"Surname": "Demir",
"Fullname": "Mehmet Demir",
"Nickname": "musteri-4411",
"PersonalIdentification": "11111111111",
"TaxAuthority": "",
"TaxNumber": "11111111111",
"Email": "",
"Telephone": "05321234567",
"Address": "Atatürk Cad. No:12 16110 Nilüfer Bursa",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Notes": "Kapıya bırakılabilir.",
"Member": "",
"OrderDetails": [
{
"OrderDetailId": 9877001,
"StoreId": 67890,
"IntegrationOrderDetailId": "WEB-2026-000123-1",
"ProductId": 0,
"IntegrationProductCode": "KUPA-350",
"ProductName": "Seramik Kupa 350 ml",
"ProductCode": "KUPA-350",
"ProductCode2": "",
"Barcode": "",
"MerchantSku": "",
"ProductImage": "",
"ProductUnit": "",
"ProductVariantCode": "",
"ProductVariantId": 0,
"VariantProductCode": "",
"VariantProductBarcode": "",
"Price": 129.9,
"Quantity": 3,
"RawQuantity": 3.0,
"TaxRate": 20.0,
"DetailType": 1,
"OrderStatus": "New",
"Invoiced": false,
"InvoiceNumber": "",
"InvoiceTime": "1899-12-31T22:03:00Z",
"PackageNumber": "",
"PackageTime": "1899-12-31T22:03:00Z",
"WayBillNumber": "",
"WayBillTime": "1899-12-31T22:03:00Z",
"Unread": false,
"SmUserSchemaId": 0,
"SchemaName": "",
"DeliveryTitle": "Mehmet Demir",
"Address": "Atatürk Cad. No:12 16110 Nilüfer Bursa",
"District": "Nilüfer",
"City": "Bursa",
"PostalCode": "16110",
"Telephone": "05321234567",
"CargoCompany": "",
"CargoLabelCode": "",
"CargoPayment": "Seller",
"CargoDate": "1899-12-31T22:03:00Z",
"ShipmentCampaignCode": "",
"LastModificationTime": "0001-01-01T00:00:00"
}
]
}
}
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.