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."
}
]
}Update product price
Replaces all fields of a price row.
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 changes only the fields you send.
PriceType, Price, CurrencyId, StartDate and EndDate are required.
PriceType | Meaning |
|---|---|
1 | Purchase |
2 | Sales |
Pricemust be greater than 0 (2302).Discountis a percentage or a fixed amount depending onIsDiscountPercentage(defaulttrue); it cannot be negative (2303), and as a percentage it cannot exceed 100 (2304).EndDatemust be afterStartDate(2306).UnitIdis required and must be one of the product’s own units: its main unit (UnitId) or, if the product has a second/third unit, one of those. Any other unit in the company, or a unit that does not belong to the product, is rejected (2309).IncludesVatsays whetherPriceincludes VAT.
Scope
A price row has at most one scope; if none are sent, it is a general price open to everyone.| Scope | How to send it |
|---|---|
| General | CustomerId, CustomerGroupId, CustomerGroupDetailId all empty |
| A single customer | Only CustomerId |
| An entire customer group | Only CustomerGroupId (an ID from customer groups) |
| One detail of a customer group | CustomerGroupId and CustomerGroupDetailId together; the detail must belong to that group |
CustomerIdcannot be combined with either group field (2314).CustomerGroupDetailIdcannot be sent withoutCustomerGroupId(2313); selecting a detail alone is not meaningful, the group must be specified first.
Authorizations
Access token obtained from the Noyax auth service with your API key.
Headers
ID of the Noyax user the request is made on behalf of. Written to the audit fields of created, updated and deleted records.
x >= 1ID of the company. The user must be assigned to this company. All reads and writes are limited to this company.
x >= 1ID of the accounting period. Optional for customer endpoints; if sent, it is written to created records.
x >= 1Body
Required. 1: Purchase, 2: Sales.
2
Required. Must be greater than 0.
450
Required. ID of a currency from GET /api/v1/definitions/currencies.
Whether Price includes VAT.
false
Discount amount or percentage, depending on IsDiscountPercentage. Cannot be negative.
10
Whether Discount is a percentage (0-100) rather than a fixed amount. Defaults to true.
true
Required. Must be one of the product's own units: its main unit (UnitId on the product) or, for products with a second/third unit, one of those.
Required. Start of the validity period.
Required. End of the validity period. Must be after StartDate.
Scope: applies only to this customer. Cannot be combined with CustomerGroupId or CustomerGroupDetailId. Leave every scope field empty for a general price.
Scope: applies to every customer in this group (from GET /api/v1/customers/groups), unless CustomerGroupDetailId narrows it to one detail. Cannot be combined with CustomerId.
Scope: narrows CustomerGroupId to customers with this group detail. Requires CustomerGroupId to be set.
Description. At most 255 characters.
Response
OK
Whether the operation succeeded.
true
"0000" on success. On failure, the code of the first error; all errors are listed in Errors.
"0000"
Show child attributes
Show child attributes
Error message when Success is false. Messages of all errors are joined into a single text.