curl --request POST \
--url https://api.noyax.com/api/v1/products/{productId}/critical-stock \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"MinStock": 10,
"MaxStock": 500,
"MaxStockControl": 1,
"MinStockControl": 1,
"NegativeStockControl": 2
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/products/{productId}/critical-stock");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-UserID", "<x-userid>");
request.AddHeader("X-CompanyID", "<x-companyid>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"WarehouseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"MinStock\": 10,\n \"MaxStock\": 500,\n \"MaxStockControl\": 1,\n \"MinStockControl\": 1,\n \"NegativeStockControl\": 2\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
WarehouseId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
MinStock: 10,
MaxStock: 500,
MaxStockControl: 1,
MinStockControl: 1,
NegativeStockControl: 2
})
};
fetch('https://api.noyax.com/api/v1/products/{productId}/critical-stock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/products/{productId}/critical-stock"
payload = {
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"MinStock": 10,
"MaxStock": 500,
"MaxStockControl": 1,
"MinStockControl": 1,
"NegativeStockControl": 2
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProductId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"WarehouseName": "A DEPO",
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"MinStock": 10,
"MaxStock": 500,
"MaxStockControl": 1,
"MinStockControl": 1,
"NegativeStockControl": 2
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "2410",
"Message": "A critical stock definition cannot be added for a product with StockType 1 (no stock tracking).",
"Errors": [
{
"Code": "2410",
"Message": "A critical stock definition cannot be added for a product with StockType 1 (no stock tracking)."
}
]
}{
"Success": false,
"ResultCode": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token.",
"Errors": [
{
"Code": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token."
}
]
}{
"Success": false,
"ResultCode": "0110",
"Message": "You do not have permission for this operation.",
"Errors": [
{
"Code": "0110",
"Message": "You do not have permission for this operation."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Kritik stok tanımı oluştur
Ürüne bir depo için kritik stok tanımı ekler.
curl --request POST \
--url https://api.noyax.com/api/v1/products/{productId}/critical-stock \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"MinStock": 10,
"MaxStock": 500,
"MaxStockControl": 1,
"MinStockControl": 1,
"NegativeStockControl": 2
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/products/{productId}/critical-stock");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-UserID", "<x-userid>");
request.AddHeader("X-CompanyID", "<x-companyid>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"WarehouseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"MinStock\": 10,\n \"MaxStock\": 500,\n \"MaxStockControl\": 1,\n \"MinStockControl\": 1,\n \"NegativeStockControl\": 2\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
WarehouseId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
MinStock: 10,
MaxStock: 500,
MaxStockControl: 1,
MinStockControl: 1,
NegativeStockControl: 2
})
};
fetch('https://api.noyax.com/api/v1/products/{productId}/critical-stock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/products/{productId}/critical-stock"
payload = {
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"MinStock": 10,
"MaxStock": 500,
"MaxStockControl": 1,
"MinStockControl": 1,
"NegativeStockControl": 2
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProductId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"WarehouseName": "A DEPO",
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"MinStock": 10,
"MaxStock": 500,
"MaxStockControl": 1,
"MinStockControl": 1,
"NegativeStockControl": 2
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "2410",
"Message": "A critical stock definition cannot be added for a product with StockType 1 (no stock tracking).",
"Errors": [
{
"Code": "2410",
"Message": "A critical stock definition cannot be added for a product with StockType 1 (no stock tracking)."
}
]
}{
"Success": false,
"ResultCode": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token.",
"Errors": [
{
"Code": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token."
}
]
}{
"Success": false,
"ResultCode": "0110",
"Message": "You do not have permission for this operation.",
"Errors": [
{
"Code": "0110",
"Message": "You do not have permission for this operation."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}StockType değeri 1 (stok tutulmuyor) olmayan bir ürüne eklenebilir (2410).
WarehouseId zorunludur; bir ürünün bir depo için en fazla bir kritik stok tanımı olabilir (2403).
MinStockveMaxStocknegatif olamaz.MaxStocksıfırdan büyükseMinStock’tan küçük olamaz (2406);MaxStock: 0üst sınır olmadığı anlamına gelir.MaxStockControl,MinStockControlveNegativeStockControlher biri ayrı ayrı aşağıdaki değerleri alır:
| Değer | Anlamı |
|---|---|
0 | İşleme devam et |
1 | Kullanıcıyı uyar |
2 | İşlemi durdur |
MaxStockControl: stokMaxStock’u aştığında.MinStockControl: stokMinStock’un altına düştüğünde.NegativeStockControl: stok negatife düşecek bir işlem yapıldığında.
Yetkilendirmeler
Access token obtained from the Noyax auth service with your API key.
Başlıklar
İsteğin adına yapıldığı Noyax kullanıcısının ID'si. Oluşturulan, güncellenen ve silinen kayıtların denetim alanlarına yazılır.
x >= 1Şirketin ID'si. Kullanıcı bu şirkete tanımlı olmalıdır. Bütün okuma ve yazma işlemleri bu şirketle sınırlıdır.
x >= 1Muhasebe döneminin ID'si. Cari endpoint'lerinde isteğe bağlıdır; gönderilirse oluşturulan kayıtlara yazılır.
x >= 1Yol Parametreleri
Ürün ID'si.
Gövde
Zorunlu. GET /api/v1/stock/warehouses ile dönen bir deponun ID'si.
Asgari stok seviyesi. Negatif olamaz.
10
Azami stok seviyesi. Negatif olamaz; 0 üst sınır olmadığı anlamına gelir. Sıfırdan büyükse MinStock'tan küçük olamaz.
500
MaxStock aşıldığında ne olacağı. 0: Devam et, 1: Kullanıcıyı uyar, 2: İşlemi durdur.
1
Stok MinStock'un altına düştüğünde ne olacağı. 0: Devam et, 1: Kullanıcıyı uyar, 2: İşlemi durdur.
1
Stok negatife düşecekse ne olacağı. 0: Devam et, 1: Kullanıcıyı uyar, 2: İşlemi durdur.
2
Yanıt
Created
İşlemin başarılı olup olmadığı.
true
Başarıda "0000". Hatada ilk hatanın kodu; hataların tamamı Errors içinde listelenir.
"0000"
Show child attributes
Show child attributes
Success false olduğunda hata mesajı. Bütün hataların mesajları tek metinde birleştirilir.