DOCS

New!

/

5 minute read

October 5, 2019

Program Balances

Use this view endpoint to retrieve balance data about the program account. Each row represents the net loads against the program account for a day. 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 program balance data (JSON)

Action: GET
Endpoint: /views/programbalances/day

Retrieve program balance data aggregated by day. This endpoint returns a JSON object that contains an array of records matching your filter query.

Sample response body

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

{
     "total": 3,
     "is_more": false,
     "count": 3,
     "info": {},
     "start_date": "2018-05-28T00:00:00+0000",
     "end_date": "2018-06-13T00:00:00+0000",
     "last_run_time": "2018-05-08T16:05:49Z",
     "schema": [
         {
             "field": "date",
             "type": "date",
             "display": "Date",
             "units": null,
             "hasTotal": false,
             "date_format": "YYYY-MM-DD",
             "is_filter_only": false
         },
         {
             "field": "beginning_bank_balance",
             "type": "numeric(18,2)",
             "display": "Beginning Bank Balance",
             "units": "USD",
             "hasTotal": true,
             "is_filter_only": false
         },
         {
             "field": "amount_to_send",
             "type": "numeric(18,2)",
             "display": "Amount To Send",
             "units": "USD",
             "hasTotal": true,
             "is_filter_only": false
         },
         {
             "field": "deposit",
             "type": "integer",
             "display": "Deposit",
             "units": "USD",
             "hasTotal": true,
             "is_filter_only": false
         },
         {
             "field": "ending_bank_balance",
             "type": "numeric(18,2)",
             "display": "Ending Bank Balance",
             "units": "USD",
             "hasTotal": true,
             "is_filter_only": false
         }
     ],
     "records": [
         {
             "date": "2018-06-13T00:00:00.000Z",
             "beginning_bank_balance": 3436949.79,
             "amount_to_send": 0,
             "deposit": 0,
             "ending_bank_balance": 3436949.79
         },
         {
             "date": "2018-06-12T00:00:00.000Z",
             "beginning_bank_balance": 4237024.77,
             "amount_to_send": -800074.98,
             "deposit": 0,
             "ending_bank_balance": 3436949.79
         },
         {
             "date": "2018-06-11T00:00:00.000Z",
             "beginning_bank_balance": 4110270.69,
             "amount_to_send": -1142776.71,
             "deposit": 1269530,
             "ending_bank_balance": 4237024.77
         }
     ]
 }

Is this helpful?

Retrieve program balance data (file export)

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

Retrieve program balance data 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.

URL path parameters

Fields Description

export_type

string, required

File format in which to export the data.

Allowable Values: csv

Query parameters

Fields Description

compress

string, optional

Type of file compression for the exported file.

Allowable Values: gz, zip

Default value: gz

Sample response body

The following sample shows a representative response for a GET request to the /views/programbalances/day/csv?program=my_program endpoint.

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

Is this helpful?

Retrieve schema for program balance

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

Retrieve a JSON representation of the program balance view schema for data 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/programbalances/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": "date",
        "type": "date",
        "display": "Date",
        "units": null,
        "hasTotal": false,
        "date_format": "YYYY-MM-DD",
        "is_filter_only": false
    },
    {
        "field": "beginning_bank_balance",
        "type": "numeric(18,2)",
        "display": "Beginning Bank Balance",
        "units": "USD",
        "hasTotal": true,
        "is_filter_only": false
    },
    {
        "field": "amount_to_send",
        "type": "numeric(18,2)",
        "display": "Amount To Send",
        "units": "USD",
        "hasTotal": true,
        "is_filter_only": false
    },
    {
        "field": "deposit",
        "type": "integer",
        "display": "Deposit",
        "units": "USD",
        "hasTotal": true,
        "is_filter_only": false
    },
    {
        "field": "ending_bank_balance",
        "type": "numeric(18,2)",
        "display": "Ending Bank Balance",
        "units": "USD",
        "hasTotal": true,
        "is_filter_only": false
    }
]

Is this helpful?

Have any feedback on this page?

If you feel we can do anything better, please let our team know.

We strive for the best possible developer experience.