In this chapter you will learn how to retrieve ex-ante reports via the Investment API.
You can retrieve ex-ante reports via two different endpoints of the Investment API:
the generic endpoint
/users/{user_id}/reportsusing the query parameterORDER_EX_ANTE_COSTor/reports/{report_id}
Authentication scopes —
reports:readFor more information, refer to Authentication scopes.
Before retrieving ex-ante reports, ensure you have:
Webhook handler ready — Set up a webhook endpoint to listen for report generation events.
- Subscribe to
REPORT.CREATEDevents.
For more information, refer to Implementing webhooks.
- Subscribe to
The ex-ante cost information must reach the end user on a durable medium (dauerhafter Datenträger) before they make their investment decision. To help fulfil this requirement, Upvest provides access to a PDF file version of the report.
You can use the JSON response in addition to the PDF. For example, to display the cost breakdown natively in your order flow. However, the end user must still be able to access the PDF version before they place the order.
To retrieve the report as a PDF, set the accept header to application/pdf when you submit the GET request to the /reports/{report_id} endpoint. If you omit the header, the API returns JSON.
accept header | Format | Usage |
|---|---|---|
application/pdf | Required: Provide this document to the end user before they place the order. | |
application/json | JSON | Optional: Use the data in addition to the PDF to build your own UI. |
Ensure you provide end users with the PDF version of the ex-ante report.
Recommended: Use webhooks for ex-ante cost reports
To check for new ex-ante cost reports, set up a webhook listener for REPORT.CREATED. You will receive automatic notification when a report is generated and is ready for download.
For more information, refer to Report webhook events
To retrieve an ex-ante report, execute the following API call:
GET /users/{user_id}/reports?type=ORDER_EX_ANTE_COST
| Parameter | Description |
|---|---|
user_id | Required: Path parameter. Specify the ID of the user for whom the report is to be fetched. |
ORDER_EX_ANTE_COST | Query parameter. Specify this query parameter to narrow down the results list to ex-ante reports only. |
or
| Parameter | Description |
|---|---|
report_id | Required: Path parameter. Specify the ID of the report to be fetched. |
Example response
The JSON response provides a complete cost breakdown and contains detailed information on the cost components. However, ensure you provide the end user a PDF version of the report. For more information, refer to Providing the report as a PDF.
{
"id": "b96b1ee7-d491-43eb-b5e4-4833af9c9c2f",
"created_at": "2023-08-24T14:15:22Z",
"user_id": "d1a4be99-8bb6-4e78-b897-8168f6823ab5",
"type": "ORDER_EX_ANTE_COST",
"substituted_report_id": null,
"data": {
"account": {
"id": "c5034305-c441-4711-adbf-93cfbc13a695",
"account_number": 1
},
"account_group": {
"id": "9d95820d-4333-46b6-98de-04ab7512e76f",
"securities_account_number": "123456789"
},
"user": {
"salutation": "SALUTATION_MALE",
"title": "DR",
"first_name": "Karl",
"last_name": "Schmidt",
"address": {
"address_line1": "Rosenweg 221",
"address_line2": "apt. 33",
"postcode": "45678",
"city": "Berlin",
"country": "DE"
}
},
"instrument": {
"isin": "LU0274208692",
"short_name": "XTR.MSCI WORLD SWAP 1C"
},
"venue": {
"name": "Tradegate"
},
"order": {
"user_id": "d1a4be99-8bb6-4e78-b897-8168f6823ab5",
"instrument_id": "LU0274208692",
"instrument_id_type": "ISIN",
"account_id": "c5034305-c441-4711-adbf-93cfbc13a695",
"order_type": "MARKET",
"side": "BUY",
"quantity": "15",
"cash_amount": "1220.85",
"currency": "EUR",
"price": "81.39"
},
"holding_period": {
"unit": "YEAR",
"quantity": 3
},
"total_cost": {
"product": {
"cash_amount": "17.48",
"currency": "EUR",
"as_percentage": "1.43"
},
"service": {
"cash_amount": "6.88",
"currency": "EUR",
"as_percentage": "0.56"
},
"third_party": {
"cash_amount": "0.70",
"currency": "EUR",
"as_percentage": "0.06"
},
"total": {
"cash_amount": "25.06",
"currency": "EUR",
"as_percentage": "2.05"
}
},
"product_cost": {
"one_off": {
"cash_amount": "0.20",
"currency": "EUR",
"as_percentage": "0.02"
},
"ongoing": {
"cash_amount": "16.48",
"currency": "EUR",
"as_percentage": "1.35"
},
"less_of_third_party_payments": {
"cash_amount": "0.00",
"currency": "EUR",
"as_percentage": "0.00"
},
"transaction": {
"cash_amount": "0.80",
"currency": "EUR",
"as_percentage": "0.07"
},
"incidental": {
"cash_amount": "0.00",
"currency": "EUR",
"as_percentage": "0.00"
},
"total": {
"cash_amount": "17.48",
"currency": "EUR",
"as_percentage": "1.43"
}
},
"service_cost": {
"one_off": {
"cash_amount": "0.49",
"currency": "EUR",
"as_percentage": "0.04"
},
"ongoing": {
"cash_amount": "4.39",
"currency": "EUR",
"as_percentage": "0.36"
},
"transaction": {
"cash_amount": "2.00",
"currency": "EUR",
"as_percentage": "0.16"
},
"ancillary": {
"cash_amount": "0.00",
"currency": "EUR",
"as_percentage": "0.00"
},
"incidental": {
"cash_amount": "0.00",
"currency": "EUR",
"as_percentage": "0.00"
},
"total": {
"cash_amount": "6.88",
"currency": "EUR",
"as_percentage": "0.56"
}
},
"third_party_payments": {
"total": {
"cash_amount": "0.70",
"currency": "EUR",
"as_percentage": "0.06"
},
"received_by_client": {
"cash_amount": "0.35",
"currency": "EUR",
"as_percentage": "0.03"
},
"received_by_upvest": {
"cash_amount": "0.35",
"currency": "EUR",
"as_percentage": "0.03"
}
},
"return_impact": {
"year_one": {
"cash_amount": "9.05",
"currency": "EUR",
"as_percentage": "0.74",
"details": [
{ "type": "ENTRY", "cash_amount": "2.09", "currency": "EUR", "as_percentage": "0.17" },
{ "type": "ONGOING", "cash_amount": "6.96", "currency": "EUR", "as_percentage": "0.57" },
{ "type": "EXIT", "cash_amount": "0.00", "currency": "EUR", "as_percentage": "0.00" }
]
},
"year_two": {
"cash_amount": "6.96",
"currency": "EUR",
"as_percentage": "0.57",
"details": [
{ "type": "ENTRY", "cash_amount": "0.00", "currency": "EUR", "as_percentage": "0.00" },
{ "type": "ONGOING", "cash_amount": "6.96", "currency": "EUR", "as_percentage": "0.57" },
{ "type": "EXIT", "cash_amount": "0.00", "currency": "EUR", "as_percentage": "0.00" }
]
},
"year_three": {
"cash_amount": "8.36",
"currency": "EUR",
"as_percentage": "0.68",
"details": [
{ "type": "ENTRY", "cash_amount": "0.00", "currency": "EUR", "as_percentage": "0.00" },
{ "type": "ONGOING", "cash_amount": "6.96", "currency": "EUR", "as_percentage": "0.57" },
{ "type": "EXIT", "cash_amount": "1.40", "currency": "EUR", "as_percentage": "0.11" }
]
}
}
}
}In the holding_period object, we calculate the estimated cost assuming that the user holds the instrument for 3 years before selling it.
Example
"holding_period": {
"unit": "YEAR",
"quantity": 3
}| Parameter | Description | Example |
|---|---|---|
unit | The counting unit. | year |
quantity | The quantity of the specified counting unit. | 3 |