API referansı · Siparişler
E-fatura linkini kaydet
Bir siparişin e-fatura bilgisini ve linkini kaydeder; isterseniz linki pazaryerine de gönderir.
https://out.stockmount.com/api/Integration/SetEinvoiceLink
Sipariş, mağaza ve pazaryeri sipariş numarası (IntegrationOrderCode) ile bulunur. IntegrationOrderDetailIds verilirse yalnızca bu pazaryeri satır ID'leri, verilmezse siparişin tüm satırları güncellenir. Sipariş numarası StoreId ile verdiğiniz mağazada bulunamazsa Invalid order. döner; başka mağazadaki aynı numaralı sipariş güncellenmez.
Güncellenen satırlarda fatura numarası, fatura UUID'si, senaryo, link, fatura tarihi yazılır ve satır faturalandı olarak işaretlenir.
SendEinvoiceToPlatform true ise link ayrıca pazaryerine gönderilir. Bu yalnızca Trendyol, Hepsiburada, N11 ve Pazarama mağazalarında desteklenir. Gönderim başarısız olursa link yine kaydedilmiş olur ancak Result false ve ErrorMessage Invoice link saved successfully. Invoice link could not be sent: … döner (devamı çoğunlukla Türkçe pazaryeri/sistem mesajıdır).
Başarılı olunca Message alanı Invoice link saved successfully. veya Invoice link saved and sent successfully. olur; Response boştur.
Eksik alanlar tek seferde raporlanır: 00003 ve ErrorMessage Missing: StoreId, InvoiceNumber, … biçimindedir. InvoiceTime ofsetsiz Türkiye saatiyle gönderilmelidir.
İstek alanları
| Alan | Tip | Açıklama |
|---|---|---|
ApiCode
zorunlu
|
string |
DoLogin ile aldığınız API kodu.
|
StoreId
zorunlu
|
integer | Mağaza ID'si. |
IntegrationOrderCode
zorunlu
|
string | Pazaryerinin sipariş numarası. |
IntegrationOrderDetailIds
|
string[] | İsteğe bağlı pazaryeri satır ID'leri. Boşsa tüm satırlar. |
InvoiceNumber
zorunlu
|
string |
Fatura numarası (ör. ABC2026000000123).
|
InvoiceId
zorunlu
|
string | Faturanın UUID'si (ETTN). |
InvoiceScenario
zorunlu
|
string |
Fatura senaryosu (ör. EARSIVFATURA, TEMELFATURA). Doğrulanmaz; olduğu gibi saklanır.
|
InvoiceTime
zorunlu
|
datetime | Fatura tarihi, ofsetsiz Türkiye saati. |
InvoiceLink
zorunlu
|
string | Faturanın herkese açık linki (PDF/HTML). |
SendEinvoiceToPlatform
|
boolean |
true ise link pazaryerine de gönderilir. Varsayılan false.
|
Yanıt alanları (Response)
Başarılı çağrıda Response alanı boş döner; sonucu Result alanından okuyun.
Bu servisin hata kodları
| Kod | Ne zaman |
|---|---|
10001 |
StoreId hesabınıza ait bir mağaza değil (ErrorMessage: Invalid store.). |
99999 |
Sipariş bulunamadı veya hiçbir satır güncellenmedi (Invoice link could not be saved. Something went wrong.), link pazaryerine gönderilemedi ya da beklenmeyen hata. |
Oturum hataları (00001, 00006) ve tüm kodlar için hata kodları.
İlgili servisler
Örnek istek
{
"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);
}
Örnek yanıt
{
"Result": true,
"Message": "Invoice link saved and sent successfully."
}
Deneyin
İstek tarayıcınızdan doğrudan out.stockmount.com adresine gider. ApiCode bu sitede saklanmaz; yalnızca bu sekme açıkken tutulur.
İstek göndermek için önce ApiCode alın.
Bu servis hesabınızdaki gerçek verileri değiştirir.
Son istekler
Bu sekmeden gönderdiğiniz son istekler; birine tıklayınca gövdesi yeniden yüklenir.