This API provides endpoints for users or other data-centers to access a certain set of data that derives from a Treasury Systems report (a specific Balance report). This API will fetch a snapshot of how that specified report looked on a given day. The snapshot is taken daily at 21:00 (CET) and the Report is managed and edited in Treasury Systems.
Get Started
To get started using the API, follow the below steps.
Sign Up
A user within Treasury Systems, with the permissions to edit and create new users, must setup a new user in Roles & Permissions view. Once the new API-user is created, this user must be assigned with the permission 'Public API Access'. When creating the user, the user needs to have the same Name in Treasury Systems as the user ID used requesting from the API.
Example: If the request authentication has the user ID [email protected], the same Name needs to be defined in Treasury Systems.
There is a second way to create an account, and that is to call the API before creating the user, prompting the system to create a user. A Treasury Systems user with the proper permissions must then login to Treasury Systems and grant permission to the new API-user ('Public API Access') before the API will accept any requests.
Examples for Python with Office 365 SSO
Download the attched file reportdata.ipynb
Import to your jupyter notebook update url with your customer name (domain)
Authentication
This API uses JWT bearer tokens as it’s authentication. As explained previously, the token needs to match the Name in Treasury Systems to grant access to any requests.
There are two different ways to authenticate to the API
- As your self, used when connecting excel to the API, please see Use Excel for TS Report and Marketdata API
- Use JWT bearer tokens. This method works well with tools such as Integration Platforms (such as Logic Apps) or scripting (PowerShell, cURL, postman). Please see TS Report & Marketdata API Authentication.
Postman
Add a application and create a token see article API authentification create application and token (Postman)
If you want to use Excel and login in with organization account see article Use Excel for TS Report and Marketdata API
Report Data API URL
The base URL for this endpoint is: https:// [COMPANY].treasurysystems.com/api/reportdata/
Endpoints
/atdate/
Description: This endpoint is the most basic one of the report data endpoints. It will fetch and return a single dataset that’s been saved and created on the specified date.
Parameters:
param1 (string): This is the one and only parameter for this endpoint. This parameter specifies the dataset at the date that you wish to fetch. The date is a date code, which are commonplace in Treasury Systems environment. At the end of this documentation we provide a list of the date codes available. The parameter name is 'dateCode'.
Example
https://ts.treasurysystems.com/tenants/company/api/reportdata/atdate/v1?dateCode=20241001
/realtime/
Description: This endpoint returns a data set as it is now. That means that Treasury Systems will run the specified report at real time and return its data. If anything is changed in the system and this is requested again in the same day, you might receive differing datasets.
Parameters:
This endpoint has no parameters.
Example
https://ts.treasurysystems.com/tenants/company/api/reportdata/realtime/v1
/daterange/
Description: The endpoint works like the 'atdate' endpoint, but has 2 parameters. It fetches every dataset between two date codes. It will return it as a JSON collection.
Parameters:
param1 (string): The first parameter has the name 'fromDateCode'. The codes that this endpoint accepts are in the end of this document. This date code is the start in the date range.
param2 (string): The first parameter has the name 'toDateCode'. The codes that this endpoint accepts are in the end of this document. This date code is the end of the date range.
Example:
{
"param1": "20240301",
"param2": "20240401"
}
This will return datasets from the 1st of march to the first of April.
Example
https://ts.treasurysystems.com/tenants/COMPANY/api/reportdata/daterange/v1?fromDateCode=20241001&toDateCode=20241010
Market Data API URL
The base URL for this endpoint is: https:// [COMPANY].treasurysystems.com/api/marketdata/
Endpoints
/fx/
Description: This endpoint gets FX rates at the given date. It will return a JSON containing the Time the rate is valid at, the base currency and the price currency, the periods that the rates are valid at and lastly the Bid rate, Ask Rate and FWD points.
Parameters:
param1 (string): This endpoint accepts one parameter. It’s a string called 'dateCode'. It functions as the other date code parameters in this document. At the end of this documentation we provide a list of the date codes available.
Example
https://COMPANY.treasurysystems.com/api/marketdata/fx/v1?dateCode=20240312
/ir/
Description: Similarly to the FX endpoint, this will return rates but for interest. It will return a JSON containing a collection of interest rates.
Parameters:
param1 (string): Accepts the same parameter as the FX endpoint. It’s also called 'dateCode'. It functions as the other date code parameters in this document. At the end of this documentation we provide a list of the date codes available.
Errors are handled internally and are logged internally. If any errors do occur during use, please contact TS support for further assistance. Any error is returned as status code 500.
Rate Limiting
Our API adapts a simple rate limiting policy. Currently the rate limit is 10 requests per minute and 100 per day.
API Version
Our API has versioning. When using any of the endpoints, the version needs to be specified. In order to specify version, simply add /v{version number} on the end of the URL. The current versions that are currently live are listed below. Versions are kept for 6 months.
Example: https:// [COMPANY].treasurysystems.com/api/reportdata/realtime/v1
Versions
Realtime
v1 - first implementation of endpoint.
Atdate
v1 - first implementation of endpoint.
Daterange
v1 - first implementation of endpoint.
Response Codes
200 OK - Request successful.
204 No Content – There was no datasets to return.
400 Bad Request - Invalid request.
401 Unauthorized - Authentication failure.
404 Not Found - Resource not found.
405 Parameters not correct entered
500 Internal Server Error - Something went wrong on the server.
Date Codes
The date codes that can be used are listed below. Generally these codes are such as “20240101”, which represents 2024-01-01, or “today” which simply will be translated to the date of when the request was sent.
The most common date codes are listed below:
TODAY – Picks the current date
D – One day, so the next day
BD – Next business day
W – Week from now
M – Month from now
Q – Quarter from now
Y – Year from now
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday – The next given day
Date codes can used mathematically as -1D or -1W. This works by combining a operator (+ or -), the amount and the date code. Example: -5W would result in 28 days backwards. -7BD would be 7 business days backwards (this takes holidays into account as well).
Lastly a user can enter a “texted date” as mentioned above, such as “20240101”.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article