> ## Documentation Index
> Fetch the complete documentation index at: https://docs.straddle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare charge and payout volume

> Measure payment creation volume by day or seven-day period for a selected account.

Compare the amounts and counts of charges and payouts created over a period. The report includes every stored payment status, including failed and canceled payments, so it describes payment creation volume. For money transferred to or from your bank account, use [reconciliation](/playbooks/reconcile-payments).

## Before you begin

* Install the [Straddle CLI](/developer-tools/cli/install) and configure an API key for the environment you want to analyze.
* Confirm your [integration type and acting account](/developer-tools/cli/auth-context).
* Choose the number of days to include. The window ends today, using the local time zone of the computer running the CLI.
* Keep the same context and database throughout. Add the same `--db PATH` to each `sync` and `cashflow` command if you use a custom database.

## Run the workflow

<Steps>
  <Step title="Confirm the account and environment">
    ```bash theme={null}
    straddle agent-context --pretty
    ```

    Check `runtime_context.environment`, `runtime_context.integration_type`, and `runtime_context.acting_account`. For SaaS or marketplace, select the account if needed and check again:

    ```bash theme={null}
    straddle use-account ACCOUNT_ID
    straddle agent-context --pretty
    ```
  </Step>

  <Step title="Refresh payment records">
    ```bash theme={null}
    straddle sync --resources payments --full --max-pages 0 --strict --json
    ```

    Confirm a `sync_complete` event and a final `sync_summary` with `success: 1`, `warned: 0`, and `errored: 0`. Review any `sync_warning` or `sync_anomaly` before drawing conclusions, including findings that accompany exit code zero.
  </Step>

  <Step title="Compare daily volume">
    ```bash theme={null}
    straddle cashflow --days 30 --json
    ```

    This produces one entry for today and each of the preceding 29 days. Days with no matching activity have zero counts and amounts.
  </Step>

  <Step title="Compare longer periods">
    ```bash theme={null}
    straddle cashflow --days 90 --weekly --json
    ```

    The weekly view combines consecutive seven-day periods starting on the first day of the requested window. The last period can contain fewer than seven days. Each entry's `date` is its first day.
  </Step>
</Steps>

## Interpret the results

| Field | Meaning |
| - | - |
| `window_days` and `granularity` | Requested period and grouping, `day` or `week`. |
| `total_in` and `total_out` | Total charge and payout amounts in the window, in cents. |
| `net` | Charge amount minus payout amount, in cents. |
| `buckets` | Periods containing `date`, `charge_count`, `charge_in`, `payout_count`, `payout_out`, and `net`. |

Payments are grouped by `created_at`. Full timestamps are converted to the computer's local time zone; date-only values keep their recorded calendar day. Records with missing or unparseable creation dates are skipped. The calculation puts `payment_type: payout` in payout volume and treats other values, including unknown types, as charge volume.

A value of `12500` represents \$125.00. A negative `net` means payout creation volume exceeds charge creation volume for that period. Check payment statuses and funding evidence before using the amount to explain an actual bank transfer.

## Complete the investigation

Record the environment, acting account, refresh time, date window, time zone, and periods that need explanation. Use [local data investigation](/playbooks/investigate-data) to break the volume down by status, [failure and return investigation](/playbooks/returns) to inspect unsuccessful payments, or [reconciliation](/playbooks/reconcile-payments) to connect payments to funding events.


## Related topics

- [Payment operations playbooks](/playbooks/overview.md)
- [Payouts: send funds to bank accounts](/guides/payments/payouts.md)
- [Work with Straddle from your terminal](/developer-tools/cli/overview.md)
- [Synchronize and query local data](/developer-tools/cli/local-data.md)
- [Refund a charge](/api-reference/charges/refund.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.