API reference · Orders
Save invoice data for lines
Marks order lines as invoiced or not invoiced and saves invoice, package and waybill numbers and dates.
https://out.stockmount.com/api/Integration/SetOrderDetailInvoiced
Data is written only to StockMount; nothing is sent to the marketplace. Use SetEinvoiceLink to push an invoice link to the marketplace.
Send OrderDetailId and StoreId for every line. With a wrong or missing StoreId the line is silently not updated and Result is still true.
Invoiced is always written; if omitted it is false and the line is marked as not invoiced. The internal invoice record date is set to now on every call.
InvoiceNumber, PackageNumber and WayBillNumber are updated only when non-empty; an empty string or omission keeps the current value. Date fields are also updated only when sent. Send dates in Turkey time without an offset; GetSales returns them converted to UTC.
Lines are processed one by one; the call is not transactional. A line that belongs to another user stops processing and can return 99999; earlier lines stay updated. On success Response is empty.
Empty OrderDetails returns 00003 / OrderDetails; a line with OrderDetailId < 1 returns 00003 / OrderDetailId.
Request fields
| Field | Type | Description |
|---|---|---|
ApiCode
required
|
string |
API code returned by DoLogin.
|
OrderDetails
required
|
object[] | Lines to update. |
OrderDetails[].
OrderDetailId
required
|
integer | StockMount order line ID. |
OrderDetails[].
StoreId
required
|
integer | Store ID of the line. Not validated, but a wrong value means the line is not updated. |
OrderDetails[].
Invoiced
|
boolean |
Invoiced flag. Default false.
|
OrderDetails[].
InvoiceNumber
|
string | Invoice number. Max 64 characters. |
OrderDetails[].
InvoiceTime
|
datetime | Invoice date. |
OrderDetails[].
PackageNumber
|
string | Package number. Max 64 characters. |
OrderDetails[].
PackageTime
|
datetime | Package date. |
OrderDetails[].
WayBillNumber
|
string | Waybill number. Max 64 characters. |
OrderDetails[].
WayBillTime
|
datetime | Waybill date. |
Response fields (Response)
On success the Response field is empty; read the outcome from Result.
Error codes for this endpoint
| Code | When |
|---|---|
99999 |
Database error, or a line that belongs to another user. |
For session errors (00001, 00006) and every other code see error codes.
Related endpoints
Example request
{
"ApiCode": "API_CODE",
"OrderDetails": [
{
"OrderDetailId": 9876543,
"StoreId": 12345,
"Invoiced": true,
"InvoiceNumber": "ABC2026000000123",
"InvoiceTime": "2026-11-05T15:00:00"
}
]
}
curl -X POST 'https://out.stockmount.com/api/Integration/SetOrderDetailInvoiced' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"OrderDetails": [
{
"OrderDetailId": 9876543,
"StoreId": 12345,
"Invoiced": true,
"InvoiceNumber": "ABC2026000000123",
"InvoiceTime": "2026-11-05T15:00:00"
}
]
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"OrderDetails": [
{
"OrderDetailId": 9876543,
"StoreId": 12345,
"Invoiced": true,
"InvoiceNumber": "ABC2026000000123",
"InvoiceTime": "2026-11-05T15:00:00"
}
]
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/SetOrderDetailInvoiced",
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",
"OrderDetails": [
{
"OrderDetailId": 9876543,
"StoreId": 12345,
"Invoiced": true,
"InvoiceNumber": "ABC2026000000123",
"InvoiceTime": "2026-11-05T15:00:00"
}
]
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/SetOrderDetailInvoiced');
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",
"OrderDetails": [
{
"OrderDetailId": 9876543,
"StoreId": 12345,
"Invoiced": True,
"InvoiceNumber": "ABC2026000000123",
"InvoiceTime": "2026-11-05T15:00:00"
}
]
}
response = requests.post("https://out.stockmount.com/api/Integration/SetOrderDetailInvoiced", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"OrderDetails": [
{
"OrderDetailId": 9876543,
"StoreId": 12345,
"Invoiced": true,
"InvoiceNumber": "ABC2026000000123",
"InvoiceTime": "2026-11-05T15:00:00"
}
]
};
const response = await fetch("https://out.stockmount.com/api/Integration/SetOrderDetailInvoiced", {
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.