curl --request PATCH \
--url https://api.noyax.com/api/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"CustomerCode": "0000382026",
"Name": "Örnek Ticaret A.Ş.",
"TaxNumber": "1234567890",
"TaxOffice": "Kadıköy",
"InvoiceTitle": "Örnek Ticaret Anonim Şirketi",
"Note": "Deliveries on weekdays only.",
"DueDays": 30,
"DiscountRate": 5,
"Blacklisted": false,
"MovementType": 2,
"RiskLimit": 250000,
"RiskControl": 1,
"RiskAction": 1,
"EInvoiceUser": true,
"EInvoiceScenario": 1,
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"SharingCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ShowNoteOnQuote": false,
"ShowNoteOnOrder": false,
"ShowNoteOnWaybill": true,
"ShowNoteOnInvoice": false,
"IdentitySchemes": [
{
"SchemeID": "MERSISNO",
"Value": "0123456789000015"
}
]
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/customers/{customerId}");
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 \"CustomerCode\": \"0000382026\",\n \"Name\": \"Örnek Ticaret A.Ş.\",\n \"TaxNumber\": \"1234567890\",\n \"TaxOffice\": \"Kadıköy\",\n \"InvoiceTitle\": \"Örnek Ticaret Anonim Şirketi\",\n \"Note\": \"Deliveries on weekdays only.\",\n \"DueDays\": 30,\n \"DiscountRate\": 5,\n \"Blacklisted\": false,\n \"MovementType\": 2,\n \"RiskLimit\": 250000,\n \"RiskControl\": 1,\n \"RiskAction\": 1,\n \"EInvoiceUser\": true,\n \"EInvoiceScenario\": 1,\n \"ShipmentDefinitionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"SharingCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ShowNoteOnQuote\": false,\n \"ShowNoteOnOrder\": false,\n \"ShowNoteOnWaybill\": true,\n \"ShowNoteOnInvoice\": false,\n \"IdentitySchemes\": [\n {\n \"SchemeID\": \"MERSISNO\",\n \"Value\": \"0123456789000015\"\n }\n ]\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({
CustomerCode: '0000382026',
Name: 'Örnek Ticaret A.Ş.',
TaxNumber: '1234567890',
TaxOffice: 'Kadıköy',
InvoiceTitle: 'Örnek Ticaret Anonim Şirketi',
Note: 'Deliveries on weekdays only.',
DueDays: 30,
DiscountRate: 5,
Blacklisted: false,
MovementType: 2,
RiskLimit: 250000,
RiskControl: 1,
RiskAction: 1,
EInvoiceUser: true,
EInvoiceScenario: 1,
ShipmentDefinitionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
SharingCodeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ShowNoteOnQuote: false,
ShowNoteOnOrder: false,
ShowNoteOnWaybill: true,
ShowNoteOnInvoice: false,
IdentitySchemes: [{SchemeID: 'MERSISNO', Value: '0123456789000015'}]
})
};
fetch('https://api.noyax.com/api/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/customers/{customerId}"
payload = {
"CustomerCode": "0000382026",
"Name": "Örnek Ticaret A.Ş.",
"TaxNumber": "1234567890",
"TaxOffice": "Kadıköy",
"InvoiceTitle": "Örnek Ticaret Anonim Şirketi",
"Note": "Deliveries on weekdays only.",
"DueDays": 30,
"DiscountRate": 5,
"Blacklisted": False,
"MovementType": 2,
"RiskLimit": 250000,
"RiskControl": 1,
"RiskAction": 1,
"EInvoiceUser": True,
"EInvoiceScenario": 1,
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"SharingCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ShowNoteOnQuote": False,
"ShowNoteOnOrder": False,
"ShowNoteOnWaybill": True,
"ShowNoteOnInvoice": False,
"IdentitySchemes": [
{
"SchemeID": "MERSISNO",
"Value": "0123456789000015"
}
]
}
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",
"CustomerCode": "0000382026",
"Name": "Örnek Ticaret A.Ş.",
"TaxNumber": "1234567890",
"TaxOffice": "Kadıköy",
"InvoiceTitle": "Örnek Ticaret Anonim Şirketi",
"Note": "Deliveries on weekdays only.",
"DueDays": 30,
"DiscountRate": 5,
"Blacklisted": false,
"MovementType": 2,
"RiskLimit": 250000,
"RiskControl": 1,
"RiskAction": 1,
"EInvoiceUser": true,
"EInvoiceScenario": 1,
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"SharingCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ShowNoteOnQuote": false,
"ShowNoteOnOrder": false,
"ShowNoteOnWaybill": true,
"ShowNoteOnInvoice": false,
"IdentitySchemes": [
{
"SchemeID": "MERSISNO",
"Value": "0123456789000015"
}
],
"CreateDate": "2023-11-07T05:31:56Z",
"ModifyDate": "2023-11-07T05:31:56Z"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "1002",
"Message": "CustomerCode '0000382026' is already used in this company.",
"Errors": [
{
"Code": "1002",
"Message": "CustomerCode '0000382026' is already used in this company."
}
]
}{
"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": "1000",
"Message": "Customer not found.",
"Errors": [
{
"Code": "1000",
"Message": "Customer not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Partially update customer
Changes only the sent fields of a customer.
curl --request PATCH \
--url https://api.noyax.com/api/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"CustomerCode": "0000382026",
"Name": "Örnek Ticaret A.Ş.",
"TaxNumber": "1234567890",
"TaxOffice": "Kadıköy",
"InvoiceTitle": "Örnek Ticaret Anonim Şirketi",
"Note": "Deliveries on weekdays only.",
"DueDays": 30,
"DiscountRate": 5,
"Blacklisted": false,
"MovementType": 2,
"RiskLimit": 250000,
"RiskControl": 1,
"RiskAction": 1,
"EInvoiceUser": true,
"EInvoiceScenario": 1,
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"SharingCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ShowNoteOnQuote": false,
"ShowNoteOnOrder": false,
"ShowNoteOnWaybill": true,
"ShowNoteOnInvoice": false,
"IdentitySchemes": [
{
"SchemeID": "MERSISNO",
"Value": "0123456789000015"
}
]
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/customers/{customerId}");
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 \"CustomerCode\": \"0000382026\",\n \"Name\": \"Örnek Ticaret A.Ş.\",\n \"TaxNumber\": \"1234567890\",\n \"TaxOffice\": \"Kadıköy\",\n \"InvoiceTitle\": \"Örnek Ticaret Anonim Şirketi\",\n \"Note\": \"Deliveries on weekdays only.\",\n \"DueDays\": 30,\n \"DiscountRate\": 5,\n \"Blacklisted\": false,\n \"MovementType\": 2,\n \"RiskLimit\": 250000,\n \"RiskControl\": 1,\n \"RiskAction\": 1,\n \"EInvoiceUser\": true,\n \"EInvoiceScenario\": 1,\n \"ShipmentDefinitionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"SharingCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ShowNoteOnQuote\": false,\n \"ShowNoteOnOrder\": false,\n \"ShowNoteOnWaybill\": true,\n \"ShowNoteOnInvoice\": false,\n \"IdentitySchemes\": [\n {\n \"SchemeID\": \"MERSISNO\",\n \"Value\": \"0123456789000015\"\n }\n ]\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({
CustomerCode: '0000382026',
Name: 'Örnek Ticaret A.Ş.',
TaxNumber: '1234567890',
TaxOffice: 'Kadıköy',
InvoiceTitle: 'Örnek Ticaret Anonim Şirketi',
Note: 'Deliveries on weekdays only.',
DueDays: 30,
DiscountRate: 5,
Blacklisted: false,
MovementType: 2,
RiskLimit: 250000,
RiskControl: 1,
RiskAction: 1,
EInvoiceUser: true,
EInvoiceScenario: 1,
ShipmentDefinitionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
SharingCodeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ShowNoteOnQuote: false,
ShowNoteOnOrder: false,
ShowNoteOnWaybill: true,
ShowNoteOnInvoice: false,
IdentitySchemes: [{SchemeID: 'MERSISNO', Value: '0123456789000015'}]
})
};
fetch('https://api.noyax.com/api/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/customers/{customerId}"
payload = {
"CustomerCode": "0000382026",
"Name": "Örnek Ticaret A.Ş.",
"TaxNumber": "1234567890",
"TaxOffice": "Kadıköy",
"InvoiceTitle": "Örnek Ticaret Anonim Şirketi",
"Note": "Deliveries on weekdays only.",
"DueDays": 30,
"DiscountRate": 5,
"Blacklisted": False,
"MovementType": 2,
"RiskLimit": 250000,
"RiskControl": 1,
"RiskAction": 1,
"EInvoiceUser": True,
"EInvoiceScenario": 1,
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"SharingCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ShowNoteOnQuote": False,
"ShowNoteOnOrder": False,
"ShowNoteOnWaybill": True,
"ShowNoteOnInvoice": False,
"IdentitySchemes": [
{
"SchemeID": "MERSISNO",
"Value": "0123456789000015"
}
]
}
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",
"CustomerCode": "0000382026",
"Name": "Örnek Ticaret A.Ş.",
"TaxNumber": "1234567890",
"TaxOffice": "Kadıköy",
"InvoiceTitle": "Örnek Ticaret Anonim Şirketi",
"Note": "Deliveries on weekdays only.",
"DueDays": 30,
"DiscountRate": 5,
"Blacklisted": false,
"MovementType": 2,
"RiskLimit": 250000,
"RiskControl": 1,
"RiskAction": 1,
"EInvoiceUser": true,
"EInvoiceScenario": 1,
"ShipmentDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"SharingCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ShowNoteOnQuote": false,
"ShowNoteOnOrder": false,
"ShowNoteOnWaybill": true,
"ShowNoteOnInvoice": false,
"IdentitySchemes": [
{
"SchemeID": "MERSISNO",
"Value": "0123456789000015"
}
],
"CreateDate": "2023-11-07T05:31:56Z",
"ModifyDate": "2023-11-07T05:31:56Z"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "1002",
"Message": "CustomerCode '0000382026' is already used in this company.",
"Errors": [
{
"Code": "1002",
"Message": "CustomerCode '0000382026' is already used in this company."
}
]
}{
"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": "1000",
"Message": "Customer not found.",
"Errors": [
{
"Code": "1000",
"Message": "Customer 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 stays unchanged, a field sent as
nullis cleared. - Validation runs on the whole merged record; setting a required field to
nullis rejected. - Sub-records (addresses, telephones, bank accounts, …) are not changed here; use their own endpoints.
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
Customer ID.
Body
Required. Unique within the company. Send "Next" on create to generate the code from the company's customer number series.
"0000382026"
Required. Customer name.
"Örnek Ticaret A.Ş."
Required. Digits only: 10 digits for a tax number (VKN) or 11 digits for a national ID number (TCKN).
"1234567890"
Tax office name.
"Kadıköy"
Title used on invoices. If empty, Name is used.
"Örnek Ticaret Anonim Şirketi"
Free text note. Required when any ShowNoteOn* field is true.
"Deliveries on weekdays only."
Payment term in days. Cannot be less than 0.
30
Default discount rate (%) between 0 and 100.
5
Marks the customer as blacklisted.
false
1: Supplier, 2: Buyer, 3: Supplier and buyer. 0 is saved as 1.
2
Risk limit amount. Cannot be less than 0. 0 means no risk limit.
250000
How the risk limit is checked. 1: Current balance, 2: Sales amount. Must be 1 or 2 when RiskLimit is greater than 0.
1
What happens when the risk limit is exceeded. 0: Continue, 1: Warn the user, 2: Stop the operation.
1
Whether the customer is a registered e-invoice user.
true
E-invoice scenario. Must be 1-9 when EInvoiceUser is true, 0 otherwise. 1: Commercial, 2: Basic, 3: Export, 4: Public, 5: HKS, 6: Energy, 7: Pharmaceutical/Medical device, 8: Investment incentive, 9: IDIS.
1
ID of a shipment definition from GET /api/v1/definitions/shipment-definitions.
Sharing code that limits who can see the customer. Empty means visible to everyone; otherwise it must be one of the user's sharing codes.
Show the note on quotes.
false
Show the note on orders.
false
Show the note on waybills.
true
Show the note on invoices.
false
Additional identifiers (e.g. MERSISNO). Each SchemeID can be sent only once.
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"
Show child attributes
Show child attributes
Error message when Success is false. Messages of all errors are joined into a single text.