curl --request POST \
--url https://api.noyax.com/api/v1/definitions/shipment-definitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"Code": "5469",
"Description": "Istanbul road shipments",
"TransportMode": 1,
"TransportInfo1": "34ABC123",
"TransportInfo2": "<string>",
"CarrierName": "Example Logistics Ltd.",
"CarrierTaxNumber": "1234567890",
"CarrierCity": "ISTANBUL",
"CarrierDistrict": "KADIKÖY",
"CarrierCountry": "TÜRKİYE",
"Driver1FirstName": "Ahmet",
"Driver1LastName": "Kaya",
"Driver1IdentityNumber": "12345678901",
"Driver2FirstName": "<string>",
"Driver2LastName": "<string>",
"Driver2IdentityNumber": "<string>",
"TrailerPlate1": "34ABC123",
"TrailerPlate2": "<string>"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/definitions/shipment-definitions");
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 \"Code\": \"5469\",\n \"Description\": \"Istanbul road shipments\",\n \"TransportMode\": 1,\n \"TransportInfo1\": \"34ABC123\",\n \"TransportInfo2\": \"<string>\",\n \"CarrierName\": \"Example Logistics Ltd.\",\n \"CarrierTaxNumber\": \"1234567890\",\n \"CarrierCity\": \"ISTANBUL\",\n \"CarrierDistrict\": \"KADIKÖY\",\n \"CarrierCountry\": \"TÜRKİYE\",\n \"Driver1FirstName\": \"Ahmet\",\n \"Driver1LastName\": \"Kaya\",\n \"Driver1IdentityNumber\": \"12345678901\",\n \"Driver2FirstName\": \"<string>\",\n \"Driver2LastName\": \"<string>\",\n \"Driver2IdentityNumber\": \"<string>\",\n \"TrailerPlate1\": \"34ABC123\",\n \"TrailerPlate2\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Code: '5469',
Description: 'Istanbul road shipments',
TransportMode: 1,
TransportInfo1: '34ABC123',
TransportInfo2: '<string>',
CarrierName: 'Example Logistics Ltd.',
CarrierTaxNumber: '1234567890',
CarrierCity: 'ISTANBUL',
CarrierDistrict: 'KADIKÖY',
CarrierCountry: 'TÜRKİYE',
Driver1FirstName: 'Ahmet',
Driver1LastName: 'Kaya',
Driver1IdentityNumber: '12345678901',
Driver2FirstName: '<string>',
Driver2LastName: '<string>',
Driver2IdentityNumber: '<string>',
TrailerPlate1: '34ABC123',
TrailerPlate2: '<string>'
})
};
fetch('https://api.noyax.com/api/v1/definitions/shipment-definitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/definitions/shipment-definitions"
payload = {
"Code": "5469",
"Description": "Istanbul road shipments",
"TransportMode": 1,
"TransportInfo1": "34ABC123",
"TransportInfo2": "<string>",
"CarrierName": "Example Logistics Ltd.",
"CarrierTaxNumber": "1234567890",
"CarrierCity": "ISTANBUL",
"CarrierDistrict": "KADIKÖY",
"CarrierCountry": "TÜRKİYE",
"Driver1FirstName": "Ahmet",
"Driver1LastName": "Kaya",
"Driver1IdentityNumber": "12345678901",
"Driver2FirstName": "<string>",
"Driver2LastName": "<string>",
"Driver2IdentityNumber": "<string>",
"TrailerPlate1": "34ABC123",
"TrailerPlate2": "<string>"
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Code": "5469",
"Description": "Istanbul road shipments",
"TransportMode": 1,
"TransportInfo1": "34ABC123",
"TransportInfo2": "<string>",
"CarrierName": "Example Logistics Ltd.",
"CarrierTaxNumber": "1234567890",
"CarrierCity": "ISTANBUL",
"CarrierDistrict": "KADIKÖY",
"CarrierCountry": "TÜRKİYE",
"Driver1FirstName": "Ahmet",
"Driver1LastName": "Kaya",
"Driver1IdentityNumber": "12345678901",
"Driver2FirstName": "<string>",
"Driver2LastName": "<string>",
"Driver2IdentityNumber": "<string>",
"TrailerPlate1": "34ABC123",
"TrailerPlate2": "<string>"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "0537",
"Message": "Driver1FirstName, Driver1LastName and Driver1IdentityNumber are required when no carrier company is used.",
"Errors": [
{
"Code": "0537",
"Message": "Driver1FirstName, Driver1LastName and Driver1IdentityNumber are required when no carrier company is used."
}
]
}{
"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": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Create shipment definition
Adds a shipment definition.
curl --request POST \
--url https://api.noyax.com/api/v1/definitions/shipment-definitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"Code": "5469",
"Description": "Istanbul road shipments",
"TransportMode": 1,
"TransportInfo1": "34ABC123",
"TransportInfo2": "<string>",
"CarrierName": "Example Logistics Ltd.",
"CarrierTaxNumber": "1234567890",
"CarrierCity": "ISTANBUL",
"CarrierDistrict": "KADIKÖY",
"CarrierCountry": "TÜRKİYE",
"Driver1FirstName": "Ahmet",
"Driver1LastName": "Kaya",
"Driver1IdentityNumber": "12345678901",
"Driver2FirstName": "<string>",
"Driver2LastName": "<string>",
"Driver2IdentityNumber": "<string>",
"TrailerPlate1": "34ABC123",
"TrailerPlate2": "<string>"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/definitions/shipment-definitions");
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 \"Code\": \"5469\",\n \"Description\": \"Istanbul road shipments\",\n \"TransportMode\": 1,\n \"TransportInfo1\": \"34ABC123\",\n \"TransportInfo2\": \"<string>\",\n \"CarrierName\": \"Example Logistics Ltd.\",\n \"CarrierTaxNumber\": \"1234567890\",\n \"CarrierCity\": \"ISTANBUL\",\n \"CarrierDistrict\": \"KADIKÖY\",\n \"CarrierCountry\": \"TÜRKİYE\",\n \"Driver1FirstName\": \"Ahmet\",\n \"Driver1LastName\": \"Kaya\",\n \"Driver1IdentityNumber\": \"12345678901\",\n \"Driver2FirstName\": \"<string>\",\n \"Driver2LastName\": \"<string>\",\n \"Driver2IdentityNumber\": \"<string>\",\n \"TrailerPlate1\": \"34ABC123\",\n \"TrailerPlate2\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Code: '5469',
Description: 'Istanbul road shipments',
TransportMode: 1,
TransportInfo1: '34ABC123',
TransportInfo2: '<string>',
CarrierName: 'Example Logistics Ltd.',
CarrierTaxNumber: '1234567890',
CarrierCity: 'ISTANBUL',
CarrierDistrict: 'KADIKÖY',
CarrierCountry: 'TÜRKİYE',
Driver1FirstName: 'Ahmet',
Driver1LastName: 'Kaya',
Driver1IdentityNumber: '12345678901',
Driver2FirstName: '<string>',
Driver2LastName: '<string>',
Driver2IdentityNumber: '<string>',
TrailerPlate1: '34ABC123',
TrailerPlate2: '<string>'
})
};
fetch('https://api.noyax.com/api/v1/definitions/shipment-definitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/definitions/shipment-definitions"
payload = {
"Code": "5469",
"Description": "Istanbul road shipments",
"TransportMode": 1,
"TransportInfo1": "34ABC123",
"TransportInfo2": "<string>",
"CarrierName": "Example Logistics Ltd.",
"CarrierTaxNumber": "1234567890",
"CarrierCity": "ISTANBUL",
"CarrierDistrict": "KADIKÖY",
"CarrierCountry": "TÜRKİYE",
"Driver1FirstName": "Ahmet",
"Driver1LastName": "Kaya",
"Driver1IdentityNumber": "12345678901",
"Driver2FirstName": "<string>",
"Driver2LastName": "<string>",
"Driver2IdentityNumber": "<string>",
"TrailerPlate1": "34ABC123",
"TrailerPlate2": "<string>"
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Code": "5469",
"Description": "Istanbul road shipments",
"TransportMode": 1,
"TransportInfo1": "34ABC123",
"TransportInfo2": "<string>",
"CarrierName": "Example Logistics Ltd.",
"CarrierTaxNumber": "1234567890",
"CarrierCity": "ISTANBUL",
"CarrierDistrict": "KADIKÖY",
"CarrierCountry": "TÜRKİYE",
"Driver1FirstName": "Ahmet",
"Driver1LastName": "Kaya",
"Driver1IdentityNumber": "12345678901",
"Driver2FirstName": "<string>",
"Driver2LastName": "<string>",
"Driver2IdentityNumber": "<string>",
"TrailerPlate1": "34ABC123",
"TrailerPlate2": "<string>"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "0537",
"Message": "Driver1FirstName, Driver1LastName and Driver1IdentityNumber are required when no carrier company is used.",
"Errors": [
{
"Code": "0537",
"Message": "Driver1FirstName, Driver1LastName and Driver1IdentityNumber are required when no carrier company is used."
}
]
}{
"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": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Codeis required and must be unique within the company.TransportModeis required and must be one of the values below.TransportInfo1is required; its meaning depends on the transport mode (below).- A shipment is made either by a carrier company or with your own vehicle; the rules are below.
TransportInfo1is required; its meaning depends on the transport mode (below).- A shipment is made either by a carrier company or with your own vehicle; the rules are below.
- Other fields are optional free text; the maximum length of each field is in its description. Longer values are rejected with
0003.
TransportInfo1 and TransportInfo2 mean depends on the transport mode; the Noyax screen changes the labels of these fields accordingly. The values are written to the e-despatch advice as transport information.
TransportMode | Transport mode | TransportInfo1 (required) | TransportInfo2 |
|---|---|---|---|
1 | Road | License plate | — |
2 | Rail | Train number | Rail car number |
3 | Maritime | Vessel name | IMO number |
4 | Air | Aircraft number | — |
TransportInfo2 is not stored even if sent.
Carrier company or your own vehicle?
A shipment is made either by a carrier company or with the company’s own vehicle. The API does not have a separate field for this; it decides by whether the carrier company fields are filled:- Own vehicle
- Carrier company
CarrierName, CarrierTaxNumber, CarrierCity, CarrierDistrict, CarrierCountry) empty.Driver1FirstName,Driver1LastNameandDriver1IdentityNumberare required (0537).Driver2*fields are optional.- Trailer plates are stored only for road transport (
TransportMode: 1); for other transport modes they stay empty even if sent.
0536).- Driver information is not needed; even if sent it is not stored and comes back empty.
- Trailer plates are not stored.
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 >= 1Body
Required. Shipment code, unique within the company. At most 50 characters.
"5469"
Description. At most 255 characters.
"Istanbul road shipments"
Required. 1: Road, 2: Rail, 3: Maritime, 4: Air. Decides what TransportInfo1 and TransportInfo2 mean.
1
Required. Vehicle identifier, by TransportMode: 1 license plate, 2 train number, 3 vessel name, 4 aircraft number. At most 50 characters.
"34ABC123"
Second transport information, used only when TransportMode is 2 (rail car number) or 3 (IMO number). Not stored for 1 (road) and 4 (air). At most 50 characters.
Carrier company name. Required together with the other Carrier* fields when the shipment is made by a carrier company; leave all of them empty for the company's own vehicle. At most 75 characters.
"Example Logistics Ltd."
Carrier company tax number. At most 50 characters.
"1234567890"
Carrier company city. At most 50 characters.
"ISTANBUL"
Carrier company district. At most 50 characters.
"KADIKÖY"
Carrier company country. At most 50 characters.
"TÜRKİYE"
First name of driver 1. Required when no carrier company is used. Not stored when a carrier company is used. At most 50 characters.
"Ahmet"
Last name of driver 1. Required when no carrier company is used. At most 20 characters.
"Kaya"
National ID number (TCKN) of driver 1. Required when no carrier company is used. At most 20 characters.
"12345678901"
First name of driver 2. At most 50 characters.
Last name of driver 2. At most 20 characters.
National ID number (TCKN) of driver 2. At most 20 characters.
Trailer license plate 1. Stored only when TransportMode is 1 (road) and no carrier company is used. At most 20 characters.
"34ABC123"
Trailer license plate 2. Stored only when TransportMode is 1 (road) and no carrier company is used. At most 20 characters.
Response
Created
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.