---
title: "Update an invoice"
method: PATCH
path: "/accounting/{connection_id}/invoice/{id}"
tags: ["accounting", "invoice"]
---

# Update an invoice

`PATCH /accounting/{connection_id}/invoice/{id}`

## Request

- Base URL: `http://api.unified.to`
- URL: `http://api.unified.to/accounting/{connection_id}/invoice/{id}`
- Auth: API key in header `authorization`

## Path parameters

- `connection_id` string, required
- `id` string, required

## Query parameters

- `fields` string[]
- `raw` string

## Request body

- AccountingInvoice
  - `id` string
  - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `due_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `paid_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `refunded_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `cancelled_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `posted_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `total_amount` number
  - `paid_amount` number
  - `refund_amount` number
  - `tax_amount` number
  - `discount_amount` number
  - `balance_amount` number
  - `invoice_number` string: External identifier (ie. reference) for this invoice
  - `reference` string
  - `contact_id` string: (reference to AccountingContact)
  - `currency` string
  - `notes` string
  - `extended_notes` AccountingExtendedNote[]
    - `note` string
    - `user` AccountingExtendedNoteUser
      - `id` string
      - `name` string
    - `date` string, date-time
    - `visibility` 'PUBLIC' | 'PRIVATE'
  - `refund_reason` string
  - `term` 'ON_RECEIPT' | 'NET_7' | 'NET_10' | 'NET_15' | 'NET_20' | 'NET_25' | 'NET_30' | 'NET_45' | 'NET_60' | 'NET_90' | 'OTHER': @deprecated use payment_terms instead
  - `payment_terms` 'ON_RECEIPT' | 'NET_7' | 'NET_10' | 'NET_15' | 'NET_20' | 'NET_25' | 'NET_30' | 'NET_45' | 'NET_60' | 'NET_90' | 'OTHER'
  - `paymentterm_id` string
  - `lineitems` AccountingLineitem[]
    - `id` string
    - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `refunded_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `total_amount` number: unit_quantity * unit_amount + tax_amount
    - `refund_amount` number
    - `discount_amount` number
    - `tax_amount` number
    - `item_id` string: (reference to CommerceItem)
    - `unit_amount` number
    - `unit_quantity` number
    - `item_sku` string
    - `item_name` string
    - `item_description` string
    - `notes` string
    - `taxrate_id` string
    - `account_id` string: (reference to AccountingAccount)
    - `category_ids` string[]
    - `locations` AccountingReference[]
      - `id` string
      - `name` string
    - `item_variants` AccountingReference[]
      - `id` string
      - `name` string
    - `fees` AccountingFee[]
      - `type` 'TAX' | 'DISCOUNT' | 'PROMOTION' | 'SHIPPING' | 'GIFT_WRAP' | 'COD' | 'SURCHARGE' | 'TIP' | 'SERVICE_CHARGE' | 'OTHER', required: Unified fee category
      - `original_type` string: The provider's original fee label, e.g. "VAT" or a shipping carrier name
      - `amount` number, required
      - `currency` string: ISO 4217 currency code, e.g. USD
    - `contact_id` string: (reference to AccountingContact)
    - `project_id` string: ref -> AccountingProject; the project this line is coded to (reference to TaskProject)
    - `exchange_rate` number: The exchange rate applied to this line, for multi-currency documents
    - `is_billable` boolean: True when the line is rebillable to a customer
  - `status` 'DRAFT' | 'VOIDED' | 'AUTHORIZED' | 'PAID' | 'PARTIALLY_PAID' | 'PARTIALLY_REFUNDED' | 'REFUNDED' | 'SUBMITTED' | 'DELETED' | 'OVERDUE'
  - `url` string: The public URL for the invoice to send to a customer to view or pay.
  - `payment_collection_method` 'send_invoice' | 'charge_automatically': When set to charging_automatically, an automated attempt will occur to pay this invoice using the default payment source attached to the contactcustomer. When set to send_invoice, an will email will be sent with this invoice to the contact/customer with payment instructions.
  - `type` 'INVOICE' | 'CREDITMEMO': BILL removed (use AccountingBill); remaining values: INVOICE, CREDITMEMO
  - `attachments` AccountingAttachment[]
    - `id` string
    - `download_url` string
    - `name` string
    - `mime_type` string
  - `send` boolean
  - `organization_id` string
  - `payments` AccountingPaymentReference[]: ead-only reciprocal of PaymentPayment.allocations; payments applied to this invoice
    - `payment_id` string: references a PaymentPayment that was applied to this object (reference to PaymentPayment)
    - `amount` number: amount of the payment applied to this object
    - `allocated_at` string, date-time: Date and time when the payment was applied, in ISO 8601 format and UTC (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `category_ids` string[]
  - `project_id` string: (reference to TaskProject)
  - `metadata` AccountingMetadata[]
    - `id` string
    - `slug` string
    - `value` unknown
    - `namespace` string
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'FILE' | 'TEXTAREA' | 'SINGLE_SELECT' | 'MULTIPLE_SELECT' | 'MEASUREMENT' | 'PRICE' | 'YES_NO' | 'CURRENCY' | 'URL'
    - `extra_data` unknown
  - `sub_total_amount` number: Total before tax
  - `exchange_rate` number: Exchange rate to the base/home currency at the document date
  - `is_inclusive_of_tax` boolean: True when the document amounts already include tax
  - `salesorder_ids` string[]: refs -> AccountingSalesorder; the sales orders this invoice was raised from
  - `raw` unknown

## Response `200`

Successful

- AccountingInvoice
  - `id` string
  - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `due_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `paid_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `refunded_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `cancelled_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `posted_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `total_amount` number
  - `paid_amount` number
  - `refund_amount` number
  - `tax_amount` number
  - `discount_amount` number
  - `balance_amount` number
  - `invoice_number` string: External identifier (ie. reference) for this invoice
  - `reference` string
  - `contact_id` string: (reference to AccountingContact)
  - `currency` string
  - `notes` string
  - `extended_notes` AccountingExtendedNote[]
    - `note` string
    - `user` AccountingExtendedNoteUser
      - `id` string
      - `name` string
    - `date` string, date-time
    - `visibility` 'PUBLIC' | 'PRIVATE'
  - `refund_reason` string
  - `term` 'ON_RECEIPT' | 'NET_7' | 'NET_10' | 'NET_15' | 'NET_20' | 'NET_25' | 'NET_30' | 'NET_45' | 'NET_60' | 'NET_90' | 'OTHER': @deprecated use payment_terms instead
  - `payment_terms` 'ON_RECEIPT' | 'NET_7' | 'NET_10' | 'NET_15' | 'NET_20' | 'NET_25' | 'NET_30' | 'NET_45' | 'NET_60' | 'NET_90' | 'OTHER'
  - `paymentterm_id` string
  - `lineitems` AccountingLineitem[]
    - `id` string
    - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `refunded_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `total_amount` number: unit_quantity * unit_amount + tax_amount
    - `refund_amount` number
    - `discount_amount` number
    - `tax_amount` number
    - `item_id` string: (reference to CommerceItem)
    - `unit_amount` number
    - `unit_quantity` number
    - `item_sku` string
    - `item_name` string
    - `item_description` string
    - `notes` string
    - `taxrate_id` string
    - `account_id` string: (reference to AccountingAccount)
    - `category_ids` string[]
    - `locations` AccountingReference[]
      - `id` string
      - `name` string
    - `item_variants` AccountingReference[]
      - `id` string
      - `name` string
    - `fees` AccountingFee[]
      - `type` 'TAX' | 'DISCOUNT' | 'PROMOTION' | 'SHIPPING' | 'GIFT_WRAP' | 'COD' | 'SURCHARGE' | 'TIP' | 'SERVICE_CHARGE' | 'OTHER', required: Unified fee category
      - `original_type` string: The provider's original fee label, e.g. "VAT" or a shipping carrier name
      - `amount` number, required
      - `currency` string: ISO 4217 currency code, e.g. USD
    - `contact_id` string: (reference to AccountingContact)
    - `project_id` string: ref -> AccountingProject; the project this line is coded to (reference to TaskProject)
    - `exchange_rate` number: The exchange rate applied to this line, for multi-currency documents
    - `is_billable` boolean: True when the line is rebillable to a customer
  - `status` 'DRAFT' | 'VOIDED' | 'AUTHORIZED' | 'PAID' | 'PARTIALLY_PAID' | 'PARTIALLY_REFUNDED' | 'REFUNDED' | 'SUBMITTED' | 'DELETED' | 'OVERDUE'
  - `url` string: The public URL for the invoice to send to a customer to view or pay.
  - `payment_collection_method` 'send_invoice' | 'charge_automatically': When set to charging_automatically, an automated attempt will occur to pay this invoice using the default payment source attached to the contactcustomer. When set to send_invoice, an will email will be sent with this invoice to the contact/customer with payment instructions.
  - `type` 'INVOICE' | 'CREDITMEMO': BILL removed (use AccountingBill); remaining values: INVOICE, CREDITMEMO
  - `attachments` AccountingAttachment[]
    - `id` string
    - `download_url` string
    - `name` string
    - `mime_type` string
  - `send` boolean
  - `organization_id` string
  - `payments` AccountingPaymentReference[]: ead-only reciprocal of PaymentPayment.allocations; payments applied to this invoice
    - `payment_id` string: references a PaymentPayment that was applied to this object (reference to PaymentPayment)
    - `amount` number: amount of the payment applied to this object
    - `allocated_at` string, date-time: Date and time when the payment was applied, in ISO 8601 format and UTC (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `category_ids` string[]
  - `project_id` string: (reference to TaskProject)
  - `metadata` AccountingMetadata[]
    - `id` string
    - `slug` string
    - `value` unknown
    - `namespace` string
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'FILE' | 'TEXTAREA' | 'SINGLE_SELECT' | 'MULTIPLE_SELECT' | 'MEASUREMENT' | 'PRICE' | 'YES_NO' | 'CURRENCY' | 'URL'
    - `extra_data` unknown
  - `sub_total_amount` number: Total before tax
  - `exchange_rate` number: Exchange rate to the base/home currency at the document date
  - `is_inclusive_of_tax` boolean: True when the document amounts already include tax
  - `salesorder_ids` string[]: refs -> AccountingSalesorder; the sales orders this invoice was raised from
  - `raw` unknown

---

[API](https://skmtc.dev/unified/apis/unified-to-api-2.md) · [All operations](https://skmtc.dev/unified/apis/unified-to-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/unified/apis/unified-to-api-2/revisions/7a38bdd7f089?raw)
