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

# Parse invoice

> Uploads and processes a UK energy supplier invoice (PDF or images) to extract invoice details, supply points (MPANs/MPRNs), and associated consumption and charge information.



## OpenAPI

````yaml post /v1/billValidation/parseInvoice
openapi: 3.0.3
info:
  title: VoltView API
  description: >-
    The VoltView API provides comprehensive energy monitoring and management
    capabilities for multi-site businesses, enabling real-time tracking of
    energy consumption, cost analysis, and environmental impact metrics.


    Our API suite includes:

    - Site Management API - Manage and monitor multiple site locations

    - Energy Consumption API - Access detailed energy usage data

    - Cost Analysis API - Track and analyse energy costs

    - Environmental Metrics API - Monitor carbon emissions and energy efficiency

    - Bill Validation API - Validate and audit utility bills for accuracy

    - Supplier Integration API - Integrate with utility suppliers for automated
    data collection


    ## Getting started guide


    To start using the VoltView API, you need to:


    - Sign up for a VoltView account to receive your API credentials

    - Review our data granularity options (hourly/daily/monthly)

    - Ensure your requests are sent via HTTPS

    - All responses are returned in JSON format


    ## Authentication


    Include your VoltView API key in the `x-api-key` header on every request.


    ### Authentication error response

    If authentication fails, you will receive an HTTP 401 Unauthorised response
    with a detailed error message in the JSON response body.


    ## Data Units

    - Energy Consumption: kWh

    - Power Demand: kW

    - Carbon Emissions: kg CO2e/tonnes CO2e

    - Currency: GBP (£)

    - Time Series: ISO 8601 format

    - Numeric Values: Rounded to 2 decimal places
  version: 1.0.0
  contact:
    email: info@voltview.co.uk
  license:
    name: Proprietary
servers:
  - url: https://api.voltview.co.uk
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: Authentication
    description: Endpoints for authentication
  - name: User
    description: User profile management
  - name: Sites
    description: Multi-site management endpoints
  - name: Energy Consumption
    description: Energy consumption data endpoints
  - name: Specific Site
    description: Operations for specific sites
  - name: Meters
    description: Meter lookup and meter readings management
  - name: Emissions
    description: Carbon emissions data endpoints
  - name: LOA Management
    description: >-
      Letter of Authority (LOA) management - create, list, view, and update
      status of LOAs
  - name: Supplier Integration
    description: Utilities integration endpoints
  - name: Billing Insights
    description: Account-level billing insights and bill assurance opportunities
  - name: Bill Validation
    description: Utility bill validation and error detection endpoints
paths:
  /v1/billValidation/parseInvoice:
    post:
      tags:
        - Bill Validation
        - Invoice Parsing
      summary: Parse invoice
      description: >-
        Uploads and processes a UK energy supplier invoice (PDF or images) to
        extract invoice details, supply points (MPANs/MPRNs), and associated
        consumption and charge information.
      operationId: parseInvoice
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    Invoice file(s) to upload (PDF, JPEG, or PNG format). Can
                    upload multiple files.
              required:
                - file
            encoding:
              file:
                contentType: application/pdf, image/jpeg, image/png
      responses:
        '200':
          description: Invoice successfully parsed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/ExtractedData'
        '400':
          description: Bad request - Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                noFiles:
                  value:
                    error: No file uploaded
                fileSize:
                  value:
                    error: File too large
                    message: The uploaded file exceeds the size limit of 50MB.
                invalidField:
                  value:
                    error: Invalid field name
                    message: Files must be uploaded using the field name "file".
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Unauthorized
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to extract data from PDF
        4XX:
          $ref: '#/components/responses/Error4XX'
