The Yapily Plus categorisation product is available as a BETA version.
Complete prerequisites
Before retrieving data from the Categorised Transactions endpoints, you will first need to:
- Obtain a Consent from the user
- Get Accounts for the user
- Register a Webhook for notification events when categorisation is done or failed
Webhook Registration
Please follow our Webhook Registration Guide in order to register a webhook for your application.Webhook Events
In order to get notified when a categorisation request has finished successfully or failed you will have to subscriber to the following webhook events:- transactions.categorisation.completed - is the event triggered when a categorisation request finishes successfully and the data is ready to be picked up.
- transactions.categorisation.failed - is the event triggered when a categorisation request fails to categorise the data successfully.
Submit categorisation request
Categorisation works asynchronously and therefore the flow requires you to have a registered webhook on for your application.In order to trigger a categorisation process follow the steps:
- Call
POST /accounts/{accountId}/transactions/categorisationendpoint.- Define
categorisationType(consumer or business) according to your use case.
- Define
- The response of the endpoint will return a
categorisationIdparameter. - Store the
categorisationIdsince all further API calls will require it.
Setting Boundaries for Efficient Data Categorization
To enhance the efficiency of data categorisation requests via thePOST /accounts/{accountId}/transactions/categorisation endpoint, it is crucial to set specific time frame boundaries using the from and before query parameters.
This approach helps to minimise system overloads and improve success rates by dividing extensive data requests into smaller, manageable intervals. For instance, to categorise three years of transaction data, we recommend submitting six separate requests, each covering a six-month period.Wait for webhook notification
A webhook event will be sent to registered webhook in all situations, success or failure.
Categorisation Success Event
When categorisation has finished successfully then an event is triggered on the topictransactions.categorisation.completed| Property | Value Type | Description |
|---|---|---|
| id | String | The Webhook ID used for delivering the event |
| applicationId | String | The Application ID that registered this webhook |
| type | String | The triggered event’s type |
| event.categorisationId | String | The Categorisation ID the event was triggered for |
| metadata.tracingId | String | The Tracing ID of the event |
| metadata.user | String | Optional. The metadata provided at Webhook registration |
Categorisation Fail Event
When categorisation request processing failed then an event is triggered on the topictransactions.categorisation.failed| Property | Value Type | Description |
|---|---|---|
| id | String | The Webhook ID used for delivering the event |
| applicationId | String | The Application ID that registered this webhook |
| type | String | The triggered event’s type |
| event.categorisationId | String | The Categorisation ID the event was triggered for |
| error.issues[].code | Integer | A 5-digit error code pointing to the source of the problem |
| error.issues[].message | String | The error message describing the issue |
| metadata.tracingId | String | The Tracing ID of the event |
| metadata.user | String | Optional. The metadata provided at Webhook registration |
How to Handle Failure Event
We recommend that you build your app’s error handling around Error Codes, which would give you the best explanation of why your request has failed.Retrieve categorised data
In order to retrieve categorised data call
GET /transactions/categorisation/{categorisationId} endpoint.Please check API Reference for an up to date specification of the API.The categorised transactions will be available for 30 mins only. If the transactions are not collected within that time, the categorisation will need to be completed again.
Elements
Where possible we return the following:categories e.g. childcaremerchantName e.g. NetflixrecurrenceType e.g one-off, subscription, recurringpaymentProcessor e.g. Paypal
Transaction Categories
To see the latest list of categories, use theGET /transactions/categorisation/categories/{accountType} endpoint
Categories definition
The definition for all the incoming and outgoing categories can be found hereWhere the model cannot identify a merchant, the merchant field will be returned as {null}.