Create Shipment
POST /tms/shipments
Description
This endpoint is used to create a new shipment. The shipment details include the driver, vehicle, carrier, origin, destination, and associated orders.
Parameters
- tenantId (
string, header, required): The ID of the tenant. - countryCode (
string, header, required): The country code.
Request Body
- Media Type:
application/json
Example Value
{
"driverUserId": "string",
"vehicleId": "string",
"carrierId": "string",
"carrierType": "string",
"origin": {
"latitude": 0,
"longitude": 0,
"address": "string",
"userId": "string",
"city": "string"
},
"destination": {
"latitude": 0,
"longitude": 0,
"address": "string",
"userId": "string",
"city": "string"
},
"orderIds": [
"string"
]
}
Responses
This section outlines the possible responses from the create shipment API.
Success Response (201)
The Success Response (201) is returned when the shipment is successfully created. This response indicates the success of the operation and provides additional details.
Response Fields
| Field | Type | Description |
|---|---|---|
| status | boolean | Indicates the success of the create shipment request. |
| statusCode | integer | Numeric code representing the status of the response (e.g., 201 for success). |
| message | string | A message indicating the outcome of the operation. |
| data | object | Contains the created shipment details. |
| errors | array | An array of objects providing details about any errors encountered during the request. |
Example
{
"status": true,
"statusCode": 0,
"message": "Shipment created successfully",
"data": {},
"errors": []
}
Media Type
application/json: The response is in JSON format.
Example Value
Schema:
{
"status": true,
"statusCode": 0,
"message": "string",
"data": {},
"errors": [
{
"message": "string",
"descriptiveMessage": "string"
}
]
}
Error Response (400)
The Error Response (400) is returned when the request is invalid. This response indicates that there was an issue with the request parameters or body.
LANGUAGE
CURL REQUEST
curl --request POST \
--url /tms/shipments \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!