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

# Fetch data sync validation totals

> Returns accounting totals that you can compare with the source system after syncing or backfilling sales data. Invoice-derived totals use the accrual basis, while payment processor fees use the cash basis. All monetary values are in cents. See the [sales data backfill validation guide](/guides/validating-sales-data-backfills) for the comparison workflow.

Use this report after a sales data sync or backfill to compare Layer's accounting totals with totals calculated from your source system.

Invoice-derived fields use accrual accounting, while `PAYMENT_PROCESSOR_FEES` uses the cash basis. See [Validate a sales data backfill](/guides/validating-sales-data-backfills) for the complete comparison and troubleshooting workflow.


## OpenAPI

````yaml get /v1/businesses/{businessId}/reports/data-sync-validation
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/reports/data-sync-validation:
    get:
      tags: []
      summary: Fetch data sync validation totals
      description: >-
        Returns accounting totals that you can compare with the source system
        after syncing or backfilling sales data. Invoice-derived totals use the
        accrual basis, while payment processor fees use the cash basis. All
        monetary values are in cents. See the [sales data backfill validation
        guide](/guides/validating-sales-data-backfills) for the comparison
        workflow.
      operationId: business.reports.data-sync-validation.get
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business whose synced data you want to validate.
          required: true
          schema:
            type: string
            format: uuid
        - name: start_date
          in: query
          description: The start of the synced period as an ISO 8601 timestamp.
          required: true
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: >-
            The end of the synced period as an ISO 8601 timestamp. Must be later
            than `start_date`.
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Data sync validation totals generated successfully.
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ApiDataSyncValidationReport'
                required:
                  - data
        '400':
          description: >-
            A required date is missing or invalid, or `start_date` is not
            earlier than `end_date`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            The business was not found or is not accessible to the authenticated
            client.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiDataSyncValidationReport:
      type: object
      description: Accounting totals for validating sales data synced over a period.
      properties:
        type:
          type: string
          description: Resource type. Value will be `Data_Sync_Validation_Report`.
          example: Data_Sync_Validation_Report
        business_id:
          type: string
          format: uuid
          description: The business these totals belong to.
        start_date:
          type: string
          format: date-time
          description: The start of the validation period.
        end_date:
          type: string
          format: date-time
          description: The end of the validation period.
        totals:
          type: array
          description: >-
            Totals to compare with the source system. Monetary values are in
            cents.
          items:
            $ref: '#/components/schemas/ApiDataSyncValidationTotal'
      required:
        - business_id
        - start_date
        - end_date
        - totals
    ApiError:
      type: object
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - description
    ApiDataSyncValidationTotal:
      type: object
      description: One total used to validate synced sales data.
      properties:
        field:
          $ref: '#/components/schemas/DataSyncValidationField'
        description:
          type: string
          description: How to calculate the corresponding total in the source system.
        value:
          type: integer
          format: int64
          description: The total amount in cents.
        generated_by:
          $ref: '#/components/schemas/ApiDataSyncValidationGeneratedBy'
      required:
        - field
        - description
        - value
        - generated_by
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
      example: InvalidParameters
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
      example: InvalidPayload
    DataSyncValidationField:
      type: string
      description: The source-system total represented by this value.
      enum:
        - TOTAL_SALES
        - CUSTOMER_REFUNDS
        - TIPS
        - DISCOUNTS
        - SALES_TAXES
        - PAYMENT_PROCESSOR_FEES
        - NET_REVENUE
      example: TOTAL_SALES
    ApiDataSyncValidationGeneratedBy:
      type: object
      description: The accounting report and basis used to generate a validation total.
      properties:
        report:
          $ref: '#/components/schemas/DataSyncValidationSourceReport'
        reporting_basis:
          $ref: '#/components/schemas/ReportingBasis'
      required:
        - report
        - reporting_basis
    DataSyncValidationSourceReport:
      type: string
      description: The Layer accounting report from which the total was generated.
      enum:
        - PROFIT_AND_LOSS
        - BALANCE_SHEET
      example: PROFIT_AND_LOSS
    ReportingBasis:
      type: string
      enum:
        - ACCRUAL
        - CASH
      example: CASH
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````