Delete despatch
curl --request DELETE \
--url https://api.noyax.com/api/v1/despatches/{despatchId} \
--header 'Authorization: Bearer <token>' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/despatches/{despatchId}");
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://api.noyax.com/api/v1/despatches/{despatchId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/despatches/{despatchId}"
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"Success": false,
"ResultCode": "7014",
"Message": "The despatch cannot be deleted because it is used by other records.",
"Errors": [
{
"Code": "7014",
"Message": "The despatch cannot be deleted because it is used by other records."
}
]
}{
"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": "7000",
"Message": "Despatch not found.",
"Errors": [
{
"Code": "7000",
"Message": "Despatch not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Despatches
Delete despatch
Deletes the despatch and its lines.
DELETE
/
api
/
v1
/
despatches
/
{despatchId}
Delete despatch
curl --request DELETE \
--url https://api.noyax.com/api/v1/despatches/{despatchId} \
--header 'Authorization: Bearer <token>' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/despatches/{despatchId}");
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://api.noyax.com/api/v1/despatches/{despatchId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/despatches/{despatchId}"
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"Success": false,
"ResultCode": "7014",
"Message": "The despatch cannot be deleted because it is used by other records.",
"Errors": [
{
"Code": "7014",
"Message": "The despatch cannot be deleted because it is used by other records."
}
]
}{
"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": "7000",
"Message": "Despatch not found.",
"Errors": [
{
"Code": "7000",
"Message": "Despatch not found."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Deletes the despatch and its lines. A Lot that has already been consumed by an outbound transaction, or a serial number that has already been dispatched, blocks the deletion of the line it belongs to (delete the consuming despatch first). A despatch referenced by other records cannot be deleted either.
A despatch that has already been sent as an e-Despatch cannot be deleted (
7019).
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 |
|---|---|---|
4401 | 400 | The operation would drop the stock below the product’s minimum stock in that warehouse (critical stock set to stop the operation) |
4402 | 400 | The operation would make the product’s stock negative in that warehouse (critical stock set to stop the operation) |
4403 | 400 | The operation would raise the stock above the product’s maximum stock in that warehouse (critical stock set to stop the operation) |
7000 | 404 | Despatch not found |
7014 | 400 | The despatch cannot be deleted because other records refer to it |
7019 | 400 | The despatch has already been sent as an e-Despatch and cannot be deleted |
7304 | 400 | The lot has already been used in an outbound transaction, so the operation (delete/update) was cancelled |
7404 | 400 | The serial number cannot be removed because it has already been dispatched |
Authorizations
Headers
Response
No Content