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

> ## Agent Instructions
> OwnPay is licensed under AGPL-3.0 and is completely free - no licensing fees.
> Production docs URL: https://ownpay.org/docs - append .md to any page URL for clean markdown.
> OwnPay requires PHP 8.3+, MySQL/MariaDB, and Redis.
> MCP server available at https://ownpay.org/docs/mcp for programmatic documentation queries.
> Use root-relative links (e.g. /quickstart) for internal navigation - do NOT include /docs prefix.
> Plugin development: consult /developer/plugin-types/ pages for correct interfaces and manifests.

# Balance Verification - Reconcile Ledger Against Gateways

> Reconcile OwnPay's internal ledger against actual gateway processor balances to detect mismatches, missing entries, and refund discrepancies.

The Balance Verification page provides administrators with a direct financial reconciliation tool. It compares your internal double-entry ledger database states (**Expected Internal**) against the actual processed cash data retrieved directly from the payment gateway APIs (**Actual Gateway**).

## Getting here

1. Log in to the OwnPay admin dashboard
2. Under the **REPORTS & FINANCE** section in the left sidebar, click **Balance Verification**

## Page sections

### 1. Verification controls

* **Currency Dropdown:** Select the target currency context to run the reconciliation on
* **Run Verification Button:** Triggers database queries and external gateway checks

### 2. Reconciliation results table

* **CURRENCY:** Audited currency code
* **EXPECTED (INTERNAL):** Net total calculated from internal double-entry ledger entries
* **ACTUAL (GATEWAY):** Net total compiled from transaction logs registered across payment gateways
* **VARIANCE:** The mathematical variance (Expected minus Actual). Ideally, this should show `0.00`
* **STATUS:** Audit state indicator (`Balanced` in green, or `Discrepancy` in red)

## Fields and options reference

| Table Header            | Type     | Description                                                                    |
| ----------------------- | -------- | ------------------------------------------------------------------------------ |
| **CURRENCY**            | Label    | The currency denominator of the balance being checked                          |
| **EXPECTED (INTERNAL)** | Currency | Aggregate balance computed from internal ledger entries                        |
| **ACTUAL (GATEWAY)**    | Currency | Aggregate balance compiled from physical transaction tables                    |
| **VARIANCE**            | Currency | The discrepancy delta. Any non-zero value indicates a balance drift            |
| **STATUS**              | Badge    | Indicates whether the ledger balances match: `Balanced` or `Variance Detected` |

## Step-by-step: running a balance audit

1. Navigate to the **Balance Verification** page
2. Open the **Currency** dropdown and select the currency to verify
3. Click the **Run Verification** button
4. Scan the table for the **STATUS** badge:
   * If it shows **Balanced** with `0.00` variance, your accounting system is aligned
   * If it shows **Variance Detected**, look at the **VARIANCE** column value

## Best practices

* Run balance verifications before making settlements or payout distributions
* Perform audits during low-traffic periods to ensure pending checkout sessions do not cause temporary variance fluctuations
* Do not ignore non-zero variance values, even if they are minor

<Warning>
  Always post ledger transactions within a database transaction block. If writing custom plugins or addons that interact with balances, utilize the double-entry repository to preserve balance integrity.
</Warning>

## Common mistakes and troubleshooting

| Symptom                          | Cause                                | Fix                                                                                   |
| -------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------- |
| Verification shows mismatches    | Pending transactions not yet settled | Wait for all pending transactions to complete, then re-run verification               |
| Balance discrepancy after refund | Refund ledger entry not recorded     | Check if the refund was processed through OwnPay or directly in the gateway           |
| Verification job not running     | Cron not configured properly         | Verify the cron job is set up as described in the [installation guide](/installation) |

## Related pages

* [Ledger](/user-guide/payments/ledger) - Inspect individual accounting ledger sheets
* [Transactions](/user-guide/payments/transactions) - Monitor real-time transaction updates
* [Audit Log](/user-guide/reports-finance/audit-log) - Check modification actions history


## Related topics

- [Ledger and Accounting - Double-Entry Journal Entries](/docs/user-guide/payments/ledger.md)
- [Features and Capabilities](/docs/resources/features.md)
- [Double-Entry Ledger - Built-in Accounting for Payments](/docs/concepts/ledger.md)
- [Transactions - View Payments, Refunds, and Gateway Status](/docs/user-guide/payments/transactions.md)
- [Performance and Scaling - Caching, Queues, and Optimization](/docs/advanced-topics/performance-scaling.md)
