curl --request PATCH \
--url https://api.noyax.com/api/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '{}'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/orders/{orderId}");
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("{}", 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({})
};
fetch('https://api.noyax.com/api/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/orders/{orderId}"
payload = {}
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",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusName": "<string>",
"CustomerName": "<string>",
"CurrencyCode": "TRY",
"OrderType": 2,
"OrderNumber": "SIP0000125",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"DueDays": 30,
"DeliveryDate": "2026-10-15",
"SharingCode": "<string>",
"DiscountTotal": 100,
"SubTotal": 900,
"VatTotal": 225,
"AdditionalTaxTotal": 225,
"WithholdingTotal": 0,
"GrandTotal": 1350,
"CreateCustomerMovement": true,
"AverageExchangeRate": 1,
"CreateDate": "2023-11-07T05:31:56Z",
"ModifyDate": "2023-11-07T05:31:56Z",
"Lines": [
{
"ProductId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"LineGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProductName": "<string>",
"UnitName": "ADET",
"MainUnitQuantity": 10,
"ProductCode": "URN-0001",
"ECommerceProductCode": null,
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": false,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2026-10-15",
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123
}
]
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "6017",
"Message": "The debit record created by this order for customer 'Example Trading Ltd.' has been closed. Operation cancelled.",
"Errors": [
{
"Code": "6017",
"Message": "The debit record created by this order for customer 'Example Trading Ltd.' has been closed. Operation cancelled."
}
]
}{
"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": "6000",
"Message": "Order not found.",
"Errors": [
{
"Code": "6000",
"Message": "Order not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Partially update order
Changes only the fields sent in the body.
curl --request PATCH \
--url https://api.noyax.com/api/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '{}'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/orders/{orderId}");
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("{}", 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({})
};
fetch('https://api.noyax.com/api/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/orders/{orderId}"
payload = {}
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",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusName": "<string>",
"CustomerName": "<string>",
"CurrencyCode": "TRY",
"OrderType": 2,
"OrderNumber": "SIP0000125",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"DueDays": 30,
"DeliveryDate": "2026-10-15",
"SharingCode": "<string>",
"DiscountTotal": 100,
"SubTotal": 900,
"VatTotal": 225,
"AdditionalTaxTotal": 225,
"WithholdingTotal": 0,
"GrandTotal": 1350,
"CreateCustomerMovement": true,
"AverageExchangeRate": 1,
"CreateDate": "2023-11-07T05:31:56Z",
"ModifyDate": "2023-11-07T05:31:56Z",
"Lines": [
{
"ProductId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"UnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"LineGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"WarehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProductName": "<string>",
"UnitName": "ADET",
"MainUnitQuantity": 10,
"ProductCode": "URN-0001",
"ECommerceProductCode": null,
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"GrossAmount": 1000,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 10,
"DiscountAmount": 100,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": false,
"VatAmount": 225,
"AmountExcludingTax": 900,
"AmountIncludingTax": 1350,
"VatBase": 1125,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2026-10-15",
"AdditionalTaxes": [
{
"Code": "0071",
"Rate": 25,
"Amount": 225,
"Base": 900
}
],
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123
}
]
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "6017",
"Message": "The debit record created by this order for customer 'Example Trading Ltd.' has been closed. Operation cancelled.",
"Errors": [
{
"Code": "6017",
"Message": "The debit record created by this order for customer 'Example Trading Ltd.' has been closed. Operation cancelled."
}
]
}{
"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": "6000",
"Message": "Order not found.",
"Errors": [
{
"Code": "6000",
"Message": "Order not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}- A field that is not sent does not change; a field sent as
nullis cleared. - Validation runs on the whole merged record; if you set a required field to
nullthe request is rejected. - Lists are not merged: when
Linesis sent it replaces all the order’s lines, when it is not sent the lines stay as they are. - The totals and
AverageExchangeRateare always filled from the lines; you do not send them. When you sendLines, their amounts must add up (6120). - The customer movement follows
CreateCustomerMovementexactly as in a full update; a partial update that changes the amount or the currency updates the movement too.
Error codes
Codes this endpoint can return. The general errors that apply to every endpoint (authentication, permissions, request headers, request limits) are not repeated here.| Code | HTTP | Meaning |
|---|---|---|
0002 | 400 | Request body could not be read (malformed JSON, wrong field type), or it contains a field the endpoint does not have |
0003 | 400 | A field exceeds its maximum length (the message names the field and the limit) |
0580 | 400 | A value given as text (a code or a name) matches more than one record; add the detail that tells them apart (for example City for a district, Country for a city) |
6000 | 404 | Order not found |
6001 | 400 | OrderNumber is required |
6002 | 400 | The order number is already used in the company for this order type; the response carries the existing record’s ID as ExistingId |
6003 | 400 | OrderNumber cannot be Next on update |
6004 | 400 | OrderType must be 1 (purchase) or 2 (sales) |
6005 | 400 | Date is required |
6006 | 400 | CustomerCode is required |
6007 | 400 | Customer not found, or not visible to the user |
6010 | 400 | Currency not found in the company |
6011 | 400 | SharingCode is not one of the user’s sharing codes |
6012 | 400 | At least one line is required |
6013 | 400 | DueDays cannot be less than 0 |
6015 | 400 | OrderType cannot be changed after the order is created |
6016 | 400 | The credit record the purchase order created on the customer’s account has been closed by a payment, so the order’s customer movement cannot be changed or removed |
6017 | 400 | The debit record the sales order created on the customer’s account has been closed by a collection, so the order’s customer movement cannot be changed or removed |
6020 | 400 | The customer’s risk limit (set to stop the operation) would be exceeded by the sales order’s customer movement |
6101 | 400 | ProductCode or ECommerceProductCode is required |
6102 | 400 | Product not found in the company |
6103 | 400 | UnitCode is required |
6104 | 400 | UnitCode is not one of the product’s own units (Unit1/Unit2/Unit3) |
6105 | 400 | Quantity must be greater than 0 |
6106 | 400 | UnitPrice cannot be negative |
6107 | 400 | DiscountRate must be between 0 and 100 |
6108 | 400 | Currency of the line not found in the company |
6109 | 400 | VatRate must be between 0 and 100 |
6110 | 400 | Line group not found in the company |
6111 | 400 | ExchangeRate must be 1 for the default currency, and greater than 0 for any other currency |
6112 | 400 | WarehouseName was not found in the company |
6113 | 400 | The product defines no conversion quantity for the line’s unit, so the main unit quantity cannot be calculated |
6114 | 400 | CurrencyCode is required on every line |
6115 | 400 | A line’s AdditionalTaxes can contain at most 3 additional taxes |
6116 | 400 | Code is required for every additional tax of a line |
6117 | 400 | DiscountRate does not match the cumulative rate of the line’s Discounts list |
6118 | 400 | An AdditionalTaxes Code of the line is not one of the valid additional tax codes |
6119 | 400 | The same additional tax code is used more than once on the line |
6120 | 400 | The line amounts do not add up (for example VatAmount is not VatBase × VatRate / 100); the message names the field and the expected value |
6201 | 400 | The Rate of a discount must be between 0 and 100 |
Authorizations
Headers
Body
Whether the order has a customer movement. When true, a purchase order creates a credit (alacak) and a sales order creates a debit (borç) movement on the customer for GrandTotal, kept in sync on every update. When false the order has no customer movement; on update, false removes an existing movement. Movements that were already closed by a collection or payment cannot be changed or removed.
true
Weighted average exchange rate: when every line has the same currency, Σ(AmountExcludingTax × ExchangeRate) / Σ AmountExcludingTax; when the lines have different currencies, 1, and the totals are converted to the default currency with each line's ExchangeRate. Filled from the lines; a value sent in the request is ignored.
1
Response
OK