Retrieve Loans for Specific Trade
GET /api/v1/loans/trade/{tradeId}
Description
Retrieves detailed information about loans associated with a specific trade. This endpoint is used to access comprehensive loan data, which can include amounts, terms, related documents, and other pertinent details.
URL Parameters:
tradeId(required): The unique identifier of the trade for which loan details are being retrieved. This must be included in the URL path.
Headers:
tenantId(required): The tenant ID associated with the request, indicating under which tenant the loan data should be fetched. This should be included as a header.countryCode(optional): The country code where the loan was processed. Including this can help filter loans specific to a geographical location.userId(optional): The user ID of the individual seeking to access the loan details. Including this can help in auditing access to the data.
Example Request:
curl -G "http://[base_url]/api/v1/loans/trade/{tradeId}" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "countryCode: US" \
-H "userId: USR456"
Responses:
- 200 OK: Successfully retrieved the loan details for the specified trade. The response includes detailed information about each loan associated with the trade.
Example Response:
{
"loans": [
{
"loanId": "loan123",
"loanType": "Export",
"loanAmount": 100000,
"paymentTenorInDays": 180,
"productUnitPurchasePrice": 150,
"docLinks": [
{
"name": "Loan Agreement",
"link": "http://example.com/loan-agreement.pdf"
}
],
"tradeId": "trade123",
"createdAt": "2023-01-01T12:00:00Z"
}
]
}
Error Responses:
- 400 Bad Request: Incorrect request parameters or headers.
- 404 Not Found: No loans found associated with the provided
tradeId. - 403 Forbidden: The user does not have permission to view the loan details.
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/loans/trade/{tradeId} \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!