Spending Pattern

This endpoint gives insights on users' spending habits based on transactions, and it comes in percentages.
To get Spending Pattern

Request

{{baseUrl}}/api/v1/financial/spending_pattern

Headers

Parameter

Type

Description

AppId

string

you would need to create an app to get your app ID

Authorization

string

public secret key e.g prod_sk_1T1eSavlZxy02OT3OWlvbxK4G

Query Parameters

Parameter Type Description
account_id * string account ID gotten from the widget required
duration string can be 6_months, 12_months, 24_months only optional

Respose Sample

{
    "entity": {
        "pattern": {
            "Others": {
                "sum": 398924.72,
                "count": 43,
                "percentage": 89.1006424877234
            },
            "Food": {
                "sum": 20000,
                "count": 1,
                "percentage": 4.4670404224498
            },
            "Airtime/Data": {
                "sum": 14598.01,
                "count": 25,
                "percentage": 3.26049503786632
            },
            "Bank Transfer": {
                "sum": 13315,
                "count": 3,
                "percentage": 2.973932161245954
            },
            "Charges": {
                "sum": 886,
                "count": 27,
                "percentage": 0.19788989071452615
            }
        }
    }
}
curl -L -X GET '{{baseUrl}}/api/v1/financial/spending_pattern?account_id={{account_id}}' \
-H 'Content-Type: application/json' \
-H 'Authorization: SECRET_KEY'
-H 'AppId: APP_ID'

Did this page help you?