> ## 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 contract

> Upload and process a UK energy supplier contract (PDF or images) to extract contract details, supply points (MPANs/MPRNs), and associated tariff information.



## OpenAPI

````yaml post /v1/billValidation/parseContract
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/parseContract:
    post:
      tags:
        - Bill Validation
        - Contract Parsing
      summary: Parse contract
      description: >-
        Upload and process a UK energy supplier contract (PDF or images) to
        extract contract details, supply points (MPANs/MPRNs), and associated
        tariff information.
      operationId: parseContract
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    Contract file(s) to upload (PDF, JPEG, or PNG format). Can
                    upload multiple files (up to 10). Either one PDF or one or
                    more images, but not both types together.
              required:
                - file
            examples:
              pdf:
                summary: Upload PDF contract
                value:
                  file: '@contract.pdf'
              image:
                summary: Upload image contract
                value:
                  file: '@contract.png'
      responses:
        '200':
          description: Contract successfully parsed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractData'
        '400':
          description: Bad request - Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                noFiles:
                  value:
                    error: No file uploaded
                invalidFormat:
                  value:
                    error: Invalid file format
                    message: Only PDF, JPEG, and PNG files are supported
                    supportedFormats:
                      - PDF
                      - JPEG/JPG
                      - PNG
                    invalidFiles:
                      - contract.docx
                mixedTypes:
                  value:
                    error: Mixed file types not allowed
                    message: >-
                      Upload either one PDF or one or more images, but not both
                      types together
                multiplePdfs:
                  value:
                    error: Multiple PDFs not allowed
                    message: Only one PDF file is allowed per request
                fileSize:
                  value:
                    error: File too large
                    message: The uploaded file exceeds the size limit of 32MB.
        '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 process the document. Please try again.
        4XX:
          $ref: '#/components/responses/Error4XX'
components:
  schemas:
    ContractData:
      type: object
      properties:
        customerType:
          type: string
          enum:
            - domestic
            - non_domestic
          nullable: true
          description: >-
            Customer classification - residential (domestic) or business
            (non_domestic)
        supplierAccountNumber:
          type: string
          nullable: true
          description: Supplier account number
        supplierName:
          type: string
          nullable: true
          description: Name of the supplier
        supplierAddress:
          type: string
          nullable: true
          description: Supplier's full address
        supplierCode:
          type: string
          nullable: true
          description: Supplier code
        customerName:
          type: string
          nullable: true
          description: Name of the customer
        billingAddress:
          type: string
          nullable: true
          description: Address where bills are sent (customer's address)
        contractNumber:
          type: string
          nullable: true
          description: Contract number
        contractStartDate:
          type: string
          format: date
          nullable: true
          description: Contract start date (YYYY-MM-DD)
        contractEndDate:
          type: string
          format: date
          nullable: true
          description: Contract end date (YYYY-MM-DD)
        cclRate:
          type: number
          nullable: true
          description: Climate Change Levy (CCL) rate
        isFixedContract:
          type: boolean
          nullable: true
          description: Whether this is a fixed-rate contract
        isMarketRates:
          type: boolean
          nullable: true
          description: Whether this contract uses market rates
        isMicroBusiness:
          type: boolean
          nullable: true
          description: Whether the customer is classified as a micro business
        paymentMethod:
          type: string
          nullable: true
          description: Payment method
        contractTermMonths:
          type: number
          nullable: true
          description: Contract term in months
        supplyPoints:
          type: array
          nullable: true
          description: Array of supply points in the contract
          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
              siteName:
                type: string
                nullable: true
                description: Name of the site
              siteAddress:
                type: string
                nullable: true
                description: Address of the site
              tariffName:
                type: string
                nullable: true
                description: Full name of the tariff
              isNonContractedRate:
                type: boolean
                nullable: true
                description: True if rates are out of contract or deemed rates
              standingCharge:
                type: number
                nullable: true
                description: Standing charge in pence per day (p/day)
              standingChargeType:
                type: string
                nullable: true
                description: Standing charge type
              unitRate:
                type: number
                nullable: true
                description: Single unit rate in pence per kWh (p/kWh)
              dayUnitRate:
                type: number
                nullable: true
                description: Day unit rate in pence per kWh (p/kWh)
              nightUnitRate:
                type: number
                nullable: true
                description: Night unit rate in pence per kWh (p/kWh)
              estimatedAnnualConsumption:
                type: number
                nullable: true
                description: Estimated annual consumption in kWh
              previous12MonthsConsumption:
                type: number
                nullable: true
                description: Previous 12 months consumption in kWh
              maximumImportCapacity:
                type: number
                nullable: true
                description: Maximum import capacity in kVA
              capacityRate:
                type: number
                nullable: true
                description: Capacity charge rate in pence per kVA per day (p/kVA/day)
              directDebitDiscount:
                type: number
                nullable: true
                description: Direct debit discount percentage
              brokerName:
                type: string
                nullable: true
                description: Name of the energy broker
              brokerUplift:
                type: number
                nullable: true
                description: Broker uplift in pence per kWh (p/kWh)
              vatRate:
                type: number
                nullable: true
                description: VAT rate percentage
    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

````