Create 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",
"TransportMode": 1,
"TransportInfo1": "34ABC123"
}
'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 \"TransportMode\": 1,\n \"TransportInfo1\": \"34ABC123\"\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', TransportMode: 1, TransportInfo1: '34ABC123'})
};
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",
"TransportMode": 1,
"TransportInfo1": "34ABC123"
}
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."
}
]
}Shipment definitions
Create shipment definition
Adds a shipment definition.
POST
/
api
/
v1
/
definitions
/
shipment-definitions
Create 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",
"TransportMode": 1,
"TransportInfo1": "34ABC123"
}
'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 \"TransportMode\": 1,\n \"TransportInfo1\": \"34ABC123\"\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', TransportMode: 1, TransportInfo1: '34ABC123'})
};
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",
"TransportMode": 1,
"TransportInfo1": "34ABC123"
}
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
Leave all carrier fields (
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.
If any carrier field is filled, all five are required (
0536).- Driver information is not needed; even if sent it is not stored and comes back empty.
- Trailer plates are not stored.
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 |
|---|---|---|
0002 | 400 | Request body could not be read (malformed JSON, wrong field type), or it contains a field the endpoint does not have |
0003 | 400 | A field exceeds its maximum length (the message names the field and the limit) |
0531 | 400 | Shipment definition Code is required |
0532 | 400 | The shipment code is already used in the company; the response carries the existing record’s ID as ExistingId |
0533 | 400 | TransportMode must be 1 (road), 2 (rail), 3 (maritime) or 4 (air) |
0535 | 400 | TransportInfo1 is required (plate, train, vessel or aircraft information) |
0536 | 400 | If any carrier field is filled, all five are required |
0537 | 400 | Driver 1 fields (first name, last name, national ID) are required when there is no carrier company |
Authorizations
Headers
Body
application/jsontext/jsonapplication/*+json
Response
Created