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

# Update invoice by ID

> Update an invoice

```jsonc Body raw (json) wrap expandable theme={null}
{
    "customer_id"// optional | nullable | integer | required if job_id is not set and is_template is not set or false | existing customer id
    "job_id"// optional | nullable | integer | required if is_template is not set or false | existing job id
    "status"// optional | integer | acceptable_values: 2(draft),3(invoiced),4(paid),5(partialy paid),6(void)
    "status_id"// optional | integer | existing invoice type custom status id
    "status_workflow_id"// optional | integer | existing invoice type status workflow id
    "notes"// optional | string | max:4000
    "invoiced_date"// optional | nullable | timestamp
    "due_date"// optional | nullable | timestamp
    "tax_rate"// required | string | numeric | example: "0.00"
    "is_template"// optional | boolean | Description: if true, the invoice will be template
    "title"// optional | string | max:255
    "author_id"// optional | nullable | integer | existing user id
    "location_id"// optional | nullable | integer | existing location id
    "contract_id"// optional | nullable | integer | existing contract id
    "commission_type"// optional | integer | between:0,3
    "commission_percent"// optional | integer | between:0,100
    "invoice_use_logo"// optional | nullable | boolean
    "invoice_show_line_item_unit_price"// optional | nullable | boolean
    "invoice_show_line_item_qty"// optional | nullable | boolean
    "invoice_show_line_item_taxed"// optional | nullable | boolean
    "invoice_show_line_item_total"// optional | nullable | boolean
    "invoice_show_line_item_desc"// optional | nullable | boolean
    "invoice_show_line_item_sku"// optional | nullable | boolean
    "invoice_show_total_tax"// optional | nullable | boolean
    "invoice_show_job_title"// optional | nullable | boolean
    "invoice_show_job_location"// optional | nullable | boolean
    "invoice_show_assigned_members"// optional | nullable | boolean
    "invoice_show_author"// optional | nullable | boolean
    "invoice_show_service_address"// optional | nullable | boolean
    "invoice_contract_signature_lines"// optional | integer | between:0,2
    "invoice_amount_due_display_type"// optional | string | acceptable_values: remaining_balance,set_amount,percentage_of_total,none
    "invoice_amount_due_display_value"// optional | string
    "invoice_pdf_title"// optional | string | max:100
    "estimate_status"// optional | integer
    "theme_id"// optional | nullable | integer | existing theme id
    "internal_notes"// optional | nullable | string
    "reference"// optional | nullable | string
    "hvi"// optional | numeric
    "company_profile_id"// optional | nullable | integer | existing alternate company profile id
    "maintenance_agreement_id"// optional | nullable | integer | existing maintenance agreement id
    "maintenance_occurrence_id"// optional | nullable | integer | existing maintenance occurrence id
    "occurrence_date"// optional | nullable | required when maintenance agreement id is set and maintenance occurrence id is empty
    "qbd_class_id" // optional | nullable | integer | existing Quickbook Class id
    "qbd_discount_id" // optional | nullable | integer | existing Quickbook Discount Item id
    "qbo_sales_tax_code_id" //  optional | nullable | integer | existing Quickbook Tax Code id
    "display_settings": {// optional | nullable | object
        "show_payment_button"// required | boolean
        "show_signature_button"// required | boolean
        "show_company_title"// optional | boolean
        "is_customer_phone_visible"// optional | boolean
        "is_modified_customer"// optional | boolean
        "modified_customer_display_name"// optional | string
        "modified_customer_display_address"// optional | string
    }
    "estimate_display_settings": {// optional | nullable | object
        "show_payment_button"// required | boolean
        "show_company_title"// optional | boolean
        "is_customer_phone_visible"// optional | boolean
    }
    "expenses": [// optional | nullable | array of objects
        {
            "amount"// required | string | numeric
            "description"// optional | string | max:1000
            "title"// required | string | min:3 | max:60
            "type"// required | string | acceptable_values: service,product
        }
    ]
    "options": [// optional | nullable | array of objects
        {
            "is_selected"// required | boolean
            "is_default"// required | boolean
            "group_number"// required | integer
            "title"// optional | nullable | string
            "description"// optional | nullable | string
            "photo_id"// optional | nullable | integer | existing file id
            "qbd_discount_id"// optional | nullable | integer | existing Quickbook Discount Item id
            "tab_title"// optional | nullable | string
            "line_discount": {  // optional | nullable | object
                "title"// required | string
                "description"// optional | nullable | string
                "type"// required | string
                "amount"// required | string | numeric | example: "0.00"
            }
        }
    ]
    "add_on_options": [// optional | nullable | array of objects
        {
            "is_selected"// required | boolean
            "is_default"// required | boolean
            "group_number"// required | integer
            "title"// optional | nullable | string
            "description"// optional | nullable | string
            "photo_id"// optional | nullable | integer | existing file id
            "tab_title"// optional | nullable | string
        }
    ]
    "line_items": [ // optional | nullable | array of objects | required if company xero is enabled and not_optional_line_items is not set
        {
            "line_number"// required | nullable | integer
            "line_type"// optional | nullable | string | accepatable_values: item, group
            "line_title"// required | nullable | string
            "line_description"// optional | nullable | string
            "line_price_visibility"// required | nullable | string | accepatable_values: all, component, group
            "line_visibility"// required | nullable | string | accepatable_values: all, component, group
            "line_quantity"// nullable | numeric
            "is_selected"// nullable | boolean
            "is_optional"// nullable | boolean
            "qbo_group_item_ref"// optional | nullable | string
            "source"// optional | nullable | integer
            "group_number"// nullable | integer
            "commission_amount"// nullable | string | numeric | example: "0.00"
            "hvi_amount"// string | numeric | example: "0.00"
            "pricebook_id" // nullable | integer | existing  Pricebook id
            "flat_rate_job_id" // nullable | integer | existing pricebook flat rate job id
            "line_components": [
                {
                    "id"// required | integer | existing item id
                    "title"// optional | string |
                    "description"// optional | string | required if title is not set
                    "xero_sales_account"// optional | nullable | string | max:1000
                    "xero_tax_account"// optional | nullable | string | max:1000
                    "tax_rate"// optional | string | max:1000 | example: "0.00"
                    "file_ids"// optional | array | description: array of existing file ids
                    "price_update_method"// nullable | string | accepatable_values: set_price_manually,automatic_markup,use_cmp_pricing
                    "automatic_markup_percentage"// nullable | string | required, if price_update_method is automatic_markup
                    "line_discount"// nullable | array
                    "line_surcharge"// nullable | array
                    "serialized_inventory_id"// nullable | integer
                    "qbo_line_item_id"// nullable | integer
                    "qbo_sales_tax_code_id"//  optional | nullable | integer | existing Quickbook Tax Code id
                    "unit_price"// required | numeric
                    "quantity"// required | numeric
                    "taxable" // required | boolean
                }
            ]
        }
    ]
    "optional_line_items": [
        {
            "line_number"// required | nullable | integer
            "line_type"// optional | nullable | string | accepatable_values: item, group
            "line_title"// required | nullable | string
            "line_description"// optional | nullable | string
            "line_price_visibility"// required | nullable | string | accepatable_values: all, component, group
            "line_visibility"// required | nullable | string | accepatable_values: all, component, group
            "line_quantity"// nullable | numeric
            "is_selected"// nullable | boolean
            "is_optional"// nullable | boolean
            "qbo_group_item_ref"// optional | nullable | string
            "source"// optional | nullable | integer
            "group_number"// nullable | integer
            "commission_amount"// nullable | string | numeric | example: "0.00"
            "hvi_amount"// string | numeric | example: "0.00"
            "pricebook_id" // nullable | integer | existing  Pricebook id
            "flat_rate_job_id" // nullable | integer | existing pricebook flat rate job id
            "line_components": [
                {
                    "id"// required | integer | existing item id
                    "title"// optional | string |
                    "description"// optional | string | required if title is not set
                    "xero_sales_account"// optional | nullable | string | max:1000
                    "xero_tax_account"// optional | nullable | string | max:1000
                    "tax_rate"// optional | string | max:1000 | example: "0.00"
                    "file_ids"// optional | array | description: array of existing file ids
                    "price_update_method"// nullable | string | accepatable_values: set_price_manually,automatic_markup,use_cmp_pricing
                    "automatic_markup_percentage"// nullable | string | required, if price_update_method is automatic_markup
                    "line_discount"// nullable | array
                    "line_surcharge"// nullable | array
                    "serialized_inventory_id"// nullable | integer
                    "qbo_line_item_id"// nullable | integer
                    "qbo_sales_tax_code_id"//  optional | nullable | integer | existing Quickbook Tax Code id
                    "unit_price"// required | numeric
                    "quantity"// required | numeric
                    "taxable" // required | boolean
                }
            ]
        }
    ]
    "not_optional_line_items": [
        {
            "line_number"// required | nullable | integer
            "line_type"// optional | nullable | string | accepatable_values: item, group
            "line_title"// required | nullable | string
            "line_description"// optional | nullable | string
            "line_price_visibility"// required | nullable | string | accepatable_values: all, component, group
            "line_visibility"// required | nullable | string | accepatable_values: all, component, group
            "line_quantity"// nullable | numeric
            "is_selected"// nullable | boolean
            "is_optional"// nullable | boolean
            "qbo_group_item_ref"// optional | nullable | string
            "source"// optional | nullable | integer
            "group_number"// nullable | integer
            "commission_amount"// nullable | string | numeric | example: "0.00"
            "hvi_amount"// string | numeric | example: "0.00"
            "pricebook_id" // nullable | integer | existing  Pricebook id
            "flat_rate_job_id" // nullable | integer | existing pricebook flat rate job id
            "line_components": [
                {
                    "id"// required | integer | existing item id
                    "title"// optional | string |
                    "description"// optional | string | required if title is not set
                    "xero_sales_account"// optional | nullable | string | max:1000
                    "xero_tax_account"// optional | nullable | string | max:1000
                    "tax_rate"// optional | string | max:1000 | example: "0.00"
                    "file_ids"// optional | array | description: array of existing file ids
                    "price_update_method"// nullable | string | accepatable_values: set_price_manually,automatic_markup,use_cmp_pricing
                    "automatic_markup_percentage"// nullable | string | required, if price_update_method is automatic_markup
                    "line_discount"// nullable | array
                    "line_surcharge"// nullable | array
                    "serialized_inventory_id"// nullable | integer
                    "qbo_line_item_id"// nullable | integer
                    "qbo_sales_tax_code_id"//  optional | nullable | integer | existing Quickbook Tax Code id
                    "unit_price"// required | numeric
                    "quantity"// required | numeric
                    "taxable" // required | boolean
                }
            ]
        }
    ]
    "payments": [// optional | nullable | array of objects
        {
            "invoice_id"// required | integer | existing invoice id
            "payment_date"// required | timestamp
            "amount"// required | string | numeric | example: "1.00"
            "method"// required | string | accepatable_values: cash,check,card,square,bank_transfer,other
            "payment_method_id"// optional | nullable | integer | existing payment method id
            "qbd_discount_account_id"// optional | nullable | integer | required if qbd_discount_amount is set | existing Quickbooks Account id
            "qbd_discount_amount"// optional | nullable | string |  numeric | example: "1.00"
            "notes"// optional | string |  max:4000
            "square_transaction_id"// optional | string |  max:4000
            "can_sync_with_integrations"// optional | nullable |  boolean
        }
    ],
    "customfields": [ // optional | array | description: array of custom fleds
        {
            "id" // optional | nullable | required if field_instance_id is not set | integer | custom field id
            "field_instance_id" // optional | nullable | required if id is not set | integer | custom field instance id
            "value" // required | string | custom value
        },
        {
            "id" // optional | nullable | required if field_instance_id is not set | integer | custom field id
            "field_instance_id" // optional | nullable | required if id is not set | integer | custom field instance id
            "value" // required | string | custom value
        }
    ],
    // THis is for sending invoice via email
    "emaildata": {// optional | nullable | object
        "from_name"// required | string | max:255
        "from_email"// required| email | max:255
        "to_email"// required| email | max:255
        "cc_address"// optional | comma separated emails
        "bcc_address"// optional | comma separated emails
        "subject"// required | string | max:500
        "body"// required | string
        "payment_request_amount"// optional | nullable | numeric | min:0
        "payment_request_amount_type"// optional | nullable | string | accepatable_values: amount, percent
        "attachment_ids"// optional | nullable | array | existing file ids
        "visible_file_ids"// optional | nullable | array | existing file ids
        "attach_dynamic_url_to_email"// optional | nullable | boolean
        "show_signature_request"// optional | nullable | boolean
        "show_payment_request"// optional | nullable | boolean
        "is_credit_card_payment_enabled"// optional | nullable | boolean
        "is_ach_payment_enabled"// optional | nullable | boolean
        "is_pdf_send_mode"// optional | nullable | boolean
        "is_dynamic_send_mode"// optional | nullable | boolean
        "include_invoice_pdf"// optional | nullable | boolean
        "is_card_fee_recovery_enabled"// optional | nullable | boolean
    }
}
```


## OpenAPI

````yaml put /invoices/{invoiceId}
openapi: 3.0.0
info:
  title: FieldPulse API
  description: >-
    REST API for the FieldPulse field service management platform.


    **Authentication:** All requests require an `x-api-key` header. Contact
    support@fieldpulse.com to obtain your API key.


    **Important:** The API Playground below makes live requests against your
    production data. Use caution when testing write operations (POST, PUT,
    DELETE).
  version: 1.0.0
servers:
  - url: https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Assets
    description: Endpoints related to assets
  - name: Assets Category
    description: Endpoints related to assets category
  - name: Comments
    description: Endpoints related to comments
  - name: Company Profile
    description: Endpoints related to contracts
  - name: Contracts
    description: Endpoints related to contracts
  - name: Customers
    description: Endpoints related to customers
  - name: Custom Fields
    description: Endpoints related to custom fields
  - name: Estimates
    description: Endpoints related to estimates
  - name: Invoices
  - name: Items
  - name: Jobs
  - name: Lead Source
  - name: Locations
  - name: Material Lists
  - name: Payments
  - name: Pipeline Status
  - name: Projects
  - name: Purchase Orders
  - name: Subtasks
  - name: Tags
  - name: Teams
  - name: Timesheets
  - name: Users
  - name: Vendors
  - name: Version
paths:
  /invoices/{invoiceId}:
    put:
      tags:
        - Invoices
      summary: Update invoice by ID
      description: Update an invoice
      operationId: putInvoicesByInvoiceId
      parameters:
        - name: invoiceId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: integer
                  nullable: true
                  description: >-
                    Required if job_id is not set and is_template is not set or
                    false. Existing customer id.
                job_id:
                  type: integer
                  nullable: true
                  description: >-
                    Required if is_template is not set or false. Existing job
                    id.
                status:
                  type: integer
                  enum:
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
                  description: >-
                    2 = draft, 3 = invoiced, 4 = paid, 5 = partialy paid, 6 =
                    void.
                status_id:
                  type: integer
                  description: Existing invoice type custom status id.
                status_workflow_id:
                  type: integer
                  description: Existing invoice type status workflow id.
                notes:
                  type: string
                  maxLength: 4000
                invoiced_date:
                  type: integer
                  nullable: true
                  description: Unix timestamp.
                due_date:
                  type: integer
                  nullable: true
                  description: Unix timestamp.
                tax_rate:
                  type: string
                  description: A number, sent as a string.
                is_template:
                  type: boolean
                  description: If true, the invoice will be template.
                title:
                  type: string
                  maxLength: 255
                author_id:
                  type: integer
                  nullable: true
                  description: Existing user id.
                location_id:
                  type: integer
                  nullable: true
                  description: Existing location id.
                contract_id:
                  type: integer
                  nullable: true
                  description: Existing contract id.
                commission_type:
                  type: integer
                  minimum: 0
                  maximum: 3
                commission_percent:
                  type: integer
                  minimum: 0
                  maximum: 100
                invoice_use_logo:
                  type: boolean
                  nullable: true
                invoice_show_line_item_unit_price:
                  type: boolean
                  nullable: true
                invoice_show_line_item_qty:
                  type: boolean
                  nullable: true
                invoice_show_line_item_taxed:
                  type: boolean
                  nullable: true
                invoice_show_line_item_total:
                  type: boolean
                  nullable: true
                invoice_show_line_item_desc:
                  type: boolean
                  nullable: true
                invoice_show_line_item_sku:
                  type: boolean
                  nullable: true
                invoice_show_total_tax:
                  type: boolean
                  nullable: true
                invoice_show_job_title:
                  type: boolean
                  nullable: true
                invoice_show_job_location:
                  type: boolean
                  nullable: true
                invoice_show_assigned_members:
                  type: boolean
                  nullable: true
                invoice_show_author:
                  type: boolean
                  nullable: true
                invoice_show_service_address:
                  type: boolean
                  nullable: true
                invoice_contract_signature_lines:
                  type: integer
                  minimum: 0
                  maximum: 2
                invoice_amount_due_display_type:
                  type: string
                  enum:
                    - remaining_balance
                    - set_amount
                    - percentage_of_total
                    - none
                invoice_amount_due_display_value:
                  type: string
                invoice_pdf_title:
                  type: string
                  maxLength: 100
                estimate_status:
                  type: integer
                theme_id:
                  type: integer
                  nullable: true
                  description: Existing theme id.
                internal_notes:
                  type: string
                  nullable: true
                reference:
                  type: string
                  nullable: true
                hvi:
                  type: number
                company_profile_id:
                  type: integer
                  nullable: true
                  description: Existing alternate company profile id.
                maintenance_agreement_id:
                  type: integer
                  nullable: true
                  description: Existing maintenance agreement id.
                maintenance_occurrence_id:
                  type: integer
                  nullable: true
                  description: Existing maintenance occurrence id.
                occurrence_date:
                  type: string
                  nullable: true
                  description: >-
                    Required when maintenance agreement id is set and
                    maintenance occurrence id is empty.
                qbd_class_id:
                  type: integer
                  nullable: true
                  description: Existing Quickbook Class id.
                qbd_discount_id:
                  type: integer
                  nullable: true
                  description: Existing Quickbook Discount Item id.
                qbo_sales_tax_code_id:
                  type: integer
                  nullable: true
                  description: Existing Quickbook Tax Code id.
                display_settings:
                  type: object
                  properties:
                    show_payment_button:
                      type: boolean
                    show_signature_button:
                      type: boolean
                    show_company_title:
                      type: boolean
                    is_customer_phone_visible:
                      type: boolean
                    is_modified_customer:
                      type: boolean
                    modified_customer_display_name:
                      type: string
                    modified_customer_display_address:
                      type: string
                  required:
                    - show_payment_button
                    - show_signature_button
                  nullable: true
                estimate_display_settings:
                  type: object
                  properties:
                    show_payment_button:
                      type: boolean
                    show_company_title:
                      type: boolean
                    is_customer_phone_visible:
                      type: boolean
                  required:
                    - show_payment_button
                  nullable: true
                expenses:
                  type: array
                  items:
                    type: object
                    properties:
                      amount:
                        type: string
                        description: A number, sent as a string.
                      description:
                        type: string
                        maxLength: 1000
                      title:
                        type: string
                        minLength: 3
                        maxLength: 60
                      type:
                        type: string
                        enum:
                          - service
                          - product
                    required:
                      - amount
                      - title
                      - type
                  nullable: true
                options:
                  type: array
                  items:
                    type: object
                    properties:
                      is_selected:
                        type: boolean
                      is_default:
                        type: boolean
                      group_number:
                        type: integer
                      title:
                        type: string
                        nullable: true
                      description:
                        type: string
                        nullable: true
                      photo_id:
                        type: integer
                        nullable: true
                        description: Existing file id.
                      qbd_discount_id:
                        type: integer
                        nullable: true
                        description: Existing Quickbook Discount Item id.
                      tab_title:
                        type: string
                        nullable: true
                      line_discount:
                        type: object
                        properties:
                          title:
                            type: string
                          description:
                            type: string
                            nullable: true
                          type:
                            type: string
                          amount:
                            type: string
                            description: A number, sent as a string.
                        required:
                          - title
                          - type
                          - amount
                        nullable: true
                    required:
                      - is_selected
                      - is_default
                      - group_number
                  nullable: true
                add_on_options:
                  type: array
                  items:
                    type: object
                    properties:
                      is_selected:
                        type: boolean
                      is_default:
                        type: boolean
                      group_number:
                        type: integer
                      title:
                        type: string
                        nullable: true
                      description:
                        type: string
                        nullable: true
                      photo_id:
                        type: integer
                        nullable: true
                        description: Existing file id.
                      tab_title:
                        type: string
                        nullable: true
                    required:
                      - is_selected
                      - is_default
                      - group_number
                  nullable: true
                line_items:
                  type: array
                  items:
                    type: object
                    properties:
                      line_number:
                        type: integer
                        nullable: true
                      line_type:
                        type: string
                        nullable: true
                        enum:
                          - item
                          - group
                      line_title:
                        type: string
                        nullable: true
                      line_description:
                        type: string
                        nullable: true
                      line_price_visibility:
                        type: string
                        nullable: true
                        enum:
                          - all
                          - component
                          - group
                      line_visibility:
                        type: string
                        nullable: true
                        enum:
                          - all
                          - component
                          - group
                      line_quantity:
                        type: number
                        nullable: true
                      is_selected:
                        type: boolean
                        nullable: true
                      is_optional:
                        type: boolean
                        nullable: true
                      qbo_group_item_ref:
                        type: string
                        nullable: true
                      source:
                        type: integer
                        nullable: true
                      group_number:
                        type: integer
                        nullable: true
                      commission_amount:
                        type: string
                        nullable: true
                        description: A number, sent as a string.
                      hvi_amount:
                        type: string
                        description: A number, sent as a string.
                      pricebook_id:
                        type: integer
                        nullable: true
                        description: Existing Pricebook id.
                      flat_rate_job_id:
                        type: integer
                        nullable: true
                        description: Existing pricebook flat rate job id.
                      line_components:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Existing item id.
                            title:
                              type: string
                            description:
                              type: string
                              description: Required if title is not set.
                            xero_sales_account:
                              type: string
                              nullable: true
                              maxLength: 1000
                            xero_tax_account:
                              type: string
                              nullable: true
                              maxLength: 1000
                            tax_rate:
                              type: string
                              maxLength: 1000
                            file_ids:
                              type: array
                              items:
                                type: integer
                              description: Array of existing file ids.
                            price_update_method:
                              type: string
                              nullable: true
                              enum:
                                - set_price_manually
                                - automatic_markup
                                - use_cmp_pricing
                            automatic_markup_percentage:
                              type: string
                              nullable: true
                              description: >-
                                Required if price_update_method is
                                automatic_markup.
                            line_discount:
                              type: array
                              items: {}
                              nullable: true
                            line_surcharge:
                              type: array
                              items: {}
                              nullable: true
                            serialized_inventory_id:
                              type: integer
                              nullable: true
                            qbo_line_item_id:
                              type: integer
                              nullable: true
                            qbo_sales_tax_code_id:
                              type: integer
                              nullable: true
                              description: Existing Quickbook Tax Code id.
                            unit_price:
                              type: number
                            quantity:
                              type: number
                            taxable:
                              type: boolean
                          required:
                            - id
                            - unit_price
                            - quantity
                            - taxable
                    required:
                      - line_number
                      - line_title
                      - line_price_visibility
                      - line_visibility
                  nullable: true
                  description: >-
                    Required if company xero is enabled and
                    not_optional_line_items is not set.
                optional_line_items:
                  type: array
                  items:
                    type: object
                    properties:
                      line_number:
                        type: integer
                        nullable: true
                      line_type:
                        type: string
                        nullable: true
                        enum:
                          - item
                          - group
                      line_title:
                        type: string
                        nullable: true
                      line_description:
                        type: string
                        nullable: true
                      line_price_visibility:
                        type: string
                        nullable: true
                        enum:
                          - all
                          - component
                          - group
                      line_visibility:
                        type: string
                        nullable: true
                        enum:
                          - all
                          - component
                          - group
                      line_quantity:
                        type: number
                        nullable: true
                      is_selected:
                        type: boolean
                        nullable: true
                      is_optional:
                        type: boolean
                        nullable: true
                      qbo_group_item_ref:
                        type: string
                        nullable: true
                      source:
                        type: integer
                        nullable: true
                      group_number:
                        type: integer
                        nullable: true
                      commission_amount:
                        type: string
                        nullable: true
                        description: A number, sent as a string.
                      hvi_amount:
                        type: string
                        description: A number, sent as a string.
                      pricebook_id:
                        type: integer
                        nullable: true
                        description: Existing Pricebook id.
                      flat_rate_job_id:
                        type: integer
                        nullable: true
                        description: Existing pricebook flat rate job id.
                      line_components:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Existing item id.
                            title:
                              type: string
                            description:
                              type: string
                              description: Required if title is not set.
                            xero_sales_account:
                              type: string
                              nullable: true
                              maxLength: 1000
                            xero_tax_account:
                              type: string
                              nullable: true
                              maxLength: 1000
                            tax_rate:
                              type: string
                              maxLength: 1000
                            file_ids:
                              type: array
                              items:
                                type: integer
                              description: Array of existing file ids.
                            price_update_method:
                              type: string
                              nullable: true
                              enum:
                                - set_price_manually
                                - automatic_markup
                                - use_cmp_pricing
                            automatic_markup_percentage:
                              type: string
                              nullable: true
                              description: >-
                                Required if price_update_method is
                                automatic_markup.
                            line_discount:
                              type: array
                              items: {}
                              nullable: true
                            line_surcharge:
                              type: array
                              items: {}
                              nullable: true
                            serialized_inventory_id:
                              type: integer
                              nullable: true
                            qbo_line_item_id:
                              type: integer
                              nullable: true
                            qbo_sales_tax_code_id:
                              type: integer
                              nullable: true
                              description: Existing Quickbook Tax Code id.
                            unit_price:
                              type: number
                            quantity:
                              type: number
                            taxable:
                              type: boolean
                          required:
                            - id
                            - unit_price
                            - quantity
                            - taxable
                    required:
                      - line_number
                      - line_title
                      - line_price_visibility
                      - line_visibility
                not_optional_line_items:
                  type: array
                  items:
                    type: object
                    properties:
                      line_number:
                        type: integer
                        nullable: true
                      line_type:
                        type: string
                        nullable: true
                        enum:
                          - item
                          - group
                      line_title:
                        type: string
                        nullable: true
                      line_description:
                        type: string
                        nullable: true
                      line_price_visibility:
                        type: string
                        nullable: true
                        enum:
                          - all
                          - component
                          - group
                      line_visibility:
                        type: string
                        nullable: true
                        enum:
                          - all
                          - component
                          - group
                      line_quantity:
                        type: number
                        nullable: true
                      is_selected:
                        type: boolean
                        nullable: true
                      is_optional:
                        type: boolean
                        nullable: true
                      qbo_group_item_ref:
                        type: string
                        nullable: true
                      source:
                        type: integer
                        nullable: true
                      group_number:
                        type: integer
                        nullable: true
                      commission_amount:
                        type: string
                        nullable: true
                        description: A number, sent as a string.
                      hvi_amount:
                        type: string
                        description: A number, sent as a string.
                      pricebook_id:
                        type: integer
                        nullable: true
                        description: Existing Pricebook id.
                      flat_rate_job_id:
                        type: integer
                        nullable: true
                        description: Existing pricebook flat rate job id.
                      line_components:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Existing item id.
                            title:
                              type: string
                            description:
                              type: string
                              description: Required if title is not set.
                            xero_sales_account:
                              type: string
                              nullable: true
                              maxLength: 1000
                            xero_tax_account:
                              type: string
                              nullable: true
                              maxLength: 1000
                            tax_rate:
                              type: string
                              maxLength: 1000
                            file_ids:
                              type: array
                              items:
                                type: integer
                              description: Array of existing file ids.
                            price_update_method:
                              type: string
                              nullable: true
                              enum:
                                - set_price_manually
                                - automatic_markup
                                - use_cmp_pricing
                            automatic_markup_percentage:
                              type: string
                              nullable: true
                              description: >-
                                Required if price_update_method is
                                automatic_markup.
                            line_discount:
                              type: array
                              items: {}
                              nullable: true
                            line_surcharge:
                              type: array
                              items: {}
                              nullable: true
                            serialized_inventory_id:
                              type: integer
                              nullable: true
                            qbo_line_item_id:
                              type: integer
                              nullable: true
                            qbo_sales_tax_code_id:
                              type: integer
                              nullable: true
                              description: Existing Quickbook Tax Code id.
                            unit_price:
                              type: number
                            quantity:
                              type: number
                            taxable:
                              type: boolean
                          required:
                            - id
                            - unit_price
                            - quantity
                            - taxable
                    required:
                      - line_number
                      - line_title
                      - line_price_visibility
                      - line_visibility
                payments:
                  type: array
                  items:
                    type: object
                    properties:
                      invoice_id:
                        type: integer
                        description: Existing invoice id.
                      payment_date:
                        type: integer
                        description: Unix timestamp.
                      amount:
                        type: string
                        description: A number, sent as a string.
                      method:
                        type: string
                        enum:
                          - cash
                          - check
                          - card
                          - square
                          - bank_transfer
                          - other
                      payment_method_id:
                        type: integer
                        nullable: true
                        description: Existing payment method id.
                      qbd_discount_account_id:
                        type: integer
                        nullable: true
                        description: >-
                          Required if qbd_discount_amount is set. Existing
                          Quickbooks Account id.
                      qbd_discount_amount:
                        type: string
                        nullable: true
                        description: A number, sent as a string.
                      notes:
                        type: string
                        maxLength: 4000
                      square_transaction_id:
                        type: string
                        maxLength: 4000
                      can_sync_with_integrations:
                        type: boolean
                        nullable: true
                    required:
                      - invoice_id
                      - payment_date
                      - amount
                      - method
                  nullable: true
                customfields:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        nullable: true
                        description: >-
                          Required if field_instance_id is not set. Custom field
                          id.
                      field_instance_id:
                        type: integer
                        nullable: true
                        description: Required if id is not set. Custom field instance id.
                      value:
                        type: string
                        description: Custom value.
                    required:
                      - value
                  description: Array of custom fields.
                emaildata:
                  type: object
                  properties:
                    from_name:
                      type: string
                      maxLength: 255
                    from_email:
                      type: string
                      format: email
                      maxLength: 255
                    to_email:
                      type: string
                      format: email
                      maxLength: 255
                    cc_address:
                      type: string
                      description: Comma separated emails.
                    bcc_address:
                      type: string
                      description: Comma separated emails.
                    subject:
                      type: string
                      maxLength: 500
                    body:
                      type: string
                    payment_request_amount:
                      type: number
                      nullable: true
                      minimum: 0
                    payment_request_amount_type:
                      type: string
                      nullable: true
                      enum:
                        - amount
                        - percent
                    attachment_ids:
                      type: array
                      items:
                        type: integer
                      nullable: true
                      description: Existing file ids.
                    visible_file_ids:
                      type: array
                      items:
                        type: integer
                      nullable: true
                      description: Existing file ids.
                    attach_dynamic_url_to_email:
                      type: boolean
                      nullable: true
                    show_signature_request:
                      type: boolean
                      nullable: true
                    show_payment_request:
                      type: boolean
                      nullable: true
                    is_credit_card_payment_enabled:
                      type: boolean
                      nullable: true
                    is_ach_payment_enabled:
                      type: boolean
                      nullable: true
                    is_pdf_send_mode:
                      type: boolean
                      nullable: true
                    is_dynamic_send_mode:
                      type: boolean
                      nullable: true
                    include_invoice_pdf:
                      type: boolean
                      nullable: true
                    is_card_fee_recovery_enabled:
                      type: boolean
                      nullable: true
                  required:
                    - from_name
                    - from_email
                    - to_email
                    - subject
                    - body
                  nullable: true
              required:
                - tax_rate
            example:
              customer_id: 1
              job_id: 1
              status: 2
              status_id: 1
              status_workflow_id: 1
              notes: some string
              invoiced_date: 1234567890
              due_date: 1234567890
              tax_rate: '0.00'
              is_template: true
              title: some string
              author_id: 1
              location_id: 1
              contract_id: 1
              commission_type: 1
              commission_percent: 1
              invoice_use_logo: true
              invoice_show_line_item_unit_price: true
              invoice_show_line_item_qty: true
              invoice_show_line_item_taxed: true
              invoice_show_line_item_total: true
              invoice_show_line_item_desc: true
              invoice_show_line_item_sku: true
              invoice_show_total_tax: true
              invoice_show_job_title: true
              invoice_show_job_location: true
              invoice_show_assigned_members: true
              invoice_show_author: true
              invoice_show_service_address: true
              invoice_contract_signature_lines: 1
              invoice_amount_due_display_type: remaining_balance
              invoice_amount_due_display_value: some string
              invoice_pdf_title: some string
              estimate_status: 1
              theme_id: 1
              internal_notes: some string
              reference: some string
              hvi: 1
              company_profile_id: 1
              maintenance_agreement_id: 1
              maintenance_occurrence_id: 1
              occurrence_date: some string
              qbd_class_id: 1
              qbd_discount_id: 1
              qbo_sales_tax_code_id: 1
              display_settings:
                show_payment_button: true
                show_signature_button: true
                show_company_title: true
                is_customer_phone_visible: true
                is_modified_customer: true
                modified_customer_display_name: some string
                modified_customer_display_address: some string
              estimate_display_settings:
                show_payment_button: true
                show_company_title: true
                is_customer_phone_visible: true
              expenses:
                - amount: '1.00'
                  description: some string
                  title: some string
                  type: service
              options:
                - is_selected: true
                  is_default: true
                  group_number: 1
                  title: some string
                  description: some string
                  photo_id: 1
                  qbd_discount_id: 1
                  tab_title: some string
                  line_discount:
                    title: some string
                    description: some string
                    type: some string
                    amount: '0.00'
              add_on_options:
                - is_selected: true
                  is_default: true
                  group_number: 1
                  title: some string
                  description: some string
                  photo_id: 1
                  tab_title: some string
              line_items:
                - line_number: 1
                  line_type: item
                  line_title: some string
                  line_description: some string
                  line_price_visibility: all
                  line_visibility: all
                  line_quantity: 1
                  is_selected: true
                  is_optional: true
                  qbo_group_item_ref: some string
                  source: 1
                  group_number: 1
                  commission_amount: '0.00'
                  hvi_amount: '0.00'
                  pricebook_id: 1
                  flat_rate_job_id: 1
                  line_components:
                    - id: 1
                      title: some string
                      description: some string
                      xero_sales_account: some string
                      xero_tax_account: some string
                      tax_rate: '0.00'
                      file_ids:
                        - 1
                      price_update_method: set_price_manually
                      automatic_markup_percentage: some string
                      line_discount: []
                      line_surcharge: []
                      serialized_inventory_id: 1
                      qbo_line_item_id: 1
                      qbo_sales_tax_code_id: 1
                      unit_price: 1
                      quantity: 1
                      taxable: true
              optional_line_items:
                - line_number: 1
                  line_type: item
                  line_title: some string
                  line_description: some string
                  line_price_visibility: all
                  line_visibility: all
                  line_quantity: 1
                  is_selected: true
                  is_optional: true
                  qbo_group_item_ref: some string
                  source: 1
                  group_number: 1
                  commission_amount: '0.00'
                  hvi_amount: '0.00'
                  pricebook_id: 1
                  flat_rate_job_id: 1
                  line_components:
                    - id: 1
                      title: some string
                      description: some string
                      xero_sales_account: some string
                      xero_tax_account: some string
                      tax_rate: '0.00'
                      file_ids:
                        - 1
                      price_update_method: set_price_manually
                      automatic_markup_percentage: some string
                      line_discount: []
                      line_surcharge: []
                      serialized_inventory_id: 1
                      qbo_line_item_id: 1
                      qbo_sales_tax_code_id: 1
                      unit_price: 1
                      quantity: 1
                      taxable: true
              not_optional_line_items:
                - line_number: 1
                  line_type: item
                  line_title: some string
                  line_description: some string
                  line_price_visibility: all
                  line_visibility: all
                  line_quantity: 1
                  is_selected: true
                  is_optional: true
                  qbo_group_item_ref: some string
                  source: 1
                  group_number: 1
                  commission_amount: '0.00'
                  hvi_amount: '0.00'
                  pricebook_id: 1
                  flat_rate_job_id: 1
                  line_components:
                    - id: 1
                      title: some string
                      description: some string
                      xero_sales_account: some string
                      xero_tax_account: some string
                      tax_rate: '0.00'
                      file_ids:
                        - 1
                      price_update_method: set_price_manually
                      automatic_markup_percentage: some string
                      line_discount: []
                      line_surcharge: []
                      serialized_inventory_id: 1
                      qbo_line_item_id: 1
                      qbo_sales_tax_code_id: 1
                      unit_price: 1
                      quantity: 1
                      taxable: true
              payments:
                - invoice_id: 1
                  payment_date: 1234567890
                  amount: '1.00'
                  method: cash
                  payment_method_id: 1
                  qbd_discount_account_id: 1
                  qbd_discount_amount: '1.00'
                  notes: some string
                  square_transaction_id: some string
                  can_sync_with_integrations: true
              customfields:
                - id: 1
                  field_instance_id: 1
                  value: some string
                - id: 1
                  field_instance_id: 1
                  value: some string
              emaildata:
                from_name: some string
                from_email: user@example.com
                to_email: user@example.com
                cc_address: some string
                bcc_address: some string
                subject: some string
                body: some string
                payment_request_amount: 1
                payment_request_amount_type: amount
                attachment_ids:
                  - 1
                visible_file_ids:
                  - 1
                attach_dynamic_url_to_email: true
                show_signature_request: true
                show_payment_request: true
                is_credit_card_payment_enabled: true
                is_ach_payment_enabled: true
                is_pdf_send_mode: true
                is_dynamic_send_mode: true
                include_invoice_pdf: true
                is_card_fee_recovery_enabled: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                    description: false when the request succeeds.
                    example: false
                  response:
                    type: object
                    description: The updated record.
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                error: true
                errors:
                  - error message
                  - error message
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                message: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              example:
                message: Request URL or object not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                message: Internal Server Error
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

## Related topics

- [Webhooks](/api-reference/webhooks.md)
- [Material Lists Overview](/inventory-materials/material-lists/material-lists.md)
- [Offline Mode Overview](/troubleshooting/offline-mode/offline-mode.md)
- [How to Create an Invoice](/estimates-invoices/creating/invoice.md)
- [Setting Up Caller ID](/add-ons/engage/caller-id.md)


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