Skip to main content

Update Trade Documents

PATCH /api/v1/trades/{tradeId}/documents

Description

Updates the document links associated with a trade, such as contracts, agreements, or any other relevant documentation. This endpoint allows for the management and updating of document references which are crucial for trade verification and compliance.

URL Parameters:

  • tradeId (required): The unique identifier of the trade for which documents are being updated. This must be included in the URL path.

Headers:

  • tenantId (required): The tenant ID under which the trade is registered. This header identifies the specific tenant environment and should be included.
  • userId (required): The user ID of the individual responsible for updating the trade's documents. This header is used for authentication and authorization.
  • countryCode (required): The country code where the trade is being processed. This should be included as a header.

Request Body (application/json): Required. The body should include the updated list of document links:

{
"docLinks": [
{
"name": "string",
"link": "string"
}
],
"userId": "string",
"tenantId": "string",
"countryCode": "string"
}

Example Request:

curl -X PATCH "http://[base_url]/api/v1/trades/{tradeId}/documents" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456" \
-H "countryCode: US" \
-d '{
"docLinks": [
{
"name": "Updated Purchase Agreement",
"link": "http://example.com/updated-agreement.pdf"
}
],
"userId": "USR456",
"tenantId": "TEN123",
"countryCode": "US"
}'

Responses:

  • 200 OK: Successfully updated the trade documents. The response typically includes a confirmation of the changes made to the document links.

Example Response:

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

Error Responses:

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

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request PATCH \ 
--url /api/v1/trades/{tradeId}/documents \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


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