To use this POST
request you will need to following information
- a-api-key provided by Gatehouse
- token retrieved from /authentication/login
Request
Create Shipment takes a number of parameter wrapped in a json body along with the a-api-key in the header. Below a json body is shown for a valid shipment, the parameters in red are required to be filled and yellow indicate that at least one of them need to be set, lastly grey mean that even if include they will not be used.
{
"id": integer,
"shipment_id": string,
"shipper_id": integer,
"carrier_scac": string,
"container_number": string,
"bill_of_lading": string,
"shipment_name": string,
"planned_begin": string,
"planned_end": string,
"place_of_origin": string,
"port_of_loading": string,
"port_of_destination": string
}
Example – Valid shipment
{
"id": 1,
"shipment_id": "Oz2277",
"shipper_id": 8944,
"carrier_scac": "jwiL",
"container_number": "tXC62348522",
"bill_of_lading": "ATw71129",
"shipment_name": "Jacob Clark",
"planned_begin": "1981-09-23T09:29:54",
"planned_end": "1990-03-28T18:50:49",
"place_of_origin": "fUaPB",
"port_of_loading": "JKZjT",
"port_of_destination": "nOnFQ"
}
Response
Correct usage results in 201 response (created) in the format shown below
The request has succeeded and a new resource has been created as a result. This is typically the response sent after
POST
requests, or somePUT
requests.
{
"id": integer,
"shipment_id": string,
"shipper_id": integer,
"carrier_scac": string,
"container_number": string,
"bill_of_lading": string,
"shipment_name": string,
"planned_begin": string,
"planned_end": string,
"place_of_origin": string,
"port_of_loading": string,
"port_of_destination": string
}
Example – Retrieve newly created shipment
{
"id": 428,
"shipment_id": "8944##Oz2277",
"shipper_id": 8944,
"carrier_scac": "jwiL",
"container_number": "tXC62348522",
"bill_of_lading": "ATw71129",
"shipment_name": "Jacob Clark",
"planned_begin": "1981-09-23T09:29:54",
"planned_end": "1990-03-28T18:50:49",
"place_of_origin": "fUaPB",
"port_of_loading": "JKZjT",
"port_of_destination": "nOnFQ"
}
#TODO Additional response code regarding invalid parameters
Additional response can be found here, related to 400 error codes.