Data completeness
Every record in the intended date range was sent, without missing or duplicate invoices, refunds, or payments.
Data consistency
The financial totals calculated from those records agree across your system and Layerβs accounting representations.
Amounts returned by Layer are integer cents. Calculate your source-system totals in the same unit and use the exact same date boundaries for both sides of every comparison.
Validation workflow
1
Complete the backfill
Import the full set of invoices, refunds, payments, and related sales data for the period you want to validate. Record the exact
start_date and end_date boundaries used for the backfill.See Sales / AR data for the available invoice, payment, refund, and payout workflows. For large imports, use Bulk create invoices and Bulk create invoice payments where appropriate.2
Calculate invoice totals in your system
Pull every invoice or sales receipt in the synced period, regardless of payment status. Calculate the following totals:
TOTAL_SALESβ Sum all invoice totals.CUSTOMER_REFUNDSβ Sum refunds issued against invoices. Do not include refunded payments that left the invoice open.TIPSβ Sum tips included on invoices.DISCOUNTSβ Sum invoice-level and line-item discounts.SALES_TAXESβ Sum sales taxes reported on invoices.NET_REVENUEβ CalculateTOTAL_SALES - CUSTOMER_REFUNDS - DISCOUNTS - TIPS - SALES_TAXES.
3
Calculate payment processing fees
Pull the payments collected in the synced period and sum the processing fees reported on those payments.Compare this result with
PAYMENT_PROCESSOR_FEES. This field uses the cash basis because it reflects fees on collected payments. It does not include hypothetical fees on invoices for which no payment was collected.4
Fetch and compare Layer's totals
Call the validation endpoint with the same boundaries used for your source-system calculations:The response identifies the report and accounting basis used for each total:Compare each field independently. Matching only
Request
Response
NET_REVENUE can hide offsetting differences between sales, refunds, discounts, tips, or taxes.Investigate a difference by bisecting the period
If a total differs, narrow the problem by repeatedly splitting the date range:- Divide the mismatched period into two non-overlapping date ranges.
- Recalculate the source-system total and call the validation endpoint for each half.
- Keep the half containing the difference and split it again.
- Repeat until the range is small enough to inspect individual records.
Related documentation
Data sync validation API
Review request parameters and the complete response schema.
Import sales and AR data
Review how invoices, payments, refunds, and payouts flow into Layer.