Calculate average balance

Calculate an average balance for an account.

Using this endpoint, you specify a datetime range and calculate the average balance of an account for that period. The calculation multiplies each unchanged balance by the number of days it remains constant, sums those values, and divides the total by the number of days in the selected range.

The begin_date_datetime and end_date_datetime values are interpreted in the account's time zone, determined in the following order: the account's division, its parent division, the program, and finally UTC when no time zone is available. Only the calendar date of each value is considered. The calculation period begins at 00:00:00 on the start date and ends at 23:59:59 on the end date in the time zone. The period cannot exceed 366 days, and the end date must have already passed in that time zone; otherwise, the request is rejected with HTTP 400.
Requests for the same calendar days are treated as the same calculation, regardless of the time of day provided. If a matching calculation already exists, the request is rejected with HTTP 409, and the details field contains the idempotency key of the existing calculation, which can be used with the GET endpoint.

This endpoint generates the Average balance calculated event once calculation is complete.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
length ≤ 60

Account ID. Accepts either the Pismo account_id or your external_account_id. Send the same ID used to generate the access token.

Body Params
date-time

The specified datetime when the average balance calculation begins. The datetime is displayed in the RFC 3339 format; for example: 2024-01-28T10:33:01Z.

The date time is converted to the account's time zone (refer to the operation description), and only the resulting calendar date is considered. The calculation starts at the beginning of that day (00:00:00). For example, 2024-01-28T02:00:00Z converts to 2024-01-27 in the America/Sao_Paulo time zone, so the calculation begins at 2024-01-27T00:00:00-03:00.

date-time

The specified datetime when the average balance calculation ends. The datetime is displayed in the RFC 3339 format; for example: 2024-01-29T10:33:01Z.

The date time is interpreted in the account's time zone (see the operation description), and only the calendar date is used. The calculation ends at 23:59:59 on that date. The date must have already passed in the account's time zone. The current date and future dates are rejected with HTTP 400.

balance_types_to_calculate
array of strings

Choose a balance to calculate its average balance, you can select multiple balance types to calculate their average balances simultaneously. The balance types are:

  • available
  • savings
  • held_funds
balance_types_to_calculate
Allowed:
Headers
string
required

A unique identifier for the request. If you need to retry a request, use the same idempotency key to avoid creating duplicate resources.

Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json