API referansı · Genel ve listeler
Kargo firmalarını listele
Pazaryerlerinin kabul ettiği kargo firmalarını ve kodlarını döndürür.
https://out.stockmount.com/api/Integration/GetIntegrationShipmentCompanies
Kargo bilgisi gönderirken (SetOrderShipmentInformation) ShipmentCompany alanına bu listedeki Code değerini yazın.
IntegrationId gönderirseniz yalnızca o entegrasyonun firmaları döner. Gönderilmezse veya 0 ise tüm entegrasyonların firmaları döner; bu liste uzundur.
Liste, entegrasyonun genel firmalarını ve yalnızca sizin mağazalarınız için tanımlı firmaları içerir. Name alanına göre sıralıdır. Sayfalama yoktur.
İstek alanları
| Alan | Tip | Açıklama |
|---|---|---|
ApiCode
zorunlu
|
string |
DoLogin yanıtından aldığınız oturum kodu.
|
IntegrationId
|
integer |
İsteğe bağlı. Kargo firmaları listelenecek entegrasyonun kimliği (GetStores yanıtındaki IntegrationId). Gönderilmezse veya 0 ise tümü döner.
|
Yanıt alanları (Response)
| Alan | Tip | Açıklama |
|---|---|---|
IntegrationShipmentId
|
integer | Kargo firması kaydının StockMount kimliği. |
IntegrationId
|
integer | Firmanın ait olduğu entegrasyonun kimliği. |
Code
|
string |
Pazaryerindeki kargo firması kodu. SetOrderShipmentInformation çağrısında ShipmentCompany olarak gönderin.
|
Name
|
string | Kargo firmasının adı. |
ShortName
|
string | Kısa ad. Boş olabilir. |
Bu servisin hata kodları
| Kod | Ne zaman |
|---|---|
99999 |
Sunucu tarafında beklenmeyen bir hata oluştu (ör. veritabanı hatası). Bu uç noktada ErrorMessage çoğunlukla boş gelir. |
Oturum hataları (00001, 00006) ve tüm kodlar için hata kodları.
İlgili servisler
Örnek istek
{
"ApiCode": "API_CODE",
"IntegrationId": 2
}
curl -X POST 'https://out.stockmount.com/api/Integration/GetIntegrationShipmentCompanies' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"IntegrationId": 2
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"IntegrationId": 2
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/GetIntegrationShipmentCompanies",
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",
"IntegrationId": 2
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/GetIntegrationShipmentCompanies');
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",
"IntegrationId": 2
}
response = requests.post("https://out.stockmount.com/api/Integration/GetIntegrationShipmentCompanies", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"IntegrationId": 2
};
const response = await fetch("https://out.stockmount.com/api/Integration/GetIntegrationShipmentCompanies", {
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,
"Response": [
{
"IntegrationShipmentId": 57,
"IntegrationId": 2,
"Code": "345",
"Name": "Aras Kargo",
"ShortName": "Aras"
},
{
"IntegrationShipmentId": 61,
"IntegrationId": 2,
"Code": "349",
"Name": "Yurtiçi Kargo",
"ShortName": "Yurtiçi"
}
]
}
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.
Son istekler
Bu sekmeden gönderdiğiniz son istekler; birine tıklayınca gövdesi yeniden yüklenir.