Siparişi sil
curl --request DELETE \
--url https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>'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>");
var response = await client.DeleteAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'DELETE',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>'
}
};
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}"
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"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."
}
]
}Siparişler
Siparişi sil
Siparişi, satırlarını ve cari hareketini siler.
DELETE
/
api
/
v1
/
orders
/
{orderId}
Siparişi sil
curl --request DELETE \
--url https://dev.noyax.com/services/noyax_api/api/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>'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>");
var response = await client.DeleteAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'DELETE',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>'
}
};
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}"
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"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."
}
]
}Siparişi, satırlarını, otomatik atanan onay ve durum kayıtlarını ve varsa cari hareketini siler. Cari hareketi bir tahsilat ya da ödemeyle kapatılmış sipariş silinemez (
6016, 6017). Başka kayıtların (örneğin bir teklif ya da fırsat) bağlı olduğu sipariş de silinemez (6014). Duruma göre başka bir kısıt yoktur: bkz. düzenleme ve silme.
Hata kodları
Bu endpoint’in dönebileceği kodlar. Her endpoint için geçerli olan genel hatalar (kimlik doğrulama, yetki, istek header’ları, günlük limit) burada tekrarlanmaz.| Kod | HTTP | Anlamı |
|---|---|---|
6000 | 404 | Sipariş bulunamadı |
6014 | 400 | Başka kayıtlar (teklif, fırsat, …) bu siparişe bağlı olduğu için sipariş silinemez |
6016 | 400 | Alış siparişinin carinin hesabında oluşturduğu alacak kaydı bir ödeme ile kapatılmış; siparişin cari hareketi değiştirilemez ya da silinemez |
6017 | 400 | Satış siparişinin carinin hesabında oluşturduğu borç kaydı bir tahsilat ile kapatılmış; siparişin cari hareketi değiştirilemez ya da silinemez |
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.
Gerekli aralık:
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.
Gerekli aralık:
x >= 1Muhasebe döneminin ID'si. Cari endpoint'lerinde isteğe bağlıdır; gönderilirse oluşturulan kayıtlara yazılır.
Gerekli aralık:
x >= 1Yol Parametreleri
Sipariş ID'si.
Yanıt
No Content