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

# Update Invoice

> Update an existing invoice



## OpenAPI

````yaml PUT /v1/invoices/{invoiceId}
openapi: 3.1.0
info:
  title: Blinksale API
  description: Official API for Blinksale - A modern invoicing solution
  version: 1.0.0
  contact:
    name: Blinksale Support
    url: https://blinksale.com/contact
    email: support@blinksale.com
servers:
  - url: https://app.blinksale.test/api
    description: Development server
  - url: https://blinksale.avenues.dev/api
    description: Staging server
  - url: https://app.blinksale.com/api
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Organizations
    description: Operations for managing organizations
  - name: Profile
    description: Operations for managing user profiles
  - name: Clients
    description: Operations for managing clients
  - name: Contacts
    description: Operations for managing client contacts
  - name: Estimates
    description: Operations for managing estimates
  - name: Invoices
    description: Operations for managing invoices
  - name: Payments
    description: Operations for managing payments
  - name: Recurring Invoices
    description: Operations for managing recurring invoices
  - name: Taxes
    description: Operations for managing tax rates
  - name: Units
    description: Operations for managing units of measurement
  - name: Saved Items
    description: Operations for managing saved items/products
  - name: Enums
    description: Operations for retrieving enumeration values
paths:
  /v1/invoices/{invoiceId}:
    put:
      tags:
        - Invoices
      summary: Update invoice
      description: Updates an existing invoice
      operationId: updateInvoice
      parameters:
        - name: invoiceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the invoice to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - client_id
                - currency
                - tax_distribution
                - discount_distribution
                - net_terms
                - line_items
              properties:
                client_id:
                  type: string
                  format: uuid
                  example: 01jtbf0c9zaraqx3swthf88n5y
                currency:
                  type: string
                  example: USD
                tax_id:
                  type: string
                  format: uuid
                  nullable: true
                  example: 01jtbf0c9zaraqx3swthf88n5y
                tax_distribution:
                  type: string
                  example: PER_DOCUMENT
                discount_type:
                  type: string
                  nullable: true
                  example: PERCENTAGE
                discount_value:
                  type: number
                  format: float
                  nullable: true
                  example: 10
                discount_distribution:
                  type: string
                  example: NO_DISCOUNT
                net_terms:
                  type: string
                  example: NET30
                has_late_fee:
                  type: boolean
                  example: true
                late_fee_kind:
                  type: string
                  nullable: true
                  example: PERCENTAGE
                late_fee_interval:
                  type: string
                  nullable: true
                  example: ONE_TIME
                late_fee:
                  type: number
                  format: float
                  nullable: true
                  example: 5
                shipping:
                  type: number
                  format: float
                  nullable: true
                  example: 0
                notes:
                  type: string
                  nullable: true
                  example: Payment due within 30 days
                options:
                  type: object
                  nullable: true
                issued_at:
                  type: string
                  format: date
                  nullable: true
                  example: '2023-06-15'
                line_items:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                      - quantity
                      - price
                    properties:
                      id:
                        type: string
                        format: uuid
                        nullable: true
                        example: 01jtbf0c9zaraqx3swthf88n5y
                      name:
                        type: string
                        example: Consulting Services
                      description:
                        type: string
                        nullable: true
                        example: Professional consulting services
                      quantity:
                        type: number
                        format: float
                        example: 10
                      price:
                        type: number
                        format: float
                        example: 150
                      unit_of_measurement_id:
                        type: string
                        format: uuid
                        nullable: true
                        example: 01jtbf0c9zaraqx3swthf88n5y
                      tax_id:
                        type: string
                        format: uuid
                        nullable: true
                        example: 01jtbf0c9zaraqx3swthf88n5y
                      tax_name:
                        type: string
                        nullable: true
                        example: Sales Tax
                      tax_percent:
                        type: number
                        format: float
                        nullable: true
                        example: 8.5
                      discount_type:
                        type: string
                        nullable: true
                        example: PERCENTAGE
                      discount_value:
                        type: number
                        format: float
                        nullable: true
                        example: 0
      responses:
        '200':
          description: Invoice updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Invoice updated successfully
                  data:
                    $ref: '#/components/schemas/Invoice'
        '400':
          description: Update failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Invoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        organization_id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        client_id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        converted_from:
          type: string
          format: uuid
          nullable: true
          example: 01jtbf0c9zaraqx3swthf88n5y
        converted_from_number:
          type: string
          nullable: true
          example: EST-00001
        invoice_number:
          type: string
          example: INV-00001
        prefix:
          type: string
          example: INV-
        number:
          type: integer
          example: 1
        currency:
          type: string
          example: USD
        currency_name:
          type: string
          example: US Dollar
        currency_symbol:
          type: string
          example: $
        tax_id:
          type: string
          format: uuid
          nullable: true
          example: 01jtbf0c9zaraqx3swthf88n5y
        tax_name:
          type: string
          nullable: true
          example: Sales Tax
        tax_percent:
          type: number
          format: float
          nullable: true
          example: 8.5
        tax_distribution:
          type: string
          enum:
            - NO_TAX
            - PER_ITEM
            - PER_DOCUMENT
          example: PER_DOCUMENT
        tax_distribution_name:
          type: string
          example: Per Document
        discount_type:
          type: string
          enum:
            - PERCENTAGE
            - FIXED
          nullable: true
          example: PERCENTAGE
        discount_type_name:
          type: string
          nullable: true
          example: Percentage
        discount_value:
          type: number
          format: float
          nullable: true
          example: 10
        discount_distribution:
          type: string
          enum:
            - NO_DISCOUNT
            - PER_ITEM
            - PER_DOCUMENT
          example: PER_DOCUMENT
        discount_distribution_name:
          type: string
          example: Per Document
        net_terms:
          type: string
          enum:
            - IMMEDIATELY
            - NET15
            - NET30
            - NET45
            - NET60
            - OTHER
          example: NET30
        net_terms_name:
          type: string
          example: Net 30
        has_late_fee:
          type: boolean
          example: true
        late_fee_kind:
          type: string
          enum:
            - PERCENTAGE
            - FIXED
          nullable: true
          example: PERCENTAGE
        late_fee_kind_name:
          type: string
          nullable: true
          example: Percentage
        late_fee_interval:
          type: string
          enum:
            - ONE_TIME
            - DAILY
            - WEEKLY
            - MONTHLY
          nullable: true
          example: ONE_TIME
        late_fee_interval_name:
          type: string
          nullable: true
          example: One Time
        late_fee:
          type: number
          format: float
          nullable: true
          example: 5
        next_late_fee_update_at:
          type: string
          format: date-time
          nullable: true
        total_late_fee:
          type: number
          format: float
          example: 0
        shipping:
          type: number
          format: float
          nullable: true
          example: 15
        total:
          type: number
          format: float
          example: 1642.5
        total_paid:
          type: number
          format: float
          example: 0
        total_due:
          type: number
          format: float
          example: 1642.5
        total_due_unsettled:
          type: number
          format: float
          example: 1642.5
        notes:
          type: string
          nullable: true
          example: Payment due within 30 days.
        options:
          type: object
          nullable: true
        status:
          type: string
          enum:
            - DRAFT
            - SENT
            - VIEWED
            - PAID
            - PARTIAL
            - OVERDUE
            - CANCELED
            - REFUNDED
          example: DRAFT
        status_name:
          type: string
          example: Draft
        is_editable:
          type: boolean
          example: true
        issued_at:
          type: string
          format: date
          nullable: true
          example: '2023-06-15'
        due_at:
          type: string
          format: date
          nullable: true
          example: '2023-07-15'
        client:
          $ref: '#/components/schemas/Client'
        organization:
          $ref: '#/components/schemas/Organization'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/LineItem'
        subtotal:
          type: number
          format: float
          example: 1500
        document_discount:
          type: number
          format: float
          example: 0
        tax_amount:
          type: number
          format: float
          example: 127.5
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: An error occurred
        errors:
          type: object
          description: Validation errors by field
          example:
            email:
              - The email field is required.
    ValidationError:
      type: object
      required:
        - success
        - message
        - errors
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Validation error
        errors:
          type: object
          description: Validation errors by field
          example:
            email:
              - The email field must be a valid email address.
    Client:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        name:
          type: string
          example: Acme Inc
        email:
          type: string
          format: email
          example: billing@acme.com
        kind:
          type: string
          enum:
            - BUSINESS
            - PERSON
          example: BUSINESS
        kind_name:
          type: string
          example: Business
        profile:
          type: object
          nullable: true
          properties:
            company_name:
              type: string
              example: Acme Inc
            website:
              type: string
              example: https://acme.com
        address:
          $ref: '#/components/schemas/Address'
        document_defaults:
          type: object
          nullable: true
          properties:
            currency:
              type: string
              example: USD
        contact_count:
          type: integer
          example: 3
        note_count:
          type: integer
          example: 2
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Organization:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        name:
          type: string
          example: Acme Inc
        stripe_id:
          type: string
          nullable: true
        subscription:
          $ref: '#/components/schemas/Subscription'
        profile:
          type: object
          nullable: true
        role:
          type: string
          enum:
            - OWNER
            - MEMBER
          example: OWNER
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    LineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        organization_id:
          type: string
          format: uuid
          example: 01jtbf0c9zaraqx3swthf88n5y
        name:
          type: string
          example: Consulting Services
        description:
          type: string
          nullable: true
          example: Professional consulting services
        quantity:
          type: number
          format: float
          example: 10
        price:
          type: number
          format: float
          example: 150
        unit_of_measurement_id:
          type: string
          format: uuid
          nullable: true
          example: 01jtbf0c9zaraqx3swthf88n5y
        unit_name:
          type: string
          nullable: true
          example: Hour
        tax_id:
          type: string
          format: uuid
          nullable: true
          example: 01jtbf0c9zaraqx3swthf88n5y
        tax_name:
          type: string
          nullable: true
          example: Sales Tax
        tax_percent:
          type: number
          format: float
          nullable: true
          example: 8.5
        discount_type:
          type: string
          enum:
            - PERCENTAGE
            - FIXED
          nullable: true
          example: PERCENTAGE
        discount_value:
          type: number
          format: float
          nullable: true
          example: 10
        subtotal:
          type: number
          format: float
          example: 1500
        tax_amount:
          type: number
          format: float
          example: 127.5
        total:
          type: number
          format: float
          example: 1627.5
    Address:
      type: object
      nullable: true
      properties:
        line1:
          type: string
          example: 123 Main St
        line2:
          type: string
          nullable: true
          example: Suite 101
        city:
          type: string
          example: San Francisco
        state:
          type: string
          example: CA
        zip:
          type: string
          example: '94107'
        country:
          type: string
          example: US
    Subscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - ACTIVE
            - CANCELED
            - EXPIRED
            - INCOMPLETE
            - PAST_DUE
            - PENDING
            - TRIAL
        plan:
          type: string
          enum:
            - FREE
            - BASIC
            - PREMIUM
            - ENTERPRISE
        trial_ends_at:
          type: string
          format: date-time
          nullable: true
        ends_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token obtained from the /v1/auth/login endpoint

````