Skip to main content

Update Trade Tracking Entry

PATCH /api/v1/trade-trackings/{trackingId}

Description

This endpoint allows for updates to a specific trade tracking entry, modifying details such as the delivered quantity, itinerary changes, documentation, and other relevant tracking information.

URL Parameters:

  • trackingId (required): The unique identifier of the trade tracking entry to be updated. This must be included in the URL path.

Headers:

  • tenantId (required): The tenant ID under which the trade tracking is registered. This identifies the specific tenant environment and should be included as a header.
  • userId (required): The user ID of the individual making the update. This header is used for authentication and authorization.
  • countryCode (required): The country code indicating where the trade operations are based or registered.

Request Body (application/json): Required. The body should contain updated information about the trade tracking details:

{
"deliveredQuantity": 0,
"itenary": [
{
"trackingId": "string",
"origin": "string",
"destination": "string",
"shippingDate": "string",
"trackingProvider": "string",
"deliveryDate": "string",
"deliveryMode": "string",
"finalDestination": false,
"qualityChecked": false,
"labellingDetails": "string",
"docLinks": [
{
"name": "string",
"link": "string"
}
]
}
],
"tradeId": "string",
"userId": "string",
"tenantId": "string",
"countryCode": "string"
}

Example Request:

curl -X PATCH "http://[base_url]/api/v1/trade-trackings/{trackingId}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456" \
-H "countryCode: US" \
-d '{
"deliveredQuantity": 100,
"itenary": [
{
"trackingId": "TRACK123",
"origin": "Shanghai, China",
"destination": "San Francisco, USA",
"shippingDate": "2023-05-05",
"trackingProvider": "SpeedyShip",
"deliveryDate": "2023-05-20",
"deliveryMode": "Sea",
"finalDestination": true,
"qualityChecked": true,
"labellingDetails": "Handle with care",
"docLinks": [
{
"name": "Customs Declaration",
"link": "http://example.com/customs.pdf"
}
]
}
],
"tradeId": "TRADE123",
"userId": "USR456",
"tenantId": "TEN123",
"countryCode": "US"
}'

Responses:

  • 200 OK: Successfully updated the trade tracking entry. The response typically includes a confirmation of the changes made.

Example Response:

{
"message": "Trade tracking updated successfully."
}

Error Responses:

  • 400 Bad Request: Incorrect or incomplete data provided for the update.
  • 404 Not Found: No tracking found with the provided trackingId.
  • 403 Forbidden: The user does not have permission to update the tracking.

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request PATCH \ 
--url /api/v1/trade-trackings/{trackingId} \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!