curl --request PATCH \
--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.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'PATCH',
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.patch(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": "2302",
"Message": "Price must be greater than 0.",
"Errors": [
{
"Code": "2302",
"Message": "Price must be greater than 0."
}
]
}{
"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ı kısmi güncelle
Fiyat satırının yalnızca gönderilen alanlarını değiştirir.
curl --request PATCH \
--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.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'PATCH',
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.patch(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": "2302",
"Message": "Price must be greater than 0.",
"Errors": [
{
"Code": "2302",
"Message": "Price must be greater than 0."
}
]
}{
"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."
}
]
}CustomerGroupId gönderip mevcut CustomerId’yi temizlemezseniz kapsam çakışması (2314) döner.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.