Terminate Trade
PATCH /api/v1/trades/{tradeId}/terminate
Description
Terminates a specific trade, typically due to factors such as non-compliance, mutual agreement to end the trade, or other circumstantial changes. This endpoint is crucial for managing trade lifecycles and ensuring that all parties are informed of the termination and the reasons behind it.
URL Parameters:
tradeId(required): The unique identifier of the trade to be terminated. 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 terminating the trade. This header is used for authentication and authorization.
Request Body (application/json): Required. The body should include a comment explaining the reason for the trade's termination:
{
"comment": "string"
}
Example Request:
curl -X PATCH "http://[base_url]/api/v1/trades/{tradeId}/terminate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456" \
-d '{
"comment": "Termination due to non-compliance with delivery timelines."
}'
Responses:
- 200 OK: Successfully terminated the trade. The response typically includes a confirmation of the termination and any relevant comments or final statements.
Example Response:
{
"message": "Trade terminated successfully.",
"comment": "Termination due to non-compliance with delivery timelines."
}
Error Responses:
- 400 Bad Request: Incorrect or incomplete data provided for the termination.
- 404 Not Found: No trade found with the provided
tradeId. - 403 Forbidden: The user does not have permission to terminate the trade.
LANGUAGE
CURL REQUEST
curl --request PATCH \
--url /api/v1/trades/{tradeId}/terminate \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!