Fiyat oluştur
curl --request POST \
--url https://api.noyax.com/api/v1/products/{productId}/prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"PriceType": 2,
"Price": 450,
"CurrencyCode": "TRY",
"UnitCode": "C62",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/products/{productId}/prices");
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 \"PriceType\": 2,\n \"Price\": 450,\n \"CurrencyCode\": \"TRY\",\n \"UnitCode\": \"C62\",\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\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({
PriceType: 2,
Price: 450,
CurrencyCode: 'TRY',
UnitCode: 'C62',
StartDate: '2023-11-07T05:31:56Z',
EndDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.noyax.com/api/v1/products/{productId}/prices', 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}/prices"
payload = {
"PriceType": 2,
"Price": 450,
"CurrencyCode": "TRY",
"UnitCode": "C62",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
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",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitName": "<string>",
"CustomerName": "<string>",
"PriceType": 2,
"Price": 450,
"CurrencyCode": "TRY",
"IncludesVat": false,
"Discount": 10,
"IsDiscountPercentage": true,
"UnitCode": "C62",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerCode": "<string>",
"CustomerGroup": "<string>",
"CustomerGroupDetail": "<string>",
"Description": "<string>"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "2314",
"Message": "CustomerCode cannot be combined with CustomerGroup or CustomerGroupDetail.",
"Errors": [
{
"Code": "2314",
"Message": "CustomerCode cannot be combined with CustomerGroup or CustomerGroupDetail."
}
]
}{
"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."
}
]
}Fiyatlar
Ürün fiyatı oluştur
Ürüne yeni fiyat/indirim satırı ekler.
POST
/
api
/
v1
/
products
/
{productId}
/
prices
Fiyat oluştur
curl --request POST \
--url https://api.noyax.com/api/v1/products/{productId}/prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"PriceType": 2,
"Price": 450,
"CurrencyCode": "TRY",
"UnitCode": "C62",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/products/{productId}/prices");
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 \"PriceType\": 2,\n \"Price\": 450,\n \"CurrencyCode\": \"TRY\",\n \"UnitCode\": \"C62\",\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\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({
PriceType: 2,
Price: 450,
CurrencyCode: 'TRY',
UnitCode: 'C62',
StartDate: '2023-11-07T05:31:56Z',
EndDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.noyax.com/api/v1/products/{productId}/prices', 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}/prices"
payload = {
"PriceType": 2,
"Price": 450,
"CurrencyCode": "TRY",
"UnitCode": "C62",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
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",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitName": "<string>",
"CustomerName": "<string>",
"PriceType": 2,
"Price": 450,
"CurrencyCode": "TRY",
"IncludesVat": false,
"Discount": 10,
"IsDiscountPercentage": true,
"UnitCode": "C62",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerCode": "<string>",
"CustomerGroup": "<string>",
"CustomerGroupDetail": "<string>",
"Description": "<string>"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "2314",
"Message": "CustomerCode cannot be combined with CustomerGroup or CustomerGroupDetail.",
"Errors": [
{
"Code": "2314",
"Message": "CustomerCode cannot be combined with CustomerGroup or CustomerGroupDetail."
}
]
}{
"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."
}
]
}PriceType, Price, CurrencyCode, StartDate ve EndDate zorunludur.
PriceType | Anlamı |
|---|---|
1 | Alış |
2 | Satış |
Pricesıfırdan büyük olmalıdır (2302).Discount,IsDiscountPercentage(varsayılantrue) alanına göre yüzde ya da sabit tutardır; negatif olamaz (2303), yüzdeyse 100’ü geçemez (2304).EndDate,StartDate’ten sonra olmalıdır (2306).UnitCodezorunludur ve ürünün kendi biriminden biri olmalıdır: ürünün ana birimi (UnitCode) ya da, ürünün 2./3. birimi varsa onlardan biri. Şirketteki başka bir birim ya da ürüne ait olmayan bir birim reddedilir (2309).IncludesVat,Pricealanının KDV dahil olup olmadığını belirtir.
Kapsam
Bir fiyat satırı en fazla bir kapsama sahip olabilir; hiçbiri gönderilmezse genel (herkese açık) fiyattır.| Kapsam | Nasıl gönderilir |
|---|---|
| Genel | CustomerCode, CustomerGroup, CustomerGroupDetail hepsi boş |
| Tek bir cariye özel | Sadece CustomerCode |
| Bir cari grubunun tamamına özel | Sadece CustomerGroup (cari gruplarından bir grubun adı) |
| Bir cari grubunun tek bir detayına özel | CustomerGroup ve CustomerGroupDetail birlikte; detay o grubun bir detayı olmalı |
CustomerCode, grup alanlarından biriyle birlikte gönderilemez (2314).CustomerGroupDetail,CustomerGroupolmadan gönderilemez (2313); tek başına bir detay seçmek anlamlı değildir, önce grubu belirtmelisiniz.
Hata kodları
Bu endpoint’in dönebileceği kodlar. Her endpoint için geçerli olan genel hatalar (kimlik doğrulama, yetki, istek header’ları, istek limitleri) burada tekrarlanmaz.| Kod | HTTP | Anlamı |
|---|---|---|
0002 | 400 | İstek gövdesi okunamadı (bozuk JSON, alan tipi uyumsuz) ya da endpoint’te olmayan bir alan içeriyor |
0580 | 400 | Metinle verilen değer (kod ya da ad) birden fazla kayıtla eşleşiyor; hangisi olduğunu ayırt edecek bilgiyi ekleyin (ör. ilçe için City, il için Country) |
2000 | 404 | Ürün bulunamadı |
2301 | 400 | PriceType 1 (alış) ya da 2 (satış) olmalı |
2302 | 400 | Price sıfırdan büyük olmalı |
2303 | 400 | Discount negatif olamaz |
2304 | 400 | IsDiscountPercentage true iken Discount 100’ü geçemez |
2305 | 400 | StartDate ve EndDate zorunlu |
2306 | 400 | EndDate, StartDate’ten sonra olmalı |
2307 | 400 | CurrencyCode zorunlu |
2308 | 400 | Döviz şirkette bulunamadı |
2309 | 400 | UnitCode, ürünün kendi birimlerinden (Unit1/Unit2/Unit3) biri değil |
2310 | 400 | Cari şirkette bulunamadı |
2311 | 400 | Cari grubu şirkette bulunamadı |
2312 | 400 | CustomerGroupDetail, CustomerGroup’nin bir detayı değil |
2313 | 400 | CustomerGroupDetail, CustomerGroup olmadan gönderilemez |
2314 | 400 | CustomerCode, grup alanlarıyla birlikte gönderilemez |
2315 | 400 | UnitCode zorunlu |
Yetkilendirmeler
Başlıklar
Gövde
application/jsontext/jsonapplication/*+json
Yanıt
Created