Upload Loan Documents
POST /api/v1/loans/documents/{tradeId}
Description
Allows for the uploading or linking of documents related to a specific loan for a given trade. This endpoint is used to manage documentation such as loan agreements, signed forms, and other relevant documents essential for loan processing and verification.
URL Parameters:
tradeId(required): The unique identifier of the trade for which documents are being uploaded or linked. This must be included in the URL path.
Headers:
tenantId(required): The tenant ID associated with the request, indicating under which tenant the documents should be uploaded. This should be included as a header.countryCode(optional): The country code where the loan is being processed, helping to categorize the documents by geographical location.userId(optional): The user ID of the individual uploading or linking the documents. Including this can help in tracking who made the changes.
Request Body (application/json): Required. The body should include details about the documents to be linked:
{
"docLinks": [
{
"name": "Signed Document",
"link": "string"
}
]
}
Responses:
- 201 Created: Indicates that the documents have been successfully uploaded or linked to the trade loan. The response typically includes details of the document and a confirmation message.
Example Request:
curl -X POST "http://[base_url]/api/v1/loans/documents/{tradeId}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "countryCode: US" \
-H "userId: USR456" \
-d '{
"docLinks": [
{
"name": "Loan Agreement",
"link": "http://example.com/loan-agreement.pdf"
}
]
}'
Example Response:
{
"message": "Documents uploaded successfully.",
"documents": [
{
"name": "Loan Agreement",
"link": "http://example.com/loan-agreement.pdf",
"tradeId": "trade123"
}
]
}
Error Responses:
- 400 Bad Request: Incorrect or incomplete data for document upload.
- 404 Not Found: No trade found with the provided
tradeId. - 403 Forbidden: The user does not have permission to upload or link documents.
LANGUAGE
CURL REQUEST
curl --request POST \
--url /api/v1/loans/documents/{tradeId} \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!