Skip to main content

Update Trade Payment Details

PATCH /api/v1/trades/{tradeId}/payment-details

Description

Updates the payment details for a specific trade, including how payments are split (if applicable), additional comments on the payment terms, and documentation related to payment agreements. This endpoint facilitates the management of financial transactions within a trade, ensuring that all modifications are recorded and transparent.

URL Parameters:

  • tradeId (required): The unique identifier of the trade for which payment details 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 payment details. This header is used for authentication and authorization.

Request Body (application/json): Required. The body should include updated information about the payment structures and any related documents:

{
"splits": [
{
"name": "string",
"type": "string",
"value": 0
}
],
"comment": "string",
"docLinks": [
{
"name": "string",
"link": "string"
}
],
"userId": "string",
"tenantId": "string"
}

Example Request:

curl -X PATCH "http://[base_url]/api/v1/trades/{tradeId}/payment-details" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456" \
-d '{
"splits": [
{
"name": "Down Payment",
"type": "Initial",
"value": 5000
}
],
"comment": "Initial down payment of 25% required.",
"docLinks": [
{
"name": "Payment Agreement",
"link": "http://example.com/payment-agreement.pdf"
}
],
"userId": "USR456",
"tenantId": "TEN123"
}'

Responses:

  • 200 OK: Successfully updated the trade's payment details. The response typically includes a confirmation of the changes made.

Example Response:

{
"message": "Payment details 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 payment details.

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


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

RESPONSE


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