API reference · Orders
Save the e-invoice link
Saves an order's e-invoice data and link, and can also send the link to the marketplace.
https://out.stockmount.com/api/Integration/SetEinvoiceLink
The order is found by store and marketplace order number (IntegrationOrderCode). With IntegrationOrderDetailIds only those marketplace line IDs are updated; otherwise all lines of the order. If the order number is not found in the store given by StoreId, you get Invalid order.; an order with the same number in another store is never updated.
Updated lines get the invoice number, invoice UUID, scenario, link and invoice date, and are marked as invoiced.
With SendEinvoiceToPlatform true the link is also sent to the marketplace. This is supported only for Trendyol, Hepsiburada, N11 and Pazarama stores. If sending fails the link is still saved, but Result is false and ErrorMessage is Invoice link saved successfully. Invoice link could not be sent: … (the rest is usually a Turkish marketplace/system message).
On success Message is Invoice link saved successfully. or Invoice link saved and sent successfully.; Response is empty.
Missing fields are reported together: 00003 with ErrorMessage like Missing: StoreId, InvoiceNumber, …. Send InvoiceTime in Turkey time without an offset.
Request fields
| Field | Type | Description |
|---|---|---|
ApiCode
required
|
string |
API code returned by DoLogin.
|
StoreId
required
|
integer | Store ID. |
IntegrationOrderCode
required
|
string | Marketplace order number. |
IntegrationOrderDetailIds
|
string[] | Optional marketplace line IDs. Empty means all lines. |
InvoiceNumber
required
|
string |
Invoice number (e.g. ABC2026000000123).
|
InvoiceId
required
|
string | Invoice UUID (ETTN). |
InvoiceScenario
required
|
string |
Invoice scenario (e.g. EARSIVFATURA, TEMELFATURA). Not validated; stored as is.
|
InvoiceTime
required
|
datetime | Invoice date, Turkey time without offset. |
InvoiceLink
required
|
string | Public link to the invoice (PDF/HTML). |
SendEinvoiceToPlatform
|
boolean |
When true the link is also sent to the marketplace. Default false.
|
Response fields (Response)
On success the Response field is empty; read the outcome from Result.
Error codes for this endpoint
| Code | When |
|---|---|
10001 |
StoreId is not a store in your account (ErrorMessage: Invalid store.). |
99999 |
Order not found or no line updated (Invoice link could not be saved. Something went wrong.), sending the link to the marketplace failed, or an unexpected error. |
For session errors (00001, 00006) and every other code see error codes.
Related endpoints
Example request
{
"ApiCode": "API_CODE",
"StoreId": 12345,
"IntegrationOrderCode": "10293847",
"InvoiceNumber": "ABC2026000000123",
"InvoiceId": "3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
"InvoiceScenario": "EARSIVFATURA",
"InvoiceTime": "2026-11-05T15:00:00",
"InvoiceLink": "https://efatura.example.com/view/3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c.pdf",
"SendEinvoiceToPlatform": true
}
curl -X POST 'https://out.stockmount.com/api/Integration/SetEinvoiceLink' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"StoreId": 12345,
"IntegrationOrderCode": "10293847",
"InvoiceNumber": "ABC2026000000123",
"InvoiceId": "3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
"InvoiceScenario": "EARSIVFATURA",
"InvoiceTime": "2026-11-05T15:00:00",
"InvoiceLink": "https://efatura.example.com/view/3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c.pdf",
"SendEinvoiceToPlatform": true
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"StoreId": 12345,
"IntegrationOrderCode": "10293847",
"InvoiceNumber": "ABC2026000000123",
"InvoiceId": "3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
"InvoiceScenario": "EARSIVFATURA",
"InvoiceTime": "2026-11-05T15:00:00",
"InvoiceLink": "https://efatura.example.com/view/3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c.pdf",
"SendEinvoiceToPlatform": true
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/SetEinvoiceLink",
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": 12345,
"IntegrationOrderCode": "10293847",
"InvoiceNumber": "ABC2026000000123",
"InvoiceId": "3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
"InvoiceScenario": "EARSIVFATURA",
"InvoiceTime": "2026-11-05T15:00:00",
"InvoiceLink": "https://efatura.example.com/view/3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c.pdf",
"SendEinvoiceToPlatform": true
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/SetEinvoiceLink');
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": 12345,
"IntegrationOrderCode": "10293847",
"InvoiceNumber": "ABC2026000000123",
"InvoiceId": "3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
"InvoiceScenario": "EARSIVFATURA",
"InvoiceTime": "2026-11-05T15:00:00",
"InvoiceLink": "https://efatura.example.com/view/3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c.pdf",
"SendEinvoiceToPlatform": True
}
response = requests.post("https://out.stockmount.com/api/Integration/SetEinvoiceLink", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"StoreId": 12345,
"IntegrationOrderCode": "10293847",
"InvoiceNumber": "ABC2026000000123",
"InvoiceId": "3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
"InvoiceScenario": "EARSIVFATURA",
"InvoiceTime": "2026-11-05T15:00:00",
"InvoiceLink": "https://efatura.example.com/view/3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c.pdf",
"SendEinvoiceToPlatform": true
};
const response = await fetch("https://out.stockmount.com/api/Integration/SetEinvoiceLink", {
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,
"Message": "Invoice link saved and sent successfully."
}
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.