Activity Balances

Use this view endpoint to retrieve activity balance data. Activities include loading and spending events. You can break out your data by credit and debit types and aggregate the data by day, or break out your data by the type of transaction (load, PIN, or signature) and aggregate the data by a specified type of account. In both cases, you can also specify the level of card network-specific detail. The data is derived from the balance-related activity on the Marqeta platform.

This endpoint supports multiple response formats, query filtering, field filtering, sorting, pagination, and currency conversion. For more information about response options, see Response Customization.

Retrieve activity data by day (JSON)

Action: GET
Endpoint: /views/activitybalances/day

Retrieve activity balance data, broken out by credit and debit types and aggregated by day. This endpoint returns a JSON object that contains an array of records matching your filter query.

Query parameters

Name Type Required? Description Allowable Values
expand string No Expandable fields for which to retrieve additional details. You can specify any number of expandable fields in a comma-delimited list.

For example, expand=pin_purchases_net breaks out PIN purchases by card network.
pin_purchases_net | sig_purchases_net

Sample response body

The following sample shows a representative response for a GET request to the /views/activitybalances/day?expand=sig_purchases_net&program=my_program endpoint.

{
"total": 2,
"is_more": false,
"count": 2,
"info": {},
"start_date": "2018-05-29T00:00:00+0000",
"end_date": "2018-05-30T00:00:00+0000",
"last_run_time": "",
"schema": [
{
"field": "post_date",
"type": "date",
"display": "Post Date",
"units": null,
"hasTotal": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": false
},
{
"field": "starting_balance",
"type": "numeric(14,2)",
"display": "Starting Balance",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "credit_or_debit_card_loads_net",
"type": "numeric(14,2)",
"display": "Credit Or Debit Card Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "ach_loads_net",
"type": "numeric(14,2)",
"display": "Ach Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "jit_loads_net",
"type": "numeric(14,2)",
"display": "Jit Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "mastercard_sig_purchases",
"type": "numeric(14,2)",
"display": "Mastercard Sig Purchases",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "mastercard_sig_returns",
"type": "numeric(14,2)",
"display": "Mastercard Sig Returns",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "discover_sig_purchases",
"type": "numeric(14,2)",
"display": "Discover Sig Purchases",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "discover_sig_returns",
"type": "numeric(14,2)",
"display": "Discover Sig Returns",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "sig_purchases_net",
"type": "numeric(14,2)",
"display": "Sig Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "pin_purchases_net",
"type": "numeric(14,2)",
"display": "Pin Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "currency_conversion_fees",
"type": "numeric(14,2)",
"display": "Currency Conversion Fees",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "program_fees",
"type": "numeric(14,2)",
"display": "Program Fees",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "ending_balance",
"type": "numeric(14,2)",
"display": "Ending Balance",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
}
],
"records": [
{
"post_date": "2018-05-30T00:00:00.000Z",
"starting_balance": 4758153.08,
"credit_or_debit_card_loads_net": 0,
"ach_loads_net": 0,
"jit_loads_net": -6780.12,
"mastercard_sig_purchases": -1180626.45,
"mastercard_sig_returns": 91652.08,
"discover_sig_purchases": 0,
"discover_sig_returns": 0,
"sig_purchases_net": -1088974.37,
"pin_purchases_net": 0,
"currency_conversion_fees": -1.83,
"program_fees": 0,
"ending_balance": 4125716.01
},
{
"post_date": "2018-05-29T00:00:00.000Z",
"starting_balance": 4725029.65,
"credit_or_debit_card_loads_net": 0,
"ach_loads_net": 0,
"jit_loads_net": 27526.88,
"mastercard_sig_purchases": -1015698.76,
"mastercard_sig_returns": 57639.99,
"discover_sig_purchases": 0,
"discover_sig_returns": 0,
"sig_purchases_net": -958058.77,
"pin_purchases_net": 0,
"currency_conversion_fees": -2.2,
"program_fees": 0,
"ending_balance": 4757211.82
}
]
}


Retrieve activity data by day (file export)

Action: GET
Endpoint: /views/activitybalances/day/{export_type}

Retrieve activity balance data, broken out by credit and debit types and aggregated by day. This endpoint asynchronously generates a file in the specified format and returns a job token for retrieving the file when it is completed. The file contains a list of records matching your filter query.

Path parameters

Name Type Required? Description Allowable Values
export_type string Yes File format in which to export the data. csv | xlsx

Query parameters

Name Type Required? Description Allowable Values
expand string No Expandable fields for which to retrieve additional details. You can specify any number of expandable fields in a comma-delimited list.

For example, expand=pin_purchases_net breaks out PIN purchases by card network.
pin_purchases_net | sig_purchases_net
compress string No Type of file compression for the exported file. gz | zip

Default: gz

Sample response body

{
"token":"111122226c444d8888888a9999ae11111db63da4.csv.gz"
}


Retrieve schema for activity balances by day

Action: GET
Endpoint: /views/activitybalances/day/schema

