Aggregated Data
Now that you’ve gone through the process of creating a user, a member, and aggregating data, you can look at the account and transaction data that has been gathered.
1. List Account Data
First, get a list of all the account data associated with your user.
You can see in the following example that the user has 21 accounts associated with it. If you look at the type
field, there is a checking account, a savings account, a credit card account, and several others. Also, there is information on the balance of each account, such as APY for credit accounts or payment due days. You won’t always get values for every field; that depends on the data provider and the information available from the financial institution in question.
Make a note of the account GUID for the checking account associated with our test member: ACT-8e6f92c8-1491-42ce-8bf6-c309e9531530
. We’ll need this to list all the transactions associated with the account.
Endpoint:
GET /users/{user_guid}/accounts
1
2
3
curl -i 'https://int-api.mx.com/users/USR-11141024-90b3-1bce-cac9-c06ced52ab4c/accounts' \
-u 'client_id:api_key' \
-H 'Accept: application/vnd.mx.api.v1+json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"accounts": [
{
"account_number": "708191771",
"apr": null,
"apy": null,
"available_balance": 1000,
"available_credit": null,
"balance": 1000,
"cash_balance": null,
"cash_surrender_value": null,
"created_at": "2020-09-21T19:43:44Z",
"credit_limit": null,
"currency_code": null,
"day_payment_is_due": null,
"death_benefit": null,
"guid": "ACT-8e6f92c8-1491-42ce-8bf6-c309e9531530",
"holdings_value": null,
"id": "act-223434333",
"institution_code": "mxbank",
"interest_rate": null,
"is_closed": false,
"is_hidden": false,
"last_payment": null,
"last_payment_at": null,
"loan_amount": null,
"matures_on": null,
"member_guid": "MBR-84ca0882-ad6c-4f10-817f-c8c0de7424fa",
"minimum_balance": null,
"minimum_payment": null,
"name": "Checking",
"original_balance": null,
"payment_due_at": null,
"payoff_balance": null,
"started_on": null,
"subtype": null,
"total_account_value": null,
"type": "CHECKING",
"updated_at": "2020-09-21T19:52:04Z",
"user_guid": "USR-11141024-90b3-1bce-cac9-c06ced52ab4c"
},
•••
],
"pagination": {
"current_page": 1,
"per_page": 25,
"total_entries": 21,
"total_pages": 1
}
}
2. List Transaction Data
With the account GUID you found in the last step, make a request to the list transaction by account endpoint. Notice from the pagination
object in the response that there are 176 transactions in this account and that the endpoint returned the first 25 of these.
Endpoint:
GET /users/{user_guid}/accounts/{account_guid}/transactions
1
2
3
curl -i 'https://int-api.mx.com/users/USR-11141024-90b3-1bce-cac9-c06ced52ab4c/accounts/ACT-8e6f92c8-1491-42ce-8bf6-c309e9531530/transactions' \
-u 'client_id:api_key' \
-H 'Accept: application/vnd.mx.api.v1+json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"transactions": [
{
"category": "Gas",
"category_guid": "CAT-b6d63a19-30a7-e852-2703-bdfb4072289e",
"created_at": "2020-09-21T19:43:48Z",
"date": "2020-09-21",
"posted_at": "2020-09-22T12:00:00Z",
"status": "POSTED",
"top_level_category": "Auto & Transport",
"transacted_at": "2020-09-21T12:00:00Z",
"type": "DEBIT",
"updated_at": "2020-09-21T19:43:51Z",
"account_guid": "ACT-8e6f92c8-1491-42ce-8bf6-c309e9531530",
"amount": 7.29,
"check_number_string": null,
"currency_code": "USD",
"description": "ExxonMobil",
"guid": "TRN-822b443e-972c-431e-8dcf-c2b08de21136",
"is_bill_pay": false,
"is_direct_deposit": false,
"is_expense": true,
"is_fee": false,
"is_income": false,
"is_international": null,
"is_overdraft_fee": false,
"is_payroll_advance": false,
"latitude": null,
"localized_description": null,
"localized_memo": null,
"longitude": null,
"member_guid": "MBR-84ca0882-ad6c-4f10-817f-c8c0de7424fa",
"memo": null,
"merchant_category_code": 0,
"merchant_guid": "MCH-dcd9bbcd-11bb-076a-60c4-90f1101b3372",
"original_description": "ExxonMobil",
"user_guid": "USR-11141024-90b3-1bce-cac9-c06ced52ab4c"
},
•••
],
"pagination": {
"current_page": 1,
"per_page": 25,
"total_entries": 176,
"total_pages": 8
}
}
You can access the rest of these transactions by making another request and specifying the number of records you want to access (valid values range between 10 and 100) and specifying the page you’d like to see. You can pass these parameters in the request URL to same endpoint as demonstrated in the following example. The pagination
object in the response now shows 100 records per page and a current page of 2.
Endpoint:
GET /users/{user_guid}/accounts/{account_guid}/transactions?records_per_page={value}&page={value}
1
2
3
curl -i 'https://int-api.mx.com/users/USR-11141024-90b3-1bce-cac9-c06ced52ab4c/accounts/ACT-8e6f92c8-1491-42ce-8bf6-c309e9531530/transactions?records_per_page=100&page=2' \
-u 'client_id:api_key' \
-H 'Accept: application/vnd.mx.api.v1+json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"transactions": [
{
"category": "Paycheck",
"category_guid": "CAT-982ea9e6-3f0e-0c5b-611b-6657a10ba819",
"created_at": "2020-09-21T19:43:48Z",
"date": "2020-07-31",
"posted_at": "2020-08-01T12:00:00Z",
"status": "POSTED",
"top_level_category": "Income",
"transacted_at": "2020-07-31T12:00:00Z",
"type": "CREDIT",
"updated_at": "2020-09-21T19:43:51Z",
"account_guid": "ACT-8e6f92c8-1491-42ce-8bf6-c309e9531530",
"amount": 23.57,
"check_number_string": null,
"currency_code": "USD",
"description": "Paycheck",
"guid": "TRN-27b176b7-5941-42a4-8085-cfa6657f6dff",
"is_bill_pay": false,
"is_direct_deposit": false,
"is_expense": false,
"is_fee": false,
"is_income": true,
"is_international": null,
"is_overdraft_fee": false,
"is_payroll_advance": false,
"latitude": null,
"localized_description": null,
"localized_memo": null,
"longitude": null,
"member_guid": "MBR-84ca0882-ad6c-4f10-817f-c8c0de7424fa",
"memo": null,
"merchant_category_code": 0,
"merchant_guid": null,
"original_description": "Payroll",
"user_guid": "USR-11141024-90b3-1bce-cac9-c06ced52ab4c"
},
•••
],
"pagination": {
"current_page": 2,
"per_page": 100,
"total_entries": 176,
"total_pages": 2
}
}
There are several other endpoints that can give you access to transaction data: list transactions by user and list transactions by member. These work in the same way as the list transactions by account endpoint described above.