> ## 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](https://docs.straddle.com/playbooks/reconcile-payments.md).

## Before you begin

* Install the [Straddle CLI](https://docs.straddle.com/developer-tools/cli/install.md) and configure an API key for the environment you want to analyze.
* Confirm your [integration type and acting account](https://docs.straddle.com/developer-tools/cli/auth-context.md).
* 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

**1. 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
```

**2. 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.

**3. 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.

**4. 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.

## 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](https://docs.straddle.com/playbooks/investigate-data.md) to break the volume down by status, [failure and return investigation](https://docs.straddle.com/playbooks/returns.md) to inspect unsuccessful payments, or [reconciliation](https://docs.straddle.com/playbooks/reconcile-payments.md) to connect payments to funding events.


## Related topics

- [Payment operations playbooks](https://docs.straddle.com/playbooks/overview.md)
- [Refund a charge](https://docs.straddle.com/api-reference/charges/refund.md)
- [Create a payout](https://docs.straddle.com/api-reference/payouts/create.md)
- [Cancel a charge](https://docs.straddle.com/api-reference/charges/cancel.md)
- [Hold a charge](https://docs.straddle.com/api-reference/charges/hold.md)


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