api/shipments
About 1 min
api/shipments
Description
This method is used to update the dimensions of items for an existing shipment.
This endpoint can only be used if:
- The shipment has not been manifested.
- The updated shipment can be successfully rated after applying the new dimensions.
- The update must not contain more packages than originally declared.
- If fewer packages are provided, the missing ones remain unchanged.
If any of above conditions fail, the request will return an error.
Request
- Method:
PATCH - Content Type:
application/json - URL:
https://api.gosweetspot.com/api/shipments
Headers
- access_key : your unqiue api key provided by GSS.
- site_id : which site you are requesting action for.
Parameters
The body of the message should be sent as an Json object.
| Parameter | Type | Description |
|---|---|---|
| ConsignmentNo | string | Required, the unique reference number for your shipment. |
| Items | object list | required, array of items to update for the shipment |
Return format
A JSON object with a message indicating whether the shipment was updated.
Response
| Attribute | Type | Description |
|---|---|---|
| Message | string | General response message. In success responses, it describes the outcome. In error responses, it summarizes the validation or processing issue. |
| Errors | key-value pairs | A map where the key is the field that failed validation, and the value is the detailed reason for the failure. |
Request example
curl --location --request PATCH 'http://api.gosweetspot.com/api/shipments' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json' \
--data-raw '{
"ConsignmentNo": "CRQZ005620",
"Items":[
{
"PartNo": 1
"Barcode": "CRQZ00562001",
"Package":{
"length": 20,
"width":20,
"height":20,
"kg":2
}
}
]
}'
Response example
1. Success
Status: 200
{
"Message": "consignmentNo: CRQZ005620 has been updated. Please download and replace your labels."
}
2. Validation failed
Status: 400
{
"message": "One or more validation errors occurred.",
"errors": {
"consignmentNo": "This consignmentNo cannot be found."
}
}
3. Unprocessable error
Status 422
{
"message": "Unprocessable Entity.",
"errors": {
"consignmentNo": "No services match new dimension."
}
}