components:
  schemas:
    ExtractedData:
      type: object
      properties:
        documentType:
          type: string
          enum:
            - invoice
            - statement
            - credit_note
            - debit_note
          nullable: true
          description: Type of document
        isStatement:
          type: boolean
          nullable: true
          example: false
          description: Whether the document is a statement
        supplierName:
          type: string
          nullable: true
          example: British Gas
          description: Name of the supplier
        supplierAccountNumber:
          type: string
          nullable: true
          example: '850012345678'
          description: Supplier account number
        customerName:
          type: string
          nullable: true
          description: Name of the customer
        billingAddress:
          type: string
          nullable: true
          description: Billing address
        items:
          type: array
          nullable: true
          description: Array of invoice items
          items:
            type: object
            properties:
              itemType:
                type: string
                enum:
                  - invoice
                  - credit
                  - debit
                nullable: true
                description: Type of invoice item
              invoiceNumber:
                type: string
                nullable: true
                description: Invoice number
              invoiceDate:
                type: string
                format: date
                nullable: true
                description: Invoice date (YYYY-MM-DD)
              dueDate:
                type: string
                format: date
                nullable: true
                description: Due date (YYYY-MM-DD)
              chargeStartDate:
                type: string
                format: date
                nullable: true
                description: Charge period start date (YYYY-MM-DD)
              chargeEndDate:
                type: string
                format: date
                nullable: true
                description: Charge period end date (YYYY-MM-DD)
              netAmount:
                type: number
                nullable: true
                description: Net amount before VAT
              vatAmount:
                type: number
                nullable: true
                description: VAT amount
              totalAmount:
                type: number
                nullable: true
                description: Total amount including VAT
              previousBalance:
                type: number
                nullable: true
                description: Balance on last bill
              outstandingBalance:
                type: number
                nullable: true
                description: Outstanding balance
              supplyPoints:
                type: array
                nullable: true
                description: Supply points associated with this item
                items:
                  type: object
                  properties:
                    mpanMprn:
                      type: string
                      nullable: true
                      description: >-
                        MPAN (13 digits for electricity) or MPRN (6-10 digits
                        for gas)
                    supplyType:
                      type: string
                      enum:
                        - electricity
                        - gas
                      nullable: true
                      description: Type of supply
                    meterSerialNumber:
                      type: string
                      nullable: true
                      description: Meter serial number
                    consumption:
                      type: object
                      nullable: true
                      description: Consumption details
                      properties:
                        total:
                          type: number
                          nullable: true
                          description: Total consumption
                        unit:
                          type: string
                          default: kWh
                          description: Unit of consumption
                    charges:
                      type: array
                      nullable: true
                      description: Charges for this supply point
                      items:
                        type: object
                        properties:
                          category:
                            type: string
                            enum:
                              - energy
                              - standing
                              - distribution
                              - transmission
                              - environmental
                              - capacity
                              - metering
                              - adjustment
                              - other
                            nullable: true
                            description: Charge category
                          description:
                            type: string
                            nullable: true
                            description: Charge description
                          chargeStartDate:
                            type: string
                            format: date
                            nullable: true
                            description: Charge start date (YYYY-MM-DD)
                          chargeEndDate:
                            type: string
                            format: date
                            nullable: true
                            description: Charge end date (YYYY-MM-DD)
                          startReading:
                            type: number
                            nullable: true
                            description: Start meter reading
                          endReading:
                            type: number
                            nullable: true
                            description: End meter reading
                          readingType:
                            type: string
                            enum:
                              - actual
                              - estimated
                            nullable: true
                            description: Type of reading
                          quantity:
                            type: number
                            nullable: true
                            description: Quantity
                          unit:
                            type: string
                            nullable: true
                            description: Unit of quantity
                          rate:
                            type: number
                            nullable: true
                            description: Rate
                          rateUnit:
                            type: string
                            nullable: true
                            description: Rate unit (e.g., p/kWh, p/day, p/kVA/day)
                          vatRate:
                            type: number
                            nullable: true
                            description: VAT rate percentage
                          netAmount:
                            type: number
                            nullable: true
                            description: Net amount before VAT
                          totalAmount:
                            type: number
                            nullable: true
                            description: Total amount including VAT
                    meterReadings:
                      type: array
                      nullable: true
                      description: Meter readings for this supply point
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            format: date
                            nullable: true
                            description: Reading date (YYYY-MM-DD)
                          type:
                            type: string
                            enum:
                              - actual
                              - estimated
                            nullable: true
                            description: Type of reading
                          reading:
                            type: string
                            nullable: true
                            description: Meter reading value
                          unit:
                            type: string
                            nullable: true
                            description: Unit of reading (e.g., kWh)
                          register:
                            type: string
                            enum:
                              - day
                              - night
                              - peak
                              - off_peak
                              - other
                            nullable: true
                            description: Register type
    Error:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
          description: Error type indicator
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
              description: Specific error type
            message:
              type: string
              description: Human-readable error message
  responses:
    Error4XX:
      description: Client error response
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - error
              error:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - invalid_request_error
                  message:
                    type: string
                    default: Invalid request
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: VoltView API key

````