Retrieve a JSON representation of the activity balance view schema for data broken out by credit and debit types and aggregated by day. The schema object contains an array of objects that describe the available columns and the data type of each column.

Sample response body

The following sample shows a representative response for a GET request to the /views/activitybalances/day/schema?program=my_program endpoint. The schema can vary based on the data you are authorized to access (based on the credentials you provide in your request).

[
{
"field": "post_date",
"type": "date",
"display": "Post Date",
"units": null,
"hasTotal": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": false
},
{
"field": "starting_balance",
"type": "numeric(14,2)",
"display": "Starting Balance",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "credit_or_debit_card_loads_net",
"type": "numeric(14,2)",
"display": "Credit Or Debit Card Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "ach_loads_net",
"type": "numeric(14,2)",
"display": "Ach Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "jit_loads_net",
"type": "numeric(14,2)",
"display": "Jit Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "sig_purchases_net",
"type": "numeric(14,2)",
"display": "Sig Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "pin_purchases_net",
"type": "numeric(14,2)",
"display": "Pin Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "currency_conversion_fees",
"type": "numeric(14,2)",
"display": "Currency Conversion Fees",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "program_fees",
"type": "numeric(14,2)",
"display": "Program Fees",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "ending_balance",
"type": "numeric(14,2)",
"display": "Ending Balance",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
}
]


Retrieve activity data by account (JSON)

Action: GET
Endpoint: /views/activitybalances/{account_agg}

Retrieve activity balance data, broken out by type of transaction (load, PIN, or signature) and aggregated by the specified type of account. This endpoint returns a JSON object that contains an array of records matching your filter query.

Path parameters

Name Type Required? Description Allowable Values
account_agg string Yes Type of account for which to aggregate the data. For more information, see Data aggregation levels. actor | accountholder | business

Query parameters

Name Type Required? Description Allowable Values
expand string No Expandable fields for which to retrieve additional details. You can specify any number of expandable fields in a comma-delimited list.

For example, expand=pin_purchases_net breaks out PIN purchases by card network.
pin_purchases_net | sig_purchases_net

Sample response body

The following sample shows a representative response for a GET request to the /views/activitybalances/actor?count=2&program=my_program endpoint.

{
"total": 2,
"is_more": false,
"count": 2,
"info": {},
"start_date": "2018-05-30T00:00:00+0000",
"end_date": "2018-05-30T00:00:00+0000",
"last_run_time": "",
"schema": [
{
"field": "ach_loads_net",
"type": "numeric(14,2)",
"display": "Ach Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "credit_or_debit_card_loads_net",
"type": "numeric(14,2)",
"display": "Credit Or Debit Card Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "partner_funds_loads_net",
"type": "numeric(14,2)",
"display": "Partner Funds Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "jit_loads_net",
"type": "numeric(14,2)",
"display": "Jit Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "mastercard_sig_purchases",
"type": "numeric(14,2)",
"display": "Mastercard Sig Purchases",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "mastercard_sig_returns",
"type": "numeric(14,2)",
"display": "Mastercard Sig Returns",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "discover_sig_purchases",
"type": "numeric(14,2)",
"display": "Discover Sig Purchases",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "discover_sig_returns",
"type": "numeric(14,2)",
"display": "Discover Sig Returns",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "sig_purchases_net",
"type": "numeric(14,2)",
"display": "Sig Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "pin_purchases_net",
"type": "numeric(14,2)",
"display": "Pin Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "transfers",
"type": "numeric(14,2)",
"display": "Transfers",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "currency_conversion_fees",
"type": "numeric(14,2)",
"display": "Currency Conversion Fees",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "program_fees",
"type": "numeric(14,2)",
"display": "Program Fees",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "net_balance_activity",
"type": "numeric(14,2)",
"display": "Net Balance Activity",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "ending_balance",
"type": "numeric(14,2)",
"display": "Ending Balance",
"hasTotal": true,
"units": null,
"is_filter_only": false
},
{
"field": "account_type",
"type": "character varying(64)",
"display": "Account Type",
"enum_values": [],
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "account_uai",
"type": "character varying(128)",
"display": "Account Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "account_user_token",
"type": "character varying(128)",
"display": "Account User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "acting_uai",
"type": "character varying(128)",
"display": "Acting Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "acting_user_token",
"type": "character varying(128)",
"display": "Acting User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "business_uai",
"type": "character varying(128)",
"display": "Business Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "parent_uai",
"type": "character varying(128)",
"display": "Parent Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "parent_user_token",
"type": "character varying(128)",
"display": "Parent User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "post_date",
"type": "date",
"display": "Post Date",
"units": null,
"hasTotal": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": true
}
],
"records": [
{
"ach_loads_net": 0,
"credit_or_debit_card_loads_net": 0,
"partner_funds_loads_net": -1.49,
"jit_loads_net": 0,
"sig_purchases_net": 0,
"pin_purchases_net": 0,
"transfers": 0,
"currency_conversion_fees": 0,
"program_fees": 0,
"net_balance_activity": -1.49,
"ending_balance": 0,
"account_type": "Parent",
"account_uai": "00001223082900702",
"account_user_token": "W8W2YC0SYL71IMDW",
"acting_uai": "00001223082900702",
"acting_user_token": "W8W2YC0SYL71IMDW",
"business_uai": null,
"parent_uai": "00001223082900702",
"parent_user_token": "W8W2YC0SYL71IMDW"
},
{
"ach_loads_net": 0,
"credit_or_debit_card_loads_net": 0,
"partner_funds_loads_net": -1.61,
"jit_loads_net": 0,
"sig_purchases_net": 0,
"pin_purchases_net": 0,
"transfers": 0,
"currency_conversion_fees": 0,
"program_fees": 0,
"net_balance_activity": -1.61,
"ending_balance": 0,
"account_type": "Parent",
"account_uai": "00001223448695012",
"account_user_token": "FK32F2QCIB0NYMWY",
"acting_uai": "00001223448695012",
"acting_user_token": "FK32F2QCIB0NYMWY",
"business_uai": null,
"parent_uai": "00001223448695012",
"parent_user_token": "FK32F2QCIB0NYMWY"
}
]
}


Retrieve activity data by account (file export)

Action: GET
Endpoint: /views/activitybalances/{account_agg}/{export_type}

Retrieve activity balance data, broken out by type of transaction (load, PIN, or signature) and aggregated by the specified type of account. This endpoint asynchronously generates a file in the specified format and returns a job token for retrieving the file when it is completed. The file contains a list of records matching your filter query.

Path parameters

Name Type Required? Description Allowable Values
account_agg string Yes Type of account for which to aggregate the data. For more information, see Data aggregation levels. actor | accountholder | business
export_type string Yes File format in which to export the data. csv | xlsx

Query parameters

Name Type Required? Description Allowable Values
expand string No Expandable fields for which to retrieve additional details. You can specify any number of expandable fields in a comma-delimited list.

For example, expand=pin_purchases_net breaks out PIN purchases by card network.
pin_purchases_net | sig_purchases_net
compress string No Type of file compression for the exported file. gz | zip

Default: gz

Sample response body

{
"token":"e32112160c9b0b83dd82748b10a9df46d1d75b2a.csv.gz"
}


Retrieve schema for activity balances by account

Action: GET
Endpoint: /views/activitybalances/{account_agg}/schema

Retrieve a JSON representation of the activity balance view schema for data broken out by the type of transaction (load, PIN, or signature) and aggregated by the specified type of account. The schema object contains an array of objects that describe the available columns and the data type of each column.

Path parameters

Name Type Required? Description Allowable Values
account_agg string Yes Account for which to aggregate the data. For more information, see Data aggregation levels. actor | accountholder | business

Sample response body

The following sample shows a representative response for a GET request to the /views/activitybalances/actor/schema?program=my_program endpoint. The schema can vary based on the data aggregation level and the data you are authorized to access (based on the credentials you provide in your request).

[
{
"field": "account_type",
"type": "character varying(64)",
"display": "Account Type",
"enum_values": [],
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "account_user_token",
"type": "character varying(128)",
"display": "Account User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "account_uai",
"type": "character varying(128)",
"display": "Account Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "acting_user_token",
"type": "character varying(128)",
"display": "Acting User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "acting_uai",
"type": "character varying(128)",
"display": "Acting Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "parent_user_token",
"type": "character varying(128)",
"display": "Parent User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "parent_uai",
"type": "character varying(128)",
"display": "Parent Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "business_token",
"type": "character varying(128)",
"display": "Business User Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "business_uai",
"type": "character varying(128)",
"display": "Business Uai",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "business_name",
"type": "character varying(128)",
"display": "Business Name",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "post_date",
"type": "date",
"display": "Post Date",
"units": null,
"hasTotal": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": true
},
{
"field": "ach_loads_net",
"type": "numeric(14,2)",
"display": "Ach Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "credit_or_debit_card_loads_net",
"type": "numeric(14,2)",
"display": "Credit Or Debit Card Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "partner_funds_loads_net",
"type": "numeric(14,2)",
"display": "Partner Funds Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "jit_loads_net",
"type": "numeric(14,2)",
"display": "Jit Loads Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "sig_purchases_net",
"type": "numeric(14,2)",
"display": "Sig Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "pin_purchases_net",
"type": "numeric(14,2)",
"display": "Pin Purchases Net",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "transfers",
"type": "numeric(14,2)",
"display": "Transfers",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "currency_conversion_fees",
"type": "numeric(14,2)",
"display": "Currency Conversion Fees",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "program_fees",
"type": "numeric(14,2)",
"display": "Program Fees",
"units": "USD",
"hasTotal": true,
"is_filter_only": false
},
{
"field": "net_balance_activity",
"type": "numeric(14,2)",
"display": "Net Balance Activity",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "ending_balance",
"type": "numeric(14,2)",
"display": "Ending Balance",
"hasTotal": true,
"units": null,
"is_filter_only": false
}
]