curl --request PUT \
--url https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"OrderType": 2,
"OrderNumber": "9446A4D834",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"CurrencyCode": "TRY",
"DueDays": 30,
"DeliveryDate": "2023-11-07T05:31:56Z",
"SharingCode": "<string>",
"DiscountTotal": 0,
"SubTotal": 1000,
"VatTotal": 200,
"AdditionalTaxTotal": 0,
"WithholdingTotal": 0,
"GrandTotal": 1200,
"AverageExchangeRate": 1,
"CreateCustomerMovement": true,
"Lines": [
{
"ProductCode": "URN-0001",
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 0,
"DiscountAmount": 0,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": false,
"VatAmount": 123,
"AmountExcludingTax": 123,
"AmountIncludingTax": 123,
"VatBase": 123,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2023-11-07T05:31:56Z",
"AdditionalTaxCode1": "<string>",
"AdditionalTaxRate1": 123,
"AdditionalTaxAmount1": 123,
"AdditionalTaxBase1": 123,
"AdditionalTaxCode2": "<string>",
"AdditionalTaxRate2": 123,
"AdditionalTaxAmount2": 123,
"AdditionalTaxBase2": 123,
"AdditionalTaxCode3": "<string>",
"AdditionalTaxRate3": 123,
"AdditionalTaxAmount3": 123,
"AdditionalTaxBase3": 123,
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123
}
]
}
'using RestSharp;
var options = new RestClientOptions("https://dev.noyax.com/services/noyax_api/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("{\n \"OrderType\": 2,\n \"OrderNumber\": \"9446A4D834\",\n \"DocumentNumber\": \"2026-15\",\n \"Date\": \"2026-09-21T10:30:00\",\n \"Description\": \"<string>\",\n \"CustomerCode\": \"C-0001\",\n \"CurrencyCode\": \"TRY\",\n \"DueDays\": 30,\n \"DeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"SharingCode\": \"<string>\",\n \"DiscountTotal\": 0,\n \"SubTotal\": 1000,\n \"VatTotal\": 200,\n \"AdditionalTaxTotal\": 0,\n \"WithholdingTotal\": 0,\n \"GrandTotal\": 1200,\n \"AverageExchangeRate\": 1,\n \"CreateCustomerMovement\": true,\n \"Lines\": [\n {\n \"ProductCode\": \"URN-0001\",\n \"UnitCode\": \"C62\",\n \"Quantity\": 10,\n \"UnitPrice\": 100,\n \"CurrencyCode\": \"TRY\",\n \"ExchangeRate\": 1,\n \"DiscountRate\": 0,\n \"DiscountAmount\": 0,\n \"Discounts\": [\n {\n \"Rate\": 10\n }\n ],\n \"VatRate\": 20,\n \"VatIncluded\": false,\n \"VatAmount\": 123,\n \"AmountExcludingTax\": 123,\n \"AmountIncludingTax\": 123,\n \"VatBase\": 123,\n \"VatExemptionCode\": \"<string>\",\n \"LineGroupName\": \"<string>\",\n \"WarehouseName\": \"<string>\",\n \"Description\": \"<string>\",\n \"Description2\": \"<string>\",\n \"DeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"AdditionalTaxCode1\": \"<string>\",\n \"AdditionalTaxRate1\": 123,\n \"AdditionalTaxAmount1\": 123,\n \"AdditionalTaxBase1\": 123,\n \"AdditionalTaxCode2\": \"<string>\",\n \"AdditionalTaxRate2\": 123,\n \"AdditionalTaxAmount2\": 123,\n \"AdditionalTaxBase2\": 123,\n \"AdditionalTaxCode3\": \"<string>\",\n \"AdditionalTaxRate3\": 123,\n \"AdditionalTaxAmount3\": 123,\n \"AdditionalTaxBase3\": 123,\n \"WithholdingCode\": \"<string>\",\n \"WithholdingNumerator\": 123,\n \"WithholdingDenominator\": 123,\n \"WithheldVatAmount\": 123\n }\n ]\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({
OrderType: 2,
OrderNumber: '9446A4D834',
DocumentNumber: '2026-15',
Date: '2026-09-21T10:30:00',
Description: '<string>',
CustomerCode: 'C-0001',
CurrencyCode: 'TRY',
DueDays: 30,
DeliveryDate: '2023-11-07T05:31:56Z',
SharingCode: '<string>',
DiscountTotal: 0,
SubTotal: 1000,
VatTotal: 200,
AdditionalTaxTotal: 0,
WithholdingTotal: 0,
GrandTotal: 1200,
AverageExchangeRate: 1,
CreateCustomerMovement: true,
Lines: [
{
ProductCode: 'URN-0001',
UnitCode: 'C62',
Quantity: 10,
UnitPrice: 100,
CurrencyCode: 'TRY',
ExchangeRate: 1,
DiscountRate: 0,
DiscountAmount: 0,
Discounts: [{Rate: 10}],
VatRate: 20,
VatIncluded: false,
VatAmount: 123,
AmountExcludingTax: 123,
AmountIncludingTax: 123,
VatBase: 123,
VatExemptionCode: '<string>',
LineGroupName: '<string>',
WarehouseName: '<string>',
Description: '<string>',
Description2: '<string>',
DeliveryDate: '2023-11-07T05:31:56Z',
AdditionalTaxCode1: '<string>',
AdditionalTaxRate1: 123,
AdditionalTaxAmount1: 123,
AdditionalTaxBase1: 123,
AdditionalTaxCode2: '<string>',
AdditionalTaxRate2: 123,
AdditionalTaxAmount2: 123,
AdditionalTaxBase2: 123,
AdditionalTaxCode3: '<string>',
AdditionalTaxRate3: 123,
AdditionalTaxAmount3: 123,
AdditionalTaxBase3: 123,
WithholdingCode: '<string>',
WithholdingNumerator: 123,
WithholdingDenominator: 123,
WithheldVatAmount: 123
}
]
})
};
fetch('https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId}"
payload = {
"OrderType": 2,
"OrderNumber": "9446A4D834",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"CurrencyCode": "TRY",
"DueDays": 30,
"DeliveryDate": "2023-11-07T05:31:56Z",
"SharingCode": "<string>",
"DiscountTotal": 0,
"SubTotal": 1000,
"VatTotal": 200,
"AdditionalTaxTotal": 0,
"WithholdingTotal": 0,
"GrandTotal": 1200,
"AverageExchangeRate": 1,
"CreateCustomerMovement": True,
"Lines": [
{
"ProductCode": "URN-0001",
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 0,
"DiscountAmount": 0,
"Discounts": [{ "Rate": 10 }],
"VatRate": 20,
"VatIncluded": False,
"VatAmount": 123,
"AmountExcludingTax": 123,
"AmountIncludingTax": 123,
"VatBase": 123,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2023-11-07T05:31:56Z",
"AdditionalTaxCode1": "<string>",
"AdditionalTaxRate1": 123,
"AdditionalTaxAmount1": 123,
"AdditionalTaxBase1": 123,
"AdditionalTaxCode2": "<string>",
"AdditionalTaxRate2": 123,
"AdditionalTaxAmount2": 123,
"AdditionalTaxBase2": 123,
"AdditionalTaxCode3": "<string>",
"AdditionalTaxRate3": 123,
"AdditionalTaxAmount3": 123,
"AdditionalTaxBase3": 123,
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123
}
]
}
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",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusName": "<string>",
"CustomerName": "<string>",
"OrderType": 2,
"OrderNumber": "9446A4D834",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"CurrencyCode": "TRY",
"DueDays": 30,
"DeliveryDate": "2023-11-07T05:31:56Z",
"SharingCode": "<string>",
"DiscountTotal": 0,
"SubTotal": 1000,
"VatTotal": 200,
"AdditionalTaxTotal": 0,
"WithholdingTotal": 0,
"GrandTotal": 1200,
"AverageExchangeRate": 1,
"CreateCustomerMovement": true,
"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",
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 0,
"DiscountAmount": 0,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": false,
"VatAmount": 123,
"AmountExcludingTax": 123,
"AmountIncludingTax": 123,
"VatBase": 123,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2023-11-07T05:31:56Z",
"AdditionalTaxCode1": "<string>",
"AdditionalTaxRate1": 123,
"AdditionalTaxAmount1": 123,
"AdditionalTaxBase1": 123,
"AdditionalTaxCode2": "<string>",
"AdditionalTaxRate2": 123,
"AdditionalTaxAmount2": 123,
"AdditionalTaxBase2": 123,
"AdditionalTaxCode3": "<string>",
"AdditionalTaxRate3": 123,
"AdditionalTaxAmount3": 123,
"AdditionalTaxBase3": 123,
"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."
}
]
}Update order
Replaces all fields and lines of the order.
curl --request PUT \
--url https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"OrderType": 2,
"OrderNumber": "9446A4D834",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"CurrencyCode": "TRY",
"DueDays": 30,
"DeliveryDate": "2023-11-07T05:31:56Z",
"SharingCode": "<string>",
"DiscountTotal": 0,
"SubTotal": 1000,
"VatTotal": 200,
"AdditionalTaxTotal": 0,
"WithholdingTotal": 0,
"GrandTotal": 1200,
"AverageExchangeRate": 1,
"CreateCustomerMovement": true,
"Lines": [
{
"ProductCode": "URN-0001",
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 0,
"DiscountAmount": 0,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": false,
"VatAmount": 123,
"AmountExcludingTax": 123,
"AmountIncludingTax": 123,
"VatBase": 123,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2023-11-07T05:31:56Z",
"AdditionalTaxCode1": "<string>",
"AdditionalTaxRate1": 123,
"AdditionalTaxAmount1": 123,
"AdditionalTaxBase1": 123,
"AdditionalTaxCode2": "<string>",
"AdditionalTaxRate2": 123,
"AdditionalTaxAmount2": 123,
"AdditionalTaxBase2": 123,
"AdditionalTaxCode3": "<string>",
"AdditionalTaxRate3": 123,
"AdditionalTaxAmount3": 123,
"AdditionalTaxBase3": 123,
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123
}
]
}
'using RestSharp;
var options = new RestClientOptions("https://dev.noyax.com/services/noyax_api/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("{\n \"OrderType\": 2,\n \"OrderNumber\": \"9446A4D834\",\n \"DocumentNumber\": \"2026-15\",\n \"Date\": \"2026-09-21T10:30:00\",\n \"Description\": \"<string>\",\n \"CustomerCode\": \"C-0001\",\n \"CurrencyCode\": \"TRY\",\n \"DueDays\": 30,\n \"DeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"SharingCode\": \"<string>\",\n \"DiscountTotal\": 0,\n \"SubTotal\": 1000,\n \"VatTotal\": 200,\n \"AdditionalTaxTotal\": 0,\n \"WithholdingTotal\": 0,\n \"GrandTotal\": 1200,\n \"AverageExchangeRate\": 1,\n \"CreateCustomerMovement\": true,\n \"Lines\": [\n {\n \"ProductCode\": \"URN-0001\",\n \"UnitCode\": \"C62\",\n \"Quantity\": 10,\n \"UnitPrice\": 100,\n \"CurrencyCode\": \"TRY\",\n \"ExchangeRate\": 1,\n \"DiscountRate\": 0,\n \"DiscountAmount\": 0,\n \"Discounts\": [\n {\n \"Rate\": 10\n }\n ],\n \"VatRate\": 20,\n \"VatIncluded\": false,\n \"VatAmount\": 123,\n \"AmountExcludingTax\": 123,\n \"AmountIncludingTax\": 123,\n \"VatBase\": 123,\n \"VatExemptionCode\": \"<string>\",\n \"LineGroupName\": \"<string>\",\n \"WarehouseName\": \"<string>\",\n \"Description\": \"<string>\",\n \"Description2\": \"<string>\",\n \"DeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"AdditionalTaxCode1\": \"<string>\",\n \"AdditionalTaxRate1\": 123,\n \"AdditionalTaxAmount1\": 123,\n \"AdditionalTaxBase1\": 123,\n \"AdditionalTaxCode2\": \"<string>\",\n \"AdditionalTaxRate2\": 123,\n \"AdditionalTaxAmount2\": 123,\n \"AdditionalTaxBase2\": 123,\n \"AdditionalTaxCode3\": \"<string>\",\n \"AdditionalTaxRate3\": 123,\n \"AdditionalTaxAmount3\": 123,\n \"AdditionalTaxBase3\": 123,\n \"WithholdingCode\": \"<string>\",\n \"WithholdingNumerator\": 123,\n \"WithholdingDenominator\": 123,\n \"WithheldVatAmount\": 123\n }\n ]\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({
OrderType: 2,
OrderNumber: '9446A4D834',
DocumentNumber: '2026-15',
Date: '2026-09-21T10:30:00',
Description: '<string>',
CustomerCode: 'C-0001',
CurrencyCode: 'TRY',
DueDays: 30,
DeliveryDate: '2023-11-07T05:31:56Z',
SharingCode: '<string>',
DiscountTotal: 0,
SubTotal: 1000,
VatTotal: 200,
AdditionalTaxTotal: 0,
WithholdingTotal: 0,
GrandTotal: 1200,
AverageExchangeRate: 1,
CreateCustomerMovement: true,
Lines: [
{
ProductCode: 'URN-0001',
UnitCode: 'C62',
Quantity: 10,
UnitPrice: 100,
CurrencyCode: 'TRY',
ExchangeRate: 1,
DiscountRate: 0,
DiscountAmount: 0,
Discounts: [{Rate: 10}],
VatRate: 20,
VatIncluded: false,
VatAmount: 123,
AmountExcludingTax: 123,
AmountIncludingTax: 123,
VatBase: 123,
VatExemptionCode: '<string>',
LineGroupName: '<string>',
WarehouseName: '<string>',
Description: '<string>',
Description2: '<string>',
DeliveryDate: '2023-11-07T05:31:56Z',
AdditionalTaxCode1: '<string>',
AdditionalTaxRate1: 123,
AdditionalTaxAmount1: 123,
AdditionalTaxBase1: 123,
AdditionalTaxCode2: '<string>',
AdditionalTaxRate2: 123,
AdditionalTaxAmount2: 123,
AdditionalTaxBase2: 123,
AdditionalTaxCode3: '<string>',
AdditionalTaxRate3: 123,
AdditionalTaxAmount3: 123,
AdditionalTaxBase3: 123,
WithholdingCode: '<string>',
WithholdingNumerator: 123,
WithholdingDenominator: 123,
WithheldVatAmount: 123
}
]
})
};
fetch('https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId}"
payload = {
"OrderType": 2,
"OrderNumber": "9446A4D834",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"CurrencyCode": "TRY",
"DueDays": 30,
"DeliveryDate": "2023-11-07T05:31:56Z",
"SharingCode": "<string>",
"DiscountTotal": 0,
"SubTotal": 1000,
"VatTotal": 200,
"AdditionalTaxTotal": 0,
"WithholdingTotal": 0,
"GrandTotal": 1200,
"AverageExchangeRate": 1,
"CreateCustomerMovement": True,
"Lines": [
{
"ProductCode": "URN-0001",
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 0,
"DiscountAmount": 0,
"Discounts": [{ "Rate": 10 }],
"VatRate": 20,
"VatIncluded": False,
"VatAmount": 123,
"AmountExcludingTax": 123,
"AmountIncludingTax": 123,
"VatBase": 123,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2023-11-07T05:31:56Z",
"AdditionalTaxCode1": "<string>",
"AdditionalTaxRate1": 123,
"AdditionalTaxAmount1": 123,
"AdditionalTaxBase1": 123,
"AdditionalTaxCode2": "<string>",
"AdditionalTaxRate2": 123,
"AdditionalTaxAmount2": 123,
"AdditionalTaxBase2": 123,
"AdditionalTaxCode3": "<string>",
"AdditionalTaxRate3": 123,
"AdditionalTaxAmount3": 123,
"AdditionalTaxBase3": 123,
"WithholdingCode": "<string>",
"WithholdingNumerator": 123,
"WithholdingDenominator": 123,
"WithheldVatAmount": 123
}
]
}
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",
"CustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"StatusName": "<string>",
"CustomerName": "<string>",
"OrderType": 2,
"OrderNumber": "9446A4D834",
"DocumentNumber": "2026-15",
"Date": "2026-09-21T10:30:00",
"Description": "<string>",
"CustomerCode": "C-0001",
"CurrencyCode": "TRY",
"DueDays": 30,
"DeliveryDate": "2023-11-07T05:31:56Z",
"SharingCode": "<string>",
"DiscountTotal": 0,
"SubTotal": 1000,
"VatTotal": 200,
"AdditionalTaxTotal": 0,
"WithholdingTotal": 0,
"GrandTotal": 1200,
"AverageExchangeRate": 1,
"CreateCustomerMovement": true,
"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",
"UnitCode": "C62",
"Quantity": 10,
"UnitPrice": 100,
"CurrencyCode": "TRY",
"ExchangeRate": 1,
"DiscountRate": 0,
"DiscountAmount": 0,
"Discounts": [
{
"Rate": 10
}
],
"VatRate": 20,
"VatIncluded": false,
"VatAmount": 123,
"AmountExcludingTax": 123,
"AmountIncludingTax": 123,
"VatBase": 123,
"VatExemptionCode": "<string>",
"LineGroupName": "<string>",
"WarehouseName": "<string>",
"Description": "<string>",
"Description2": "<string>",
"DeliveryDate": "2023-11-07T05:31:56Z",
"AdditionalTaxCode1": "<string>",
"AdditionalTaxRate1": 123,
"AdditionalTaxAmount1": 123,
"AdditionalTaxBase1": 123,
"AdditionalTaxCode2": "<string>",
"AdditionalTaxRate2": 123,
"AdditionalTaxAmount2": 123,
"AdditionalTaxBase2": 123,
"AdditionalTaxCode3": "<string>",
"AdditionalTaxRate3": 123,
"AdditionalTaxAmount3": 123,
"AdditionalTaxBase3": 123,
"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."
}
]
}PATCH changes only the fields you send.
The update is a full replacement and the lines are replaced too: the order’s existing lines are removed and the lines in the request are saved instead (all in a single transaction). Send every line you want to keep on the order.
OrderTypecannot be changed while the order has a customer movement (6015) andOrderNumbercannot be"Next"(6003).CreateCustomerMovementdecides the customer movement:truecreates it or brings it in line with the order,falseremoves an existing one. A movement closed by a collection or payment cannot be changed or removed (6016,6017). See customer movement.- Approvals and status do not change.
- The API does not calculate amounts; send the totals as your system calculated them.
Error codes
Codes this endpoint can return. The general errors that apply to every endpoint (authentication, permissions, request headers, daily limit) are not repeated here.| Code | HTTP | Meaning |
|---|---|---|
0002 | 400 | Request body could not be read (malformed JSON, wrong field type) |
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 |
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 |
6009 | 400 | CurrencyCode is required |
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 while the order has a customer movement |
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 |
6101 | 400 | ProductCode 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 cannot be negative |
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 |
6201 | 400 | The Rate of a discount must be between 0 and 100 |
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 >= 1Path Parameters
Order ID.
Body
Required. 1: Purchase order (placed with a supplier), 2: Sales order (received from a customer). Cannot be changed after the order is created.
2
Required. Order number, unique within the company for the same OrderType. Send "Next" on create to generate it from the company's order number series for the type. At most 10 characters.
"9446A4D834"
Document number (free text). At most 20 characters.
"2026-15"
Required. Order date. The date part is stored as the order date; if a time is sent it is stored as the order time, otherwise the current time is used.
"2026-09-21T10:30:00"
Description. At most 1000 characters.
Required. Customer code (the customer's CustomerCode from GET /api/v1/customers). The order is written with the customer's address: the invoice address when the customer has one, otherwise the first address.
"C-0001"
Required. Currency code from GET /api/v1/definitions/currencies. It is also the currency of the customer movement when CreateCustomerMovement is true.
"TRY"
Payment term in days. Cannot be less than 0. When CreateCustomerMovement is true, the customer movement is due Date + DueDays (no due date when 0).
30
Delivery date.
Sharing code that limits who can see the order. Empty means visible to everyone; otherwise it must be one of the user's sharing codes.
Total discount amount. Sent by the integrator, not calculated by the API.
0
Subtotal (sum of the line amounts excluding taxes). Sent by the integrator, not calculated by the API.
1000
Total VAT amount. Sent by the integrator, not calculated by the API.
200
Total additional tax amount. Sent by the integrator, not calculated by the API.
0
Total withholding (tevkifat) amount. Sent by the integrator, not calculated by the API.
0
Grand total. Sent by the integrator, not calculated by the API. When CreateCustomerMovement is true, it is the amount of the customer movement.
1200
Weighted average exchange rate of the lines. Sent by the integrator, not calculated by the API. Use 1 when everything is in the company's default currency. It is also the exchange rate of the customer movement when CreateCustomerMovement is true.
1
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
Required, at least one line. On update the lines are replaced: the order's existing lines are removed and these are saved instead.
Show child attributes
Show child attributes
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"
Response data. Null when Success is false.
Show child attributes
Show child attributes
Error message when Success is false. Messages of all errors are joined into a single text.