curl --request PUT \
--url https://api.noyax.com/api/v1/products/{productId}/prices/{priceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"PriceType": 2,
"Price": 450,
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IncludesVat": false,
"Discount": 10,
"IsDiscountPercentage": true,
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Description": "<string>"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/products/{productId}/prices/{priceId}");
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 \"CurrencyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IncludesVat\": false,\n \"Discount\": 10,\n \"IsDiscountPercentage\": true,\n \"UnitId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"CustomerGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"CustomerGroupDetailId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Description\": \"<string>\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'PUT',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
PriceType: 2,
Price: 450,
CurrencyId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
IncludesVat: false,
Discount: 10,
IsDiscountPercentage: true,
UnitId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
StartDate: '2023-11-07T05:31:56Z',
EndDate: '2023-11-07T05:31:56Z',
CustomerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
CustomerGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
CustomerGroupDetailId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
Description: '<string>'
})
};
fetch('https://api.noyax.com/api/v1/products/{productId}/prices/{priceId}', 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/{priceId}"
payload = {
"PriceType": 2,
"Price": 450,
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IncludesVat": False,
"Discount": 10,
"IsDiscountPercentage": True,
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Description": "<string>"
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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",
"CurrencyCode": "TRY",
"UnitName": "<string>",
"CustomerName": "<string>",
"CustomerGroupName": "<string>",
"CustomerGroupDetailName": "<string>",
"PriceType": 2,
"Price": 450,
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IncludesVat": false,
"Discount": 10,
"IsDiscountPercentage": true,
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Description": "<string>"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "2306",
"Message": "EndDate must be after StartDate.",
"Errors": [
{
"Code": "2306",
"Message": "EndDate must be after StartDate."
}
]
}{
"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": "2000",
"Message": "Product not found.",
"Errors": [
{
"Code": "2000",
"Message": "Product not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Ürün fiyatını güncelle
Fiyat satırının tüm alanlarını günceller.
curl --request PUT \
--url https://api.noyax.com/api/v1/products/{productId}/prices/{priceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"PriceType": 2,
"Price": 450,
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IncludesVat": false,
"Discount": 10,
"IsDiscountPercentage": true,
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Description": "<string>"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/products/{productId}/prices/{priceId}");
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 \"CurrencyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IncludesVat\": false,\n \"Discount\": 10,\n \"IsDiscountPercentage\": true,\n \"UnitId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"CustomerGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"CustomerGroupDetailId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Description\": \"<string>\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'PUT',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
PriceType: 2,
Price: 450,
CurrencyId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
IncludesVat: false,
Discount: 10,
IsDiscountPercentage: true,
UnitId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
StartDate: '2023-11-07T05:31:56Z',
EndDate: '2023-11-07T05:31:56Z',
CustomerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
CustomerGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
CustomerGroupDetailId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
Description: '<string>'
})
};
fetch('https://api.noyax.com/api/v1/products/{productId}/prices/{priceId}', 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/{priceId}"
payload = {
"PriceType": 2,
"Price": 450,
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IncludesVat": False,
"Discount": 10,
"IsDiscountPercentage": True,
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Description": "<string>"
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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",
"CurrencyCode": "TRY",
"UnitName": "<string>",
"CustomerName": "<string>",
"CustomerGroupName": "<string>",
"CustomerGroupDetailName": "<string>",
"PriceType": 2,
"Price": 450,
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IncludesVat": false,
"Discount": 10,
"IsDiscountPercentage": true,
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CustomerGroupDetailId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Description": "<string>"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "2306",
"Message": "EndDate must be after StartDate.",
"Errors": [
{
"Code": "2306",
"Message": "EndDate must be after StartDate."
}
]
}{
"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": "2000",
"Message": "Product not found.",
"Errors": [
{
"Code": "2000",
"Message": "Product not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}PATCH yalnızca gönderdiğiniz alanları değiştirir.
PriceType, Price, CurrencyId, 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).UnitIdzorunludur ve ürünün kendi biriminden biri olmalıdır: ürünün ana birimi (UnitId) 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 | CustomerId, CustomerGroupId, CustomerGroupDetailId hepsi boş |
| Tek bir cariye özel | Sadece CustomerId |
| Bir cari grubunun tamamına özel | Sadece CustomerGroupId (cari gruplarından bir ID) |
| Bir cari grubunun tek bir detayına özel | CustomerGroupId ve CustomerGroupDetailId birlikte; detay o grubun bir detayı olmalı |
CustomerId, grup alanlarından biriyle birlikte gönderilemez (2314).CustomerGroupDetailId,CustomerGroupIdolmadan gönderilemez (2313); tek başına bir detay seçmek anlamlı değildir, önce grubu belirtmelisiniz.
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 >= 1Gövde
Zorunlu. 1: Alış, 2: Satış.
2
Zorunlu. Sıfırdan büyük olmalıdır.
450
Zorunlu. GET /api/v1/definitions/currencies ile dönen bir dövizin ID'si.
Price alanının KDV dahil olup olmadığı.
false
IsDiscountPercentage alanına göre indirim tutarı ya da yüzdesi. Negatif olamaz.
10
Discount alanının sabit tutar yerine yüzde (0-100) olup olmadığı. Varsayılan true.
true
Zorunlu. Ürünün kendi birimlerinden biri olmalıdır: ürünün ana birimi (UnitId) ya da, ürünün 2./3. birimi varsa onlardan biri.
Zorunlu. Geçerlilik döneminin başlangıcı.
Zorunlu. Geçerlilik döneminin bitişi. StartDate'ten sonra olmalıdır.
Kapsam: yalnızca bu cariye uygulanır. CustomerGroupId ya da CustomerGroupDetailId ile birlikte gönderilemez. Genel fiyat için bütün kapsam alanlarını boş bırakın.
Kapsam: GET /api/v1/customers/groups ile dönen bu gruptaki her cariye uygulanır; CustomerGroupDetailId gönderilirse tek bir detaya daralır. CustomerId ile birlikte gönderilemez.
Kapsam: CustomerGroupId'yi bu grup detayına sahip carilerle daraltır. CustomerGroupId'nin dolu olmasını gerektirir.
Açıklama. En fazla 255 karakter.
Yanıt
OK
İş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.