---
title: "Validate invoice"
method: POST
path: "/v1/billValidation/validateInvoice"
tags: ["Bill Validation"]
---

# Validate invoice

`POST /v1/billValidation/validateInvoice`

Validates an invoice against contract data and optional user-provided consumption data. Performs comprehensive validation including consumption matching, meter reading verification, and check against contract.

**Validation Rules:**
- Meter Reading Logic: Current reading must be ≥ previous reading
- Contract Matching: Invoice date must fall within contract period
- MPAN Matching: At least one MPAN must match between invoice and contract

**Data Sources:**
- Manual uploads from parseInvoice endpoint
- Invoices from Supplier Integration system
- User-provided consumption and meter reading data

## Request body

- object
  - `filePath` string, required — File path to the invoice document to validate. Can be from a manually uploaded invoice (parseInvoice endpoint) or from an invoice retrieved via Supplier Integration endpoints.
  - `userConsumptionData` object — Optional user-provided consumption data to validate against the invoice
    - `fromDate` string, date-time — Start date of consumption period (ISO 8601)
    - `toDate` string, date-time — End date of consumption period (ISO 8601)
    - `utilityType` 'ELECTRICITY' | 'GAS' | 'BMS' — Type of utility
    - `consumption` object — Consumption values for the period
      - `activeImportKwh` number — Active energy imported (main consumption) in kWh
      - `activeExportKwh` number — Active energy exported in kWh (for sites with generation)
      - `dayConsumption` number — Day/peak consumption in kWh (for dual-rate tariffs)
      - `nightConsumption` number — Night/off-peak consumption in kWh (for dual-rate tariffs)
      - `reactiveImportKvarh` number — Reactive energy imported in kvarh (electricity only)
      - `reactiveExportKvarh` number — Reactive energy exported in kvarh (electricity only)
      - `apparentKvah` number — Apparent energy consumption in kVAh (electricity only)
    - `meterReadings` object — Optional meter reading information
      - `previousReading` number — Previous meter reading
      - `currentReading` number — Current meter reading
      - `previousReadingDate` string, date-time — Date of previous reading (ISO 8601)
      - `currentReadingDate` string, date-time — Date of current reading (ISO 8601)
      - `previousReadingType` 'actual' | 'estimated' | 'customer' | 'smart' — Type of previous reading
      - `currentReadingType` 'actual' | 'estimated' | 'customer' | 'smart' — Type of current reading

## Response `200`

Validation completed - may return passed, failed, or pending status

- ValidationResult
  - `filePath` string — File path to the validated invoice document
  - `status` 'passed' | 'failed' | 'pending' — Validation status - passed means all validations succeeded, failed means discrepancies were found, pending means validation could not be completed (e.g., missing contract data)
  - `errors` object[] — Array of validation errors found. Empty array indicates validation passed.
    - `type` 'consumptionMismatch' | 'rateMismatch' | 'standingChargeError' | 'dayRateMismatch' | 'nightRateMismatch' | 'capacityChargeError' | 'vatError' | 'cclError' | 'dateMismatch' | 'other' — Type of validation error detected
    - `description` string — Human-readable description of the validation error
    - `expected` string — Expected value or condition
    - `actual` string — Actual value found that caused the validation error

## Other responses

- `400` — Bad Request - Invalid input
- `401` — Unauthorized - Authentication required
- `404` — Not Found - Invoice not found

---

[API](https://skmtc.net/voltview/apis/voltview-api.md) · [All operations](https://skmtc.net/voltview/apis/voltview-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voltview/voltview-api/revisions/d90c739b55df/schema)
