Skip to main content

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:

  1. The shipment has not been manifested.
  2. The updated shipment can be successfully rated after applying the new dimensions.
  3. 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.

ParameterTypeDescription
ConsignmentNostringRequired, the unique reference number for your shipment.
Itemsobject listrequired, array of items to update for the shipment

Return format

A JSON object with a message indicating whether the shipment was updated.

Response

AttributeTypeDescription
MessagestringGeneral response message. In success responses, it describes the outcome. In error responses, it summarizes the validation or processing issue.
Errorskey-value pairsA 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."
    }
}
Last update: