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

# Correct an invoice's service period and re-derive its revenue



## OpenAPI

````yaml https://app.usequanta.com/openapi/quanta-services-api/openapi.json post /admin_api/invoices/update_invoice_service_period
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://app.usequanta.com
    description: Production
security:
  - HTTPBearer: []
paths:
  /admin_api/invoices/update_invoice_service_period:
    post:
      tags:
        - invoice_admin
        - quanta-services-api
      summary: Correct an invoice's service period and re-derive its revenue
      operationId: update_invoice_service_period
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/UpdateInvoiceServicePeriodRequest'
                - $ref: '#/components/schemas/UpdateInvoiceServicePeriodGroupsRequest'
              title: Request
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateInvoiceServicePeriodResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateInvoiceServicePeriodRequest:
      properties:
        service_period:
          $ref: '#/components/schemas/ServicePeriodDates'
        source_ids:
          anyOf:
            - items:
                type: string
              type: array
              minItems: 1
            - type: 'null'
          title: Source Ids
        invoice_source_qid:
          type: string
          title: Invoice Source Qid
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        reason_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason Type
      additionalProperties: false
      type: object
      required:
        - service_period
        - invoice_source_qid
      title: UpdateInvoiceServicePeriodRequest
    UpdateInvoiceServicePeriodGroupsRequest:
      properties:
        invoice_source_qid:
          type: string
          title: Invoice Source Qid
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        reason_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason Type
        period_groups:
          items:
            $ref: '#/components/schemas/ServicePeriodGroupRequest'
          type: array
          minItems: 1
          title: Period Groups
      additionalProperties: false
      type: object
      required:
        - invoice_source_qid
        - period_groups
      title: UpdateInvoiceServicePeriodGroupsRequest
    UpdateInvoiceServicePeriodResponse:
      properties:
        success:
          type: boolean
          title: Success
      type: object
      required:
        - success
      title: UpdateInvoiceServicePeriodResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ServicePeriodDates:
      properties:
        service_start_date:
          type: string
          format: date
          title: Service Start Date
        end_date_inclusive:
          type: string
          format: date
          title: End Date Inclusive
      type: object
      required:
        - service_start_date
        - end_date_inclusive
      title: ServicePeriodDates
    ServicePeriodGroupRequest:
      properties:
        service_period:
          $ref: '#/components/schemas/ServicePeriodDates'
        source_ids:
          anyOf:
            - items:
                type: string
              type: array
              minItems: 1
            - type: 'null'
          title: Source Ids
      type: object
      required:
        - service_period
      title: ServicePeriodGroupRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Quanta Services API scoped bearer token. Supported only on Services API
        routes.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.