API referansı · Ürünler
Ürün özetini getir
Bir kaynaktaki tüm ürünlerin kimliğini, kodunu, adını, barkodunu ve durumunu tek yanıtta döndürür.
https://out.stockmount.com/api/Product/GetProductSummary
Sayfalama ve filtre yoktur; kaynaktaki tüm ürünler tek yanıtta gelir ve sıra garanti edilmez. Yalnızca ProductSourceId okunur; GetProducts filtre ve sayfalama alanları bu çağrıda yok sayılır.
TotalProductCount ve FilteredProductCount her zaman aynıdır ve dönen ürün sayısını verir. Kaldırılmış DeleteProduct ile silinmiş ürünler dönmez; durdurulmuş ürünler (durum 3) döner. Bu çağrı, kendi sisteminizdeki ürünleri StockMount ProductId değerleriyle eşleştirmek için uygundur.
Aktif Ürün Paketi olmayan hesaplar 70018 hatası alır; paket bilgisi doğrulanamazsa 99999 döner.
İstek alanları
| Alan | Tip | Açıklama |
|---|---|---|
ApiCode
zorunlu
|
string |
DoLogin ile aldığınız oturum kodu.
|
ProductSourceId
zorunlu
|
integer |
Kaynak kimliği. 1'den küçükse 00003 döner (ErrorMessage: ProductSourceId).
|
Yanıt alanları (Response)
| Alan | Tip | Açıklama |
|---|---|---|
TotalProductCount
|
integer | Dönen ürün sayısı. |
FilteredProductCount
|
integer |
TotalProductCount ile aynı.
|
Products
|
object[] | Kaynaktaki tüm ürünler. |
Products[].
ProductId
|
integer | Ürün kimliği. |
Products[].
ProductSourceId
|
integer | Kaynak kimliği. |
Products[].
Code
|
string | Ürün kodu. |
Products[].
Name
|
string | Ürün adı. |
Products[].
Barcode
|
string | Barkod; yoksa boş metin. |
Products[].
Status
|
integer |
Ürün durumu.
|
Bu servisin hata kodları
| Kod | Ne zaman |
|---|---|
70018 |
Hesabınızda aktif Ürün Paketi yok (ErrorMessage: Ürün entegrasyonu için aktif Ürün Paketi gereklidir.). |
99999 |
Beklenmeyen bir hata oluştu. |
Oturum hataları (00001, 00006) ve tüm kodlar için hata kodları.
İlgili servisler
Örnek istek
{
"ApiCode": "API_CODE",
"ProductSourceId": 1234
}
curl -X POST 'https://out.stockmount.com/api/Product/GetProductSummary' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"ProductSourceId": 1234
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"ProductSourceId": 1234
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Product/GetProductSummary",
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",
"ProductSourceId": 1234
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Product/GetProductSummary');
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",
"ProductSourceId": 1234
}
response = requests.post("https://out.stockmount.com/api/Product/GetProductSummary", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"ProductSourceId": 1234
};
const response = await fetch("https://out.stockmount.com/api/Product/GetProductSummary", {
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": {
"TotalProductCount": 2,
"FilteredProductCount": 2,
"Products": [
{
"ProductId": 987654,
"ProductSourceId": 1234,
"Code": "TSHIRT-001",
"Name": "Basic Pamuklu Tişört",
"Barcode": "8690000000017",
"Status": 2
},
{
"ProductId": 987655,
"ProductSourceId": 1234,
"Code": "PANT-002",
"Name": "Chino Pantolon",
"Barcode": "8690000000048",
"Status": 3
}
]
}
}
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.