# Accounting API — Bills

> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Bills

This document contains every operation on the `Bills` resource.

---

# List Bills

> **Accounting API** · `GET /accounting/bills`
> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Bills/operation/billsAll

List Bills

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |
| `x-apideck-company-id` | header | `string` | No | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. |
| `cursor` | query | `string` | No | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. |
| `limit` | query | `integer` | No | Number of results to return. Minimum 1, Maximum 200, Default 20 |
| `filter` | query | `object` | No | Apply filters |
| `sort` | query | `object` | No | Apply sorting |
| `pass_through` | query | `object` | No | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads |
| `fields` | query | `string` | No | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |

### Responses

#### 200 — Bills

- `status_code` `integer` **required** — HTTP Response Status Code — example: `200`
- `status` `string` **required** — HTTP Response Status — example: `OK`
- `service` `string` **required** — Apideck ID of service provider — example: `xero`
- `resource` `string` **required** — Unified API resource name — example: `bills`
- `operation` `string` **required** — Operation performed — example: `all`
- `data` `array of object` **required**
  - `id` `string` — A unique identifier for an object. — example: `12345`
  - `downstream_id` `string` — The third-party API ID of original entity — example: `12345`
  - `display_id` `string` — Id to be displayed. — example: `123456`
  - `bill_number` `string` — Reference to supplier bill number — example: `10001`
  - `supplier` `object` — The supplier this entity is linked to.
    - `id` `string` — The ID of the supplier this entity is linked to. — example: `12345`
    - `display_id` `string` — The display ID of the supplier. — example: `SUPP00101`
    - `display_name` `string` — The display name of the supplier. — example: `Windsurf Shop`
    - `company_name` `string` — The company name of the supplier. — example: `The boring company`
    - `address` `object`
      - `id` `string` — Unique identifier for the address. — example: `123`
      - `type` `string` — The type of address. — enum: `primary`, `secondary`, `home`, `office`, `shipping`, `billing`, `work`, `other` — example: `primary`
      - `string` `string` — The address string. Some APIs don't provide structured address data. — example: `25 Spring Street, Blackburn, VIC 3130`
      - `name` `string` — The name of the address. — example: `HQ US`
      - `line1` `string` — Line 1 of the address e.g. number, street, suite, apt #, etc. — example: `Main street`
      - `line2` `string` — Line 2 of the address — example: `apt #`
      - `line3` `string` — Line 3 of the address — example: `Suite #`
      - `line4` `string` — Line 4 of the address — example: `delivery instructions`
      - `line5` `string` — Line 5 of the address — example: `Attention: Finance Dept`
      - `street_number` `string` — Street number — example: `25`
      - `city` `string` — Name of city. — example: `San Francisco`
      - `state` `string` — Name of state — example: `CA`
      - `postal_code` `string` — Zip code or equivalent. — example: `94104`
      - `country` `string` — country code according to ISO 3166-1 alpha-2. — example: `US`
      - `latitude` `string` — Latitude of the address — example: `40.759211`
      - `longitude` `string` — Longitude of the address — example: `-73.984638`
      - `county` `string` — Address field that holds a sublocality, such as a county — example: `Santa Clara`
      - `contact_name` `string` — Name of the contact person at the address — example: `Elon Musk`
      - `salutation` `string` — Salutation of the contact person at the address — example: `Mr`
      - `phone_number` `string` — Phone number of the address — example: `111-111-1111`
      - `fax` `string` — Fax number of the address — example: `122-111-1111`
      - `email` `string` — Email address of the address — example: `elon@musk.com`
      - `website` `string` — Website of the address — example: `https://elonmusk.com`
      - `notes` `string` — Additional notes — example: `Address notes or delivery instructions.`
      - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
  - `company_id` `string` — The company ID the transaction belongs to — example: `12345`
  - `location_id` `string` — The ID of the location — example: `12345`
  - `department_id` `string` — The ID of the department — example: `12345`
  - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
  - `currency_rate` `number` — Currency Exchange Rate at the time entity was recorded/generated. — example: `0.69`
  - `tax_inclusive` `boolean` — Amounts are including tax — example: `true`
  - `bill_date` `string` — Date bill was issued - YYYY-MM-DD. — format: `date` — example: `2020-09-30`
  - `due_date` `string` — The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
  - `paid_date` `string` — The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
  - `po_number` `string` — A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. — example: `90000117`
  - `reference` `string` — Optional reference identifier for the transaction. — example: `INV-2024-001`
  - `line_items` `array of object`
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `row_id` `string` — Row ID — example: `12345`
    - `code` `string` — User defined item code — example: `120-C`
    - `line_number` `integer` — Line number of the resource — example: `1`
    - `description` `string` — User defined description — example: `Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.`
    - `type` `string` — Line Item type — enum: `expense_item`, `expense_account`, `other` — example: `expense_account`
    - `tax_amount` `number` — Tax amount — example: `27.5`
    - `total_amount` `number` — Total amount of the line item — example: `27500`
    - `quantity` `number` — example: `1`
    - `unit_price` `number` — example: `27500.5`
    - `unit_of_measure` `string` — Description of the unit type the item is sold as, ie: kg, hour. — example: `pc.`
    - `discount_percentage` `number` — Discount percentage applied to the line item when supported downstream. — example: `0.01`
    - `discount_amount` `number` — Discount amount applied to the line item when supported downstream. — example: `19.99`
    - `location_id` `string` — The ID of the location — example: `12345`
    - `department_id` `string` — The ID of the department — example: `12345`
    - `subsidiary_id` `string` — The ID of the subsidiary — example: `12345`
    - `category_id` `string` — ID of the category of the line item — example: `12345`
    - `shipping_id` `string` — ID of the shipping of the line item — example: `12345`
    - `memo` `string` — Memo — example: `Some memo`
    - `prepaid` `boolean` — Whether the line item is prepaid — example: `true`
    - `tax_applicable_on` `string` — Tax applicable on — example: `Domestic_Purchase_of_Goods_and_Services`
    - `tax_recoverability` `string` — Tax recoverability — example: `Fully_Recoverable`
    - `tax_method` `string` — Method of tax calculation — example: `Due_to_Supplier`
    - `retention_amount` `number` — Retention amount — example: `1000`
    - `payment_amount` `number` — Payment amount — example: `1000`
    - `item` `object`
      - `id` `string` — ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item — example: `12344`
      - `code` `string` — User defined item code — example: `120-C`
      - `name` `string` — User defined item name — example: `Model Y`
    - `tax_rate` `object`
      - `id` `string` — The ID of the object. — example: `123456`
      - `code` `string` — Tax rate code — example: `N-T`
      - `name` `string` — Name of the tax rate — example: `GST on Purchases`
      - `rate` `number` — Rate of the tax rate — example: `10`
    - `ledger_account` `object`
      - `id` `string` — The unique identifier for the account. — example: `123456`
      - `name` `string` — The name of the account. — example: `Bank account`
      - `nominal_code` `string` — The nominal code of the account. — example: `N091`
      - `code` `string` — The code assigned to the account. — example: `453`
      - `parent_id` `string` — The parent ID of the account. — example: `123456`
      - `display_id` `string` — The display ID of the account. — example: `123456`
    - `purchase_order` `object`
      - `id` `string` — The unique identifier for the purchase order. — example: `123456`
      - `line_id` `string` — The unique identifier for the purchase order line. — example: `123456`
      - `line_number` `string` — The line number of the purchase order line. — example: `1`
    - `tracking_categories` `array of object` — A list of linked tracking categories.
      - `id` `string` — The unique identifier for the tracking category. — example: `123456`
      - `code` `string` — The code of the tracking category. — example: `100`
      - `name` `string` — The name of the tracking category. — example: `New York`
      - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
      - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
    - `customer` `object` — The customer this entity is linked to.
      - `id` `string` — The ID of the customer this entity is linked to. — example: `12345`
      - `display_id` `string` — The display ID of the customer. — example: `CUST00101`
      - `display_name` `string` — The display name of the customer. — example: `Windsurf Shop`
      - `name` `string` — The name of the customer. Deprecated, use display_name instead. — example: `Windsurf Shop`
      - `company_name` `string` — The company name of the customer. — example: `The boring company`
      - `email` `string` — The email address of the customer. — example: `boring@boring.com`
    - `rebilling` `object` — Rebilling metadata for this line item.
      - `rebillable` `boolean` — Whether this line item is eligible for rebilling. — example: `true`
      - `rebill_status` `string` — Status of the rebilling process for this line item. — enum: `pending`, `billed`, `voided` — example: `billed`
      - `linked_transaction_id` `string` — The ID of the transaction this line item was rebilled to. — example: `txn_abc123`
      - `linked_transaction_line_id` `string` — The ID of the line item in the rebilled transaction. — example: `line_xyz789`
    - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
    - `updated_by` `string` — The user who last updated the object. — example: `12345`
    - `created_by` `string` — The user who created the object. — example: `12345`
    - `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
    - `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
    - `worktags` `array of object` — A list of linked worktags. This is only supported for Workday.
      - `id` `string` — The unique identifier for the worktag. — example: `123456`
      - `value` `string` — The value of the worktag. — example: `New York`
  - `terms` `string` — Terms of payment. — example: `Net 30 days`
  - `terms_id` `string` — The ID of the payment terms — example: `12345`
  - `balance` `number` — Balance of bill due. — example: `27500`
  - `deposit` `number` — Amount of deposit made to this bill. — example: `0`
  - `sub_total` `number` — Subtotal amount, normally before tax. — example: `250`
  - `total_tax` `number` — Total tax amount applied to this transaction. — example: `25`
  - `total` `number` — Total amount of bill, including tax. — example: `27500`
  - `tax_code` `string` — Applicable tax id/code override if tax is not supplied on a line item basis. — example: `1234`
  - `notes` `string` — example: `Some notes about this bill.`
  - `status` `string` — Invoice status — enum: `draft`, `submitted`, `authorised`, `partially_paid`, `paid`, `void`, `credit`, `deleted`, `posted` — example: `OK`
  - `ledger_account` `object`
    - `id` `string` — The unique identifier for the account. — example: `123456`
    - `name` `string` — The name of the account. — example: `Bank account`
    - `nominal_code` `string` — The nominal code of the account. — example: `N091`
    - `code` `string` — The code assigned to the account. — example: `453`
    - `parent_id` `string` — The parent ID of the account. — example: `123456`
    - `display_id` `string` — The display ID of the account. — example: `123456`
  - `payment_method` `string` — Payment method used for the transaction, such as cash, credit card, bank transfer, or check — example: `cash`
  - `channel` `string` — The channel through which the transaction is processed. — example: `email`
  - `language` `string` — language code according to ISO 639-1. For the United States - EN — example: `EN`
  - `accounting_by_row` `boolean` — Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. — example: `false`
  - `bank_account` `object`
    - `bank_name` `string` — The name of the bank or financial institution — example: `Chase Bank`
    - `account_number` `string` — The bank account number — example: `123465`
    - `account_name` `string` — The name of the bank account — example: `Main Operating Account`
    - `account_type` `string` — The type of bank account. — enum: `bank_account`, `credit_card`, `other` — example: `credit_card`
    - `iban` `string` — International Bank Account Number — example: `GB33BUKB20201555555555`
    - `bic` `string` — Bank Identifier Code / SWIFT Code — example: `CHASUS33`
    - `routing_number` `string` — Bank routing number (US) — example: `021000021`
    - `bsb_number` `string` — Bank State Branch number (Australia/New Zealand) — example: `062-001`
    - `branch_identifier` `string` — Bank branch identifier — example: `001`
    - `bank_code` `string` — Bank code assigned by central bank — example: `BNH`
    - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
    - `country` `string` — Country code according to ISO 3166-1 alpha-2. — example: `US`
  - `discount_percentage` `number` — Discount percentage applied to this transaction. — example: `5.5`
  - `template_id` `string` — Optional bill template — example: `123456`
  - `approved_by` `string` — The user who approved the bill — example: `John Doe`
  - `amortization_type` `string` — Type of amortization — enum: `manual`, `receipt`, `schedule`, `other`
  - `tax_method` `string` — Method of tax calculation — example: `Due to supplier`
  - `document_received` `boolean` — Whether the document has been received — example: `true`
  - `source_document_url` `string` — URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. — example: `https://www.invoicesolution.com/bill/123456`
  - `payment_allocations` `array of object` — A list of linked payment allocations.
    - `id` `string` — ID of the payment — example: `123456`
    - `allocated_amount` `number` — Amount of the payment allocated to the bill — example: `1000`
    - `date` `string` — Date of the payment — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `tracking_categories` `array of object` — A list of linked tracking categories.
    - `id` `string` — The unique identifier for the tracking category. — example: `123456`
    - `code` `string` — The code of the tracking category. — example: `100`
    - `name` `string` — The name of the tracking category. — example: `New York`
    - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
    - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
  - `updated_by` `string` — The user who last updated the object. — example: `12345`
  - `created_by` `string` — The user who created the object. — example: `12345`
  - `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
  - `custom_fields` `array of object`
    - `id` `string` — Unique identifier for the custom field. — example: `2389328923893298`
    - `name` `string` — Name of the custom field. — example: `employee_level`
    - `description` `string` — More information about the custom field — example: `Employee Level`
    - `value` `string | number | boolean | object | array of string | number | boolean | object`
      - One of:
        - Option 1: string
        - Option 2: number
        - Option 3: boolean
        - Option 4: object

        - Option 5: array of string | number | boolean | object
  - `custom_mappings` `object` — When custom mappings are configured on the resource, the result is included here.
  - `pass_through` `array of object` — The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
    - `service_id` `string` **required** — Identifier for the service to which this pass_through should be applied.
    - `operation_id` `string` — Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request.
    - `extend_object` `object` — Simple object allowing any properties for direct extension.
    - `extend_paths` `array of object` — Array of objects for structured data modifications via paths.
      - `path` `string` **required** — JSONPath string specifying where to apply the value. — example: `$.nested.property`
      - `value` `any` **required** — The value to set at the specified path, can be any type.
  - `accounting_period` `string` — Accounting period — example: `01-24`
  - `attachments` `array of object`
    - `name` `string` — The name of the file — example: `sample.jpg`
    - `mime_type` `string` — The MIME type of the file. — example: `image/jpeg`
    - `is_compressed` `boolean` — Whether the file is c ompressed. — example: `false`
    - `encoding` `string` — The encoding of the file. — example: `base64`
    - `content` `string` — The content of the file. — example: `data:image/jpeg;base64,...`
    - `notes` `string` — The notes of the file. — example: `A sample image`
- `meta` `object` — Response metadata
  - `items_on_page` `integer` — Number of items returned in the data property of the response — example: `50`
  - `cursors` `object` — Cursors to navigate to previous or next pages through the API
    - `previous` `string` — Cursor to navigate to the previous page of results through the API — example: `em9oby1jcm06OnBhZ2U6OjE=`
    - `current` `string` — Cursor to navigate to the current page of results through the API — example: `em9oby1jcm06OnBhZ2U6OjI=`
    - `next` `string` — Cursor to navigate to the next page of results through the API — example: `em9oby1jcm06OnBhZ2U6OjM=`
- `links` `object` — Links to navigate to previous or next pages through the API
  - `previous` `string` — Link to navigate to the previous page through the API — example: `https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D`
  - `current` `string` — Link to navigate to the current page through the API — example: `https://unify.apideck.com/crm/companies`
  - `next` `string` — Link to navigate to the previous page through the API — example: `https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM`
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

---

# Create Bill

> **Accounting API** · `POST /accounting/bills`
> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Bills/operation/billsAdd

Create Bill

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |

### Request Body

_Required._

- `id` `string` — A unique identifier for an object. — example: `12345`
- `downstream_id` `string` — The third-party API ID of original entity — example: `12345`
- `display_id` `string` — Id to be displayed. — example: `123456`
- `bill_number` `string` — Reference to supplier bill number — example: `10001`
- `supplier` `object` — The supplier this entity is linked to.
  - `id` `string` — The ID of the supplier this entity is linked to. — example: `12345`
  - `display_id` `string` — The display ID of the supplier. — example: `SUPP00101`
  - `display_name` `string` — The display name of the supplier. — example: `Windsurf Shop`
  - `company_name` `string` — The company name of the supplier. — example: `The boring company`
  - `address` `object`
    - `id` `string` — Unique identifier for the address. — example: `123`
    - `type` `string` — The type of address. — enum: `primary`, `secondary`, `home`, `office`, `shipping`, `billing`, `work`, `other` — example: `primary`
    - `string` `string` — The address string. Some APIs don't provide structured address data. — example: `25 Spring Street, Blackburn, VIC 3130`
    - `name` `string` — The name of the address. — example: `HQ US`
    - `line1` `string` — Line 1 of the address e.g. number, street, suite, apt #, etc. — example: `Main street`
    - `line2` `string` — Line 2 of the address — example: `apt #`
    - `line3` `string` — Line 3 of the address — example: `Suite #`
    - `line4` `string` — Line 4 of the address — example: `delivery instructions`
    - `line5` `string` — Line 5 of the address — example: `Attention: Finance Dept`
    - `street_number` `string` — Street number — example: `25`
    - `city` `string` — Name of city. — example: `San Francisco`
    - `state` `string` — Name of state — example: `CA`
    - `postal_code` `string` — Zip code or equivalent. — example: `94104`
    - `country` `string` — country code according to ISO 3166-1 alpha-2. — example: `US`
    - `latitude` `string` — Latitude of the address — example: `40.759211`
    - `longitude` `string` — Longitude of the address — example: `-73.984638`
    - `county` `string` — Address field that holds a sublocality, such as a county — example: `Santa Clara`
    - `contact_name` `string` — Name of the contact person at the address — example: `Elon Musk`
    - `salutation` `string` — Salutation of the contact person at the address — example: `Mr`
    - `phone_number` `string` — Phone number of the address — example: `111-111-1111`
    - `fax` `string` — Fax number of the address — example: `122-111-1111`
    - `email` `string` — Email address of the address — example: `elon@musk.com`
    - `website` `string` — Website of the address — example: `https://elonmusk.com`
    - `notes` `string` — Additional notes — example: `Address notes or delivery instructions.`
    - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
- `company_id` `string` — The company ID the transaction belongs to — example: `12345`
- `location_id` `string` — The ID of the location — example: `12345`
- `department_id` `string` — The ID of the department — example: `12345`
- `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
- `currency_rate` `number` — Currency Exchange Rate at the time entity was recorded/generated. — example: `0.69`
- `tax_inclusive` `boolean` — Amounts are including tax — example: `true`
- `bill_date` `string` — Date bill was issued - YYYY-MM-DD. — format: `date` — example: `2020-09-30`
- `due_date` `string` — The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
- `paid_date` `string` — The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
- `po_number` `string` — A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. — example: `90000117`
- `reference` `string` — Optional reference identifier for the transaction. — example: `INV-2024-001`
- `line_items` `array of object`
  - `id` `string` — A unique identifier for an object. — example: `12345`
  - `row_id` `string` — Row ID — example: `12345`
  - `code` `string` — User defined item code — example: `120-C`
  - `line_number` `integer` — Line number of the resource — example: `1`
  - `description` `string` — User defined description — example: `Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.`
  - `type` `string` — Line Item type — enum: `expense_item`, `expense_account`, `other` — example: `expense_account`
  - `tax_amount` `number` — Tax amount — example: `27.5`
  - `total_amount` `number` — Total amount of the line item — example: `27500`
  - `quantity` `number` — example: `1`
  - `unit_price` `number` — example: `27500.5`
  - `unit_of_measure` `string` — Description of the unit type the item is sold as, ie: kg, hour. — example: `pc.`
  - `discount_percentage` `number` — Discount percentage applied to the line item when supported downstream. — example: `0.01`
  - `discount_amount` `number` — Discount amount applied to the line item when supported downstream. — example: `19.99`
  - `location_id` `string` — The ID of the location — example: `12345`
  - `department_id` `string` — The ID of the department — example: `12345`
  - `subsidiary_id` `string` — The ID of the subsidiary — example: `12345`
  - `category_id` `string` — ID of the category of the line item — example: `12345`
  - `shipping_id` `string` — ID of the shipping of the line item — example: `12345`
  - `memo` `string` — Memo — example: `Some memo`
  - `prepaid` `boolean` — Whether the line item is prepaid — example: `true`
  - `tax_applicable_on` `string` — Tax applicable on — example: `Domestic_Purchase_of_Goods_and_Services`
  - `tax_recoverability` `string` — Tax recoverability — example: `Fully_Recoverable`
  - `tax_method` `string` — Method of tax calculation — example: `Due_to_Supplier`
  - `retention_amount` `number` — Retention amount — example: `1000`
  - `payment_amount` `number` — Payment amount — example: `1000`
  - `item` `object`
    - `id` `string` — ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item — example: `12344`
    - `code` `string` — User defined item code — example: `120-C`
    - `name` `string` — User defined item name — example: `Model Y`
  - `tax_rate` `object`
    - `id` `string` — The ID of the object. — example: `123456`
    - `code` `string` — Tax rate code — example: `N-T`
    - `name` `string` — Name of the tax rate — example: `GST on Purchases`
    - `rate` `number` — Rate of the tax rate — example: `10`
  - `ledger_account` `object`
    - `id` `string` — The unique identifier for the account. — example: `123456`
    - `name` `string` — The name of the account. — example: `Bank account`
    - `nominal_code` `string` — The nominal code of the account. — example: `N091`
    - `code` `string` — The code assigned to the account. — example: `453`
    - `parent_id` `string` — The parent ID of the account. — example: `123456`
    - `display_id` `string` — The display ID of the account. — example: `123456`
  - `purchase_order` `object`
    - `id` `string` — The unique identifier for the purchase order. — example: `123456`
    - `line_id` `string` — The unique identifier for the purchase order line. — example: `123456`
    - `line_number` `string` — The line number of the purchase order line. — example: `1`
  - `tracking_categories` `array of object` — A list of linked tracking categories.
    - `id` `string` — The unique identifier for the tracking category. — example: `123456`
    - `code` `string` — The code of the tracking category. — example: `100`
    - `name` `string` — The name of the tracking category. — example: `New York`
    - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
    - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
  - `customer` `object` — The customer this entity is linked to.
    - `id` `string` — The ID of the customer this entity is linked to. — example: `12345`
    - `display_id` `string` — The display ID of the customer. — example: `CUST00101`
    - `display_name` `string` — The display name of the customer. — example: `Windsurf Shop`
    - `name` `string` — The name of the customer. Deprecated, use display_name instead. — example: `Windsurf Shop`
    - `company_name` `string` — The company name of the customer. — example: `The boring company`
    - `email` `string` — The email address of the customer. — example: `boring@boring.com`
  - `rebilling` `object` — Rebilling metadata for this line item.
    - `rebillable` `boolean` — Whether this line item is eligible for rebilling. — example: `true`
    - `rebill_status` `string` — Status of the rebilling process for this line item. — enum: `pending`, `billed`, `voided` — example: `billed`
    - `linked_transaction_id` `string` — The ID of the transaction this line item was rebilled to. — example: `txn_abc123`
    - `linked_transaction_line_id` `string` — The ID of the line item in the rebilled transaction. — example: `line_xyz789`
  - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
  - `updated_by` `string` — The user who last updated the object. — example: `12345`
  - `created_by` `string` — The user who created the object. — example: `12345`
  - `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `worktags` `array of object` — A list of linked worktags. This is only supported for Workday.
    - `id` `string` — The unique identifier for the worktag. — example: `123456`
    - `value` `string` — The value of the worktag. — example: `New York`
- `terms` `string` — Terms of payment. — example: `Net 30 days`
- `terms_id` `string` — The ID of the payment terms — example: `12345`
- `balance` `number` — Balance of bill due. — example: `27500`
- `deposit` `number` — Amount of deposit made to this bill. — example: `0`
- `sub_total` `number` — Subtotal amount, normally before tax. — example: `250`
- `total_tax` `number` — Total tax amount applied to this transaction. — example: `25`
- `total` `number` — Total amount of bill, including tax. — example: `27500`
- `tax_code` `string` — Applicable tax id/code override if tax is not supplied on a line item basis. — example: `1234`
- `notes` `string` — example: `Some notes about this bill.`
- `status` `string` — Invoice status — enum: `draft`, `submitted`, `authorised`, `partially_paid`, `paid`, `void`, `credit`, `deleted`, `posted` — example: `draft`
- `ledger_account` `object`
  - `id` `string` — The unique identifier for the account. — example: `123456`
  - `name` `string` — The name of the account. — example: `Bank account`
  - `nominal_code` `string` — The nominal code of the account. — example: `N091`
  - `code` `string` — The code assigned to the account. — example: `453`
  - `parent_id` `string` — The parent ID of the account. — example: `123456`
  - `display_id` `string` — The display ID of the account. — example: `123456`
- `payment_method` `string` — Payment method used for the transaction, such as cash, credit card, bank transfer, or check — example: `cash`
- `channel` `string` — The channel through which the transaction is processed. — example: `email`
- `language` `string` — language code according to ISO 639-1. For the United States - EN — example: `EN`
- `accounting_by_row` `boolean` — Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. — example: `false`
- `bank_account` `object`
  - `bank_name` `string` — The name of the bank or financial institution — example: `Chase Bank`
  - `account_number` `string` — The bank account number — example: `123465`
  - `account_name` `string` — The name of the bank account — example: `Main Operating Account`
  - `account_type` `string` — The type of bank account. — enum: `bank_account`, `credit_card`, `other` — example: `credit_card`
  - `iban` `string` — International Bank Account Number — example: `GB33BUKB20201555555555`
  - `bic` `string` — Bank Identifier Code / SWIFT Code — example: `CHASUS33`
  - `routing_number` `string` — Bank routing number (US) — example: `021000021`
  - `bsb_number` `string` — Bank State Branch number (Australia/New Zealand) — example: `062-001`
  - `branch_identifier` `string` — Bank branch identifier — example: `001`
  - `bank_code` `string` — Bank code assigned by central bank — example: `BNH`
  - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
  - `country` `string` — Country code according to ISO 3166-1 alpha-2. — example: `US`
- `discount_percentage` `number` — Discount percentage applied to this transaction. — example: `5.5`
- `template_id` `string` — Optional bill template — example: `123456`
- `approved_by` `string` — The user who approved the bill — example: `John Doe`
- `amortization_type` `string` — Type of amortization — enum: `manual`, `receipt`, `schedule`, `other`
- `tax_method` `string` — Method of tax calculation — example: `Due to supplier`
- `document_received` `boolean` — Whether the document has been received — example: `true`
- `source_document_url` `string` — URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. — example: `https://www.invoicesolution.com/bill/123456`
- `payment_allocations` `array of object` — A list of linked payment allocations.
  - `id` `string` — ID of the payment — example: `123456`
  - `allocated_amount` `number` — Amount of the payment allocated to the bill — example: `1000`
  - `date` `string` — Date of the payment — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
- `tracking_categories` `array of object` — A list of linked tracking categories.
  - `id` `string` — The unique identifier for the tracking category. — example: `123456`
  - `code` `string` — The code of the tracking category. — example: `100`
  - `name` `string` — The name of the tracking category. — example: `New York`
  - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
  - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
- `updated_by` `string` — The user who last updated the object. — example: `12345`
- `created_by` `string` — The user who created the object. — example: `12345`
- `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
- `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
- `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
- `custom_fields` `array of object`
  - `id` `string` — Unique identifier for the custom field. — example: `2389328923893298`
  - `name` `string` — Name of the custom field. — example: `employee_level`
  - `description` `string` — More information about the custom field — example: `Employee Level`
  - `value` `string | number | boolean | object | array of string | number | boolean | object`
    - One of:
      - Option 1: string
      - Option 2: number
      - Option 3: boolean
      - Option 4: object

      - Option 5: array of string | number | boolean | object
- `custom_mappings` `object` — When custom mappings are configured on the resource, the result is included here.
- `pass_through` `array of object` — The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
  - `service_id` `string` **required** — Identifier for the service to which this pass_through should be applied.
  - `operation_id` `string` — Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request.
  - `extend_object` `object` — Simple object allowing any properties for direct extension.
  - `extend_paths` `array of object` — Array of objects for structured data modifications via paths.
    - `path` `string` **required** — JSONPath string specifying where to apply the value. — example: `$.nested.property`
    - `value` `any` **required** — The value to set at the specified path, can be any type.
- `accounting_period` `string` — Accounting period — example: `01-24`
- `attachments` `array of object`
  - `name` `string` — The name of the file — example: `sample.jpg`
  - `mime_type` `string` — The MIME type of the file. — example: `image/jpeg`
  - `is_compressed` `boolean` — Whether the file is c ompressed. — example: `false`
  - `encoding` `string` — The encoding of the file. — example: `base64`
  - `content` `string` — The content of the file. — example: `data:image/jpeg;base64,...`
  - `notes` `string` — The notes of the file. — example: `A sample image`

### Responses

#### 201 — Bill created

- `status_code` `integer` **required** — HTTP Response Status Code — example: `201`
- `status` `string` **required** — HTTP Response Status — example: `Created`
- `service` `string` **required** — Apideck ID of service provider — example: `xero`
- `resource` `string` **required** — Unified API resource name — example: `bills`
- `operation` `string` **required** — Operation performed — example: `add`
- `data` `object` **required** — A object containing a unique identifier for the resource that was created, updated, or deleted.
  - `id` `string` **required** — The unique identifier of the resource — example: `12345`
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

---

# Get Bill

> **Accounting API** · `GET /accounting/bills/{id}`
> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Bills/operation/billsOne

Get Bill

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | `string` | Yes | ID of the record you are acting upon. |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |
| `x-apideck-company-id` | header | `string` | No | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |
| `fields` | query | `string` | No | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |

### Responses

#### 200 — Bill

- `status_code` `integer` **required** — HTTP Response Status Code — example: `200`
- `status` `string` **required** — HTTP Response Status — example: `OK`
- `service` `string` **required** — Apideck ID of service provider — example: `xero`
- `resource` `string` **required** — Unified API resource name — example: `bills`
- `operation` `string` **required** — Operation performed — example: `one`
- `data` `object` **required**
  - `id` `string` — A unique identifier for an object. — example: `12345`
  - `downstream_id` `string` — The third-party API ID of original entity — example: `12345`
  - `display_id` `string` — Id to be displayed. — example: `123456`
  - `bill_number` `string` — Reference to supplier bill number — example: `10001`
  - `supplier` `object` — The supplier this entity is linked to.
    - `id` `string` — The ID of the supplier this entity is linked to. — example: `12345`
    - `display_id` `string` — The display ID of the supplier. — example: `SUPP00101`
    - `display_name` `string` — The display name of the supplier. — example: `Windsurf Shop`
    - `company_name` `string` — The company name of the supplier. — example: `The boring company`
    - `address` `object`
      - `id` `string` — Unique identifier for the address. — example: `123`
      - `type` `string` — The type of address. — enum: `primary`, `secondary`, `home`, `office`, `shipping`, `billing`, `work`, `other` — example: `primary`
      - `string` `string` — The address string. Some APIs don't provide structured address data. — example: `25 Spring Street, Blackburn, VIC 3130`
      - `name` `string` — The name of the address. — example: `HQ US`
      - `line1` `string` — Line 1 of the address e.g. number, street, suite, apt #, etc. — example: `Main street`
      - `line2` `string` — Line 2 of the address — example: `apt #`
      - `line3` `string` — Line 3 of the address — example: `Suite #`
      - `line4` `string` — Line 4 of the address — example: `delivery instructions`
      - `line5` `string` — Line 5 of the address — example: `Attention: Finance Dept`
      - `street_number` `string` — Street number — example: `25`
      - `city` `string` — Name of city. — example: `San Francisco`
      - `state` `string` — Name of state — example: `CA`
      - `postal_code` `string` — Zip code or equivalent. — example: `94104`
      - `country` `string` — country code according to ISO 3166-1 alpha-2. — example: `US`
      - `latitude` `string` — Latitude of the address — example: `40.759211`
      - `longitude` `string` — Longitude of the address — example: `-73.984638`
      - `county` `string` — Address field that holds a sublocality, such as a county — example: `Santa Clara`
      - `contact_name` `string` — Name of the contact person at the address — example: `Elon Musk`
      - `salutation` `string` — Salutation of the contact person at the address — example: `Mr`
      - `phone_number` `string` — Phone number of the address — example: `111-111-1111`
      - `fax` `string` — Fax number of the address — example: `122-111-1111`
      - `email` `string` — Email address of the address — example: `elon@musk.com`
      - `website` `string` — Website of the address — example: `https://elonmusk.com`
      - `notes` `string` — Additional notes — example: `Address notes or delivery instructions.`
      - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
  - `company_id` `string` — The company ID the transaction belongs to — example: `12345`
  - `location_id` `string` — The ID of the location — example: `12345`
  - `department_id` `string` — The ID of the department — example: `12345`
  - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
  - `currency_rate` `number` — Currency Exchange Rate at the time entity was recorded/generated. — example: `0.69`
  - `tax_inclusive` `boolean` — Amounts are including tax — example: `true`
  - `bill_date` `string` — Date bill was issued - YYYY-MM-DD. — format: `date` — example: `2020-09-30`
  - `due_date` `string` — The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
  - `paid_date` `string` — The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
  - `po_number` `string` — A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. — example: `90000117`
  - `reference` `string` — Optional reference identifier for the transaction. — example: `INV-2024-001`
  - `line_items` `array of object`
    - `id` `string` — A unique identifier for an object. — example: `12345`
    - `row_id` `string` — Row ID — example: `12345`
    - `code` `string` — User defined item code — example: `120-C`
    - `line_number` `integer` — Line number of the resource — example: `1`
    - `description` `string` — User defined description — example: `Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.`
    - `type` `string` — Line Item type — enum: `expense_item`, `expense_account`, `other` — example: `expense_account`
    - `tax_amount` `number` — Tax amount — example: `27.5`
    - `total_amount` `number` — Total amount of the line item — example: `27500`
    - `quantity` `number` — example: `1`
    - `unit_price` `number` — example: `27500.5`
    - `unit_of_measure` `string` — Description of the unit type the item is sold as, ie: kg, hour. — example: `pc.`
    - `discount_percentage` `number` — Discount percentage applied to the line item when supported downstream. — example: `0.01`
    - `discount_amount` `number` — Discount amount applied to the line item when supported downstream. — example: `19.99`
    - `location_id` `string` — The ID of the location — example: `12345`
    - `department_id` `string` — The ID of the department — example: `12345`
    - `subsidiary_id` `string` — The ID of the subsidiary — example: `12345`
    - `category_id` `string` — ID of the category of the line item — example: `12345`
    - `shipping_id` `string` — ID of the shipping of the line item — example: `12345`
    - `memo` `string` — Memo — example: `Some memo`
    - `prepaid` `boolean` — Whether the line item is prepaid — example: `true`
    - `tax_applicable_on` `string` — Tax applicable on — example: `Domestic_Purchase_of_Goods_and_Services`
    - `tax_recoverability` `string` — Tax recoverability — example: `Fully_Recoverable`
    - `tax_method` `string` — Method of tax calculation — example: `Due_to_Supplier`
    - `retention_amount` `number` — Retention amount — example: `1000`
    - `payment_amount` `number` — Payment amount — example: `1000`
    - `item` `object`
      - `id` `string` — ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item — example: `12344`
      - `code` `string` — User defined item code — example: `120-C`
      - `name` `string` — User defined item name — example: `Model Y`
    - `tax_rate` `object`
      - `id` `string` — The ID of the object. — example: `123456`
      - `code` `string` — Tax rate code — example: `N-T`
      - `name` `string` — Name of the tax rate — example: `GST on Purchases`
      - `rate` `number` — Rate of the tax rate — example: `10`
    - `ledger_account` `object`
      - `id` `string` — The unique identifier for the account. — example: `123456`
      - `name` `string` — The name of the account. — example: `Bank account`
      - `nominal_code` `string` — The nominal code of the account. — example: `N091`
      - `code` `string` — The code assigned to the account. — example: `453`
      - `parent_id` `string` — The parent ID of the account. — example: `123456`
      - `display_id` `string` — The display ID of the account. — example: `123456`
    - `purchase_order` `object`
      - `id` `string` — The unique identifier for the purchase order. — example: `123456`
      - `line_id` `string` — The unique identifier for the purchase order line. — example: `123456`
      - `line_number` `string` — The line number of the purchase order line. — example: `1`
    - `tracking_categories` `array of object` — A list of linked tracking categories.
      - `id` `string` — The unique identifier for the tracking category. — example: `123456`
      - `code` `string` — The code of the tracking category. — example: `100`
      - `name` `string` — The name of the tracking category. — example: `New York`
      - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
      - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
    - `customer` `object` — The customer this entity is linked to.
      - `id` `string` — The ID of the customer this entity is linked to. — example: `12345`
      - `display_id` `string` — The display ID of the customer. — example: `CUST00101`
      - `display_name` `string` — The display name of the customer. — example: `Windsurf Shop`
      - `name` `string` — The name of the customer. Deprecated, use display_name instead. — example: `Windsurf Shop`
      - `company_name` `string` — The company name of the customer. — example: `The boring company`
      - `email` `string` — The email address of the customer. — example: `boring@boring.com`
    - `rebilling` `object` — Rebilling metadata for this line item.
      - `rebillable` `boolean` — Whether this line item is eligible for rebilling. — example: `true`
      - `rebill_status` `string` — Status of the rebilling process for this line item. — enum: `pending`, `billed`, `voided` — example: `billed`
      - `linked_transaction_id` `string` — The ID of the transaction this line item was rebilled to. — example: `txn_abc123`
      - `linked_transaction_line_id` `string` — The ID of the line item in the rebilled transaction. — example: `line_xyz789`
    - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
    - `updated_by` `string` — The user who last updated the object. — example: `12345`
    - `created_by` `string` — The user who created the object. — example: `12345`
    - `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
    - `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
    - `worktags` `array of object` — A list of linked worktags. This is only supported for Workday.
      - `id` `string` — The unique identifier for the worktag. — example: `123456`
      - `value` `string` — The value of the worktag. — example: `New York`
  - `terms` `string` — Terms of payment. — example: `Net 30 days`
  - `terms_id` `string` — The ID of the payment terms — example: `12345`
  - `balance` `number` — Balance of bill due. — example: `27500`
  - `deposit` `number` — Amount of deposit made to this bill. — example: `0`
  - `sub_total` `number` — Subtotal amount, normally before tax. — example: `250`
  - `total_tax` `number` — Total tax amount applied to this transaction. — example: `25`
  - `total` `number` — Total amount of bill, including tax. — example: `27500`
  - `tax_code` `string` — Applicable tax id/code override if tax is not supplied on a line item basis. — example: `1234`
  - `notes` `string` — example: `Some notes about this bill.`
  - `status` `string` — Invoice status — enum: `draft`, `submitted`, `authorised`, `partially_paid`, `paid`, `void`, `credit`, `deleted`, `posted` — example: `OK`
  - `ledger_account` `object`
    - `id` `string` — The unique identifier for the account. — example: `123456`
    - `name` `string` — The name of the account. — example: `Bank account`
    - `nominal_code` `string` — The nominal code of the account. — example: `N091`
    - `code` `string` — The code assigned to the account. — example: `453`
    - `parent_id` `string` — The parent ID of the account. — example: `123456`
    - `display_id` `string` — The display ID of the account. — example: `123456`
  - `payment_method` `string` — Payment method used for the transaction, such as cash, credit card, bank transfer, or check — example: `cash`
  - `channel` `string` — The channel through which the transaction is processed. — example: `email`
  - `language` `string` — language code according to ISO 639-1. For the United States - EN — example: `EN`
  - `accounting_by_row` `boolean` — Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. — example: `false`
  - `bank_account` `object`
    - `bank_name` `string` — The name of the bank or financial institution — example: `Chase Bank`
    - `account_number` `string` — The bank account number — example: `123465`
    - `account_name` `string` — The name of the bank account — example: `Main Operating Account`
    - `account_type` `string` — The type of bank account. — enum: `bank_account`, `credit_card`, `other` — example: `credit_card`
    - `iban` `string` — International Bank Account Number — example: `GB33BUKB20201555555555`
    - `bic` `string` — Bank Identifier Code / SWIFT Code — example: `CHASUS33`
    - `routing_number` `string` — Bank routing number (US) — example: `021000021`
    - `bsb_number` `string` — Bank State Branch number (Australia/New Zealand) — example: `062-001`
    - `branch_identifier` `string` — Bank branch identifier — example: `001`
    - `bank_code` `string` — Bank code assigned by central bank — example: `BNH`
    - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
    - `country` `string` — Country code according to ISO 3166-1 alpha-2. — example: `US`
  - `discount_percentage` `number` — Discount percentage applied to this transaction. — example: `5.5`
  - `template_id` `string` — Optional bill template — example: `123456`
  - `approved_by` `string` — The user who approved the bill — example: `John Doe`
  - `amortization_type` `string` — Type of amortization — enum: `manual`, `receipt`, `schedule`, `other`
  - `tax_method` `string` — Method of tax calculation — example: `Due to supplier`
  - `document_received` `boolean` — Whether the document has been received — example: `true`
  - `source_document_url` `string` — URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. — example: `https://www.invoicesolution.com/bill/123456`
  - `payment_allocations` `array of object` — A list of linked payment allocations.
    - `id` `string` — ID of the payment — example: `123456`
    - `allocated_amount` `number` — Amount of the payment allocated to the bill — example: `1000`
    - `date` `string` — Date of the payment — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `tracking_categories` `array of object` — A list of linked tracking categories.
    - `id` `string` — The unique identifier for the tracking category. — example: `123456`
    - `code` `string` — The code of the tracking category. — example: `100`
    - `name` `string` — The name of the tracking category. — example: `New York`
    - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
    - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
  - `updated_by` `string` — The user who last updated the object. — example: `12345`
  - `created_by` `string` — The user who created the object. — example: `12345`
  - `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
  - `custom_fields` `array of object`
    - `id` `string` — Unique identifier for the custom field. — example: `2389328923893298`
    - `name` `string` — Name of the custom field. — example: `employee_level`
    - `description` `string` — More information about the custom field — example: `Employee Level`
    - `value` `string | number | boolean | object | array of string | number | boolean | object`
      - One of:
        - Option 1: string
        - Option 2: number
        - Option 3: boolean
        - Option 4: object

        - Option 5: array of string | number | boolean | object
  - `custom_mappings` `object` — When custom mappings are configured on the resource, the result is included here.
  - `pass_through` `array of object` — The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
    - `service_id` `string` **required** — Identifier for the service to which this pass_through should be applied.
    - `operation_id` `string` — Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request.
    - `extend_object` `object` — Simple object allowing any properties for direct extension.
    - `extend_paths` `array of object` — Array of objects for structured data modifications via paths.
      - `path` `string` **required** — JSONPath string specifying where to apply the value. — example: `$.nested.property`
      - `value` `any` **required** — The value to set at the specified path, can be any type.
  - `accounting_period` `string` — Accounting period — example: `01-24`
  - `attachments` `array of object`
    - `name` `string` — The name of the file — example: `sample.jpg`
    - `mime_type` `string` — The MIME type of the file. — example: `image/jpeg`
    - `is_compressed` `boolean` — Whether the file is c ompressed. — example: `false`
    - `encoding` `string` — The encoding of the file. — example: `base64`
    - `content` `string` — The content of the file. — example: `data:image/jpeg;base64,...`
    - `notes` `string` — The notes of the file. — example: `A sample image`
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

---

# Delete Bill

> **Accounting API** · `DELETE /accounting/bills/{id}`
> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Bills/operation/billsDelete

Delete Bill

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | `string` | Yes | ID of the record you are acting upon. |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |

### Responses

#### 200 — Bill deleted

- `status_code` `integer` **required** — HTTP Response Status Code — example: `200`
- `status` `string` **required** — HTTP Response Status — example: `OK`
- `service` `string` **required** — Apideck ID of service provider — example: `xero`
- `resource` `string` **required** — Unified API resource name — example: `bills`
- `operation` `string` **required** — Operation performed — example: `delete`
- `data` `object` **required** — A object containing a unique identifier for the resource that was created, updated, or deleted.
  - `id` `string` **required** — The unique identifier of the resource — example: `12345`
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

---

# Update Bill

> **Accounting API** · `PATCH /accounting/bills/{id}`
> Canonical URL: https://developers.apideck.com/apis/accounting/reference#tag/Bills/operation/billsUpdate

Update Bill

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | `string` | Yes | ID of the record you are acting upon. |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |

### Request Body

_Required._

- `id` `string` — A unique identifier for an object. — example: `12345`
- `downstream_id` `string` — The third-party API ID of original entity — example: `12345`
- `display_id` `string` — Id to be displayed. — example: `123456`
- `bill_number` `string` — Reference to supplier bill number — example: `10001`
- `supplier` `object` — The supplier this entity is linked to.
  - `id` `string` — The ID of the supplier this entity is linked to. — example: `12345`
  - `display_id` `string` — The display ID of the supplier. — example: `SUPP00101`
  - `display_name` `string` — The display name of the supplier. — example: `Windsurf Shop`
  - `company_name` `string` — The company name of the supplier. — example: `The boring company`
  - `address` `object`
    - `id` `string` — Unique identifier for the address. — example: `123`
    - `type` `string` — The type of address. — enum: `primary`, `secondary`, `home`, `office`, `shipping`, `billing`, `work`, `other` — example: `primary`
    - `string` `string` — The address string. Some APIs don't provide structured address data. — example: `25 Spring Street, Blackburn, VIC 3130`
    - `name` `string` — The name of the address. — example: `HQ US`
    - `line1` `string` — Line 1 of the address e.g. number, street, suite, apt #, etc. — example: `Main street`
    - `line2` `string` — Line 2 of the address — example: `apt #`
    - `line3` `string` — Line 3 of the address — example: `Suite #`
    - `line4` `string` — Line 4 of the address — example: `delivery instructions`
    - `line5` `string` — Line 5 of the address — example: `Attention: Finance Dept`
    - `street_number` `string` — Street number — example: `25`
    - `city` `string` — Name of city. — example: `San Francisco`
    - `state` `string` — Name of state — example: `CA`
    - `postal_code` `string` — Zip code or equivalent. — example: `94104`
    - `country` `string` — country code according to ISO 3166-1 alpha-2. — example: `US`
    - `latitude` `string` — Latitude of the address — example: `40.759211`
    - `longitude` `string` — Longitude of the address — example: `-73.984638`
    - `county` `string` — Address field that holds a sublocality, such as a county — example: `Santa Clara`
    - `contact_name` `string` — Name of the contact person at the address — example: `Elon Musk`
    - `salutation` `string` — Salutation of the contact person at the address — example: `Mr`
    - `phone_number` `string` — Phone number of the address — example: `111-111-1111`
    - `fax` `string` — Fax number of the address — example: `122-111-1111`
    - `email` `string` — Email address of the address — example: `elon@musk.com`
    - `website` `string` — Website of the address — example: `https://elonmusk.com`
    - `notes` `string` — Additional notes — example: `Address notes or delivery instructions.`
    - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
- `company_id` `string` — The company ID the transaction belongs to — example: `12345`
- `location_id` `string` — The ID of the location — example: `12345`
- `department_id` `string` — The ID of the department — example: `12345`
- `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
- `currency_rate` `number` — Currency Exchange Rate at the time entity was recorded/generated. — example: `0.69`
- `tax_inclusive` `boolean` — Amounts are including tax — example: `true`
- `bill_date` `string` — Date bill was issued - YYYY-MM-DD. — format: `date` — example: `2020-09-30`
- `due_date` `string` — The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
- `paid_date` `string` — The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. — format: `date` — example: `2020-10-30`
- `po_number` `string` — A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. — example: `90000117`
- `reference` `string` — Optional reference identifier for the transaction. — example: `INV-2024-001`
- `line_items` `array of object`
  - `id` `string` — A unique identifier for an object. — example: `12345`
  - `row_id` `string` — Row ID — example: `12345`
  - `code` `string` — User defined item code — example: `120-C`
  - `line_number` `integer` — Line number of the resource — example: `1`
  - `description` `string` — User defined description — example: `Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.`
  - `type` `string` — Line Item type — enum: `expense_item`, `expense_account`, `other` — example: `expense_account`
  - `tax_amount` `number` — Tax amount — example: `27.5`
  - `total_amount` `number` — Total amount of the line item — example: `27500`
  - `quantity` `number` — example: `1`
  - `unit_price` `number` — example: `27500.5`
  - `unit_of_measure` `string` — Description of the unit type the item is sold as, ie: kg, hour. — example: `pc.`
  - `discount_percentage` `number` — Discount percentage applied to the line item when supported downstream. — example: `0.01`
  - `discount_amount` `number` — Discount amount applied to the line item when supported downstream. — example: `19.99`
  - `location_id` `string` — The ID of the location — example: `12345`
  - `department_id` `string` — The ID of the department — example: `12345`
  - `subsidiary_id` `string` — The ID of the subsidiary — example: `12345`
  - `category_id` `string` — ID of the category of the line item — example: `12345`
  - `shipping_id` `string` — ID of the shipping of the line item — example: `12345`
  - `memo` `string` — Memo — example: `Some memo`
  - `prepaid` `boolean` — Whether the line item is prepaid — example: `true`
  - `tax_applicable_on` `string` — Tax applicable on — example: `Domestic_Purchase_of_Goods_and_Services`
  - `tax_recoverability` `string` — Tax recoverability — example: `Fully_Recoverable`
  - `tax_method` `string` — Method of tax calculation — example: `Due_to_Supplier`
  - `retention_amount` `number` — Retention amount — example: `1000`
  - `payment_amount` `number` — Payment amount — example: `1000`
  - `item` `object`
    - `id` `string` — ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item — example: `12344`
    - `code` `string` — User defined item code — example: `120-C`
    - `name` `string` — User defined item name — example: `Model Y`
  - `tax_rate` `object`
    - `id` `string` — The ID of the object. — example: `123456`
    - `code` `string` — Tax rate code — example: `N-T`
    - `name` `string` — Name of the tax rate — example: `GST on Purchases`
    - `rate` `number` — Rate of the tax rate — example: `10`
  - `ledger_account` `object`
    - `id` `string` — The unique identifier for the account. — example: `123456`
    - `name` `string` — The name of the account. — example: `Bank account`
    - `nominal_code` `string` — The nominal code of the account. — example: `N091`
    - `code` `string` — The code assigned to the account. — example: `453`
    - `parent_id` `string` — The parent ID of the account. — example: `123456`
    - `display_id` `string` — The display ID of the account. — example: `123456`
  - `purchase_order` `object`
    - `id` `string` — The unique identifier for the purchase order. — example: `123456`
    - `line_id` `string` — The unique identifier for the purchase order line. — example: `123456`
    - `line_number` `string` — The line number of the purchase order line. — example: `1`
  - `tracking_categories` `array of object` — A list of linked tracking categories.
    - `id` `string` — The unique identifier for the tracking category. — example: `123456`
    - `code` `string` — The code of the tracking category. — example: `100`
    - `name` `string` — The name of the tracking category. — example: `New York`
    - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
    - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
  - `customer` `object` — The customer this entity is linked to.
    - `id` `string` — The ID of the customer this entity is linked to. — example: `12345`
    - `display_id` `string` — The display ID of the customer. — example: `CUST00101`
    - `display_name` `string` — The display name of the customer. — example: `Windsurf Shop`
    - `name` `string` — The name of the customer. Deprecated, use display_name instead. — example: `Windsurf Shop`
    - `company_name` `string` — The company name of the customer. — example: `The boring company`
    - `email` `string` — The email address of the customer. — example: `boring@boring.com`
  - `rebilling` `object` — Rebilling metadata for this line item.
    - `rebillable` `boolean` — Whether this line item is eligible for rebilling. — example: `true`
    - `rebill_status` `string` — Status of the rebilling process for this line item. — enum: `pending`, `billed`, `voided` — example: `billed`
    - `linked_transaction_id` `string` — The ID of the transaction this line item was rebilled to. — example: `txn_abc123`
    - `linked_transaction_line_id` `string` — The ID of the line item in the rebilled transaction. — example: `line_xyz789`
  - `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
  - `updated_by` `string` — The user who last updated the object. — example: `12345`
  - `created_by` `string` — The user who created the object. — example: `12345`
  - `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
  - `worktags` `array of object` — A list of linked worktags. This is only supported for Workday.
    - `id` `string` — The unique identifier for the worktag. — example: `123456`
    - `value` `string` — The value of the worktag. — example: `New York`
- `terms` `string` — Terms of payment. — example: `Net 30 days`
- `terms_id` `string` — The ID of the payment terms — example: `12345`
- `balance` `number` — Balance of bill due. — example: `27500`
- `deposit` `number` — Amount of deposit made to this bill. — example: `0`
- `sub_total` `number` — Subtotal amount, normally before tax. — example: `250`
- `total_tax` `number` — Total tax amount applied to this transaction. — example: `25`
- `total` `number` — Total amount of bill, including tax. — example: `27500`
- `tax_code` `string` — Applicable tax id/code override if tax is not supplied on a line item basis. — example: `1234`
- `notes` `string` — example: `Some notes about this bill.`
- `status` `string` — Invoice status — enum: `draft`, `submitted`, `authorised`, `partially_paid`, `paid`, `void`, `credit`, `deleted`, `posted` — example: `draft`
- `ledger_account` `object`
  - `id` `string` — The unique identifier for the account. — example: `123456`
  - `name` `string` — The name of the account. — example: `Bank account`
  - `nominal_code` `string` — The nominal code of the account. — example: `N091`
  - `code` `string` — The code assigned to the account. — example: `453`
  - `parent_id` `string` — The parent ID of the account. — example: `123456`
  - `display_id` `string` — The display ID of the account. — example: `123456`
- `payment_method` `string` — Payment method used for the transaction, such as cash, credit card, bank transfer, or check — example: `cash`
- `channel` `string` — The channel through which the transaction is processed. — example: `email`
- `language` `string` — language code according to ISO 639-1. For the United States - EN — example: `EN`
- `accounting_by_row` `boolean` — Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. — example: `false`
- `bank_account` `object`
  - `bank_name` `string` — The name of the bank or financial institution — example: `Chase Bank`
  - `account_number` `string` — The bank account number — example: `123465`
  - `account_name` `string` — The name of the bank account — example: `Main Operating Account`
  - `account_type` `string` — The type of bank account. — enum: `bank_account`, `credit_card`, `other` — example: `credit_card`
  - `iban` `string` — International Bank Account Number — example: `GB33BUKB20201555555555`
  - `bic` `string` — Bank Identifier Code / SWIFT Code — example: `CHASUS33`
  - `routing_number` `string` — Bank routing number (US) — example: `021000021`
  - `bsb_number` `string` — Bank State Branch number (Australia/New Zealand) — example: `062-001`
  - `branch_identifier` `string` — Bank branch identifier — example: `001`
  - `bank_code` `string` — Bank code assigned by central bank — example: `BNH`
  - `currency` `string` — Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). — enum: `UNKNOWN_CURRENCY`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYR`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LTL`, `LVL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRC`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `USS`, `UYI`, `UYU`, `UZS`, `VEF`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XTS`, `XXX`, `YER`, `ZAR`, `ZMK`, `ZMW`, `BTC`, `ETH` — example: `USD`
  - `country` `string` — Country code according to ISO 3166-1 alpha-2. — example: `US`
- `discount_percentage` `number` — Discount percentage applied to this transaction. — example: `5.5`
- `template_id` `string` — Optional bill template — example: `123456`
- `approved_by` `string` — The user who approved the bill — example: `John Doe`
- `amortization_type` `string` — Type of amortization — enum: `manual`, `receipt`, `schedule`, `other`
- `tax_method` `string` — Method of tax calculation — example: `Due to supplier`
- `document_received` `boolean` — Whether the document has been received — example: `true`
- `source_document_url` `string` — URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. — example: `https://www.invoicesolution.com/bill/123456`
- `payment_allocations` `array of object` — A list of linked payment allocations.
  - `id` `string` — ID of the payment — example: `123456`
  - `allocated_amount` `number` — Amount of the payment allocated to the bill — example: `1000`
  - `date` `string` — Date of the payment — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
- `tracking_categories` `array of object` — A list of linked tracking categories.
  - `id` `string` — The unique identifier for the tracking category. — example: `123456`
  - `code` `string` — The code of the tracking category. — example: `100`
  - `name` `string` — The name of the tracking category. — example: `New York`
  - `parent_id` `string` — The unique identifier for the parent tracking category. — example: `123456`
  - `parent_name` `string` — The name of the parent tracking category. — example: `New York`
- `updated_by` `string` — The user who last updated the object. — example: `12345`
- `created_by` `string` — The user who created the object. — example: `12345`
- `updated_at` `string` — The date and time when the object was last updated. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
- `created_at` `string` — The date and time when the object was created. — format: `date-time` — example: `2020-09-30T07:43:32.000Z`
- `row_version` `string` — A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. — example: `1-12345`
- `custom_fields` `array of object`
  - `id` `string` — Unique identifier for the custom field. — example: `2389328923893298`
  - `name` `string` — Name of the custom field. — example: `employee_level`
  - `description` `string` — More information about the custom field — example: `Employee Level`
  - `value` `string | number | boolean | object | array of string | number | boolean | object`
    - One of:
      - Option 1: string
      - Option 2: number
      - Option 3: boolean
      - Option 4: object

      - Option 5: array of string | number | boolean | object
- `custom_mappings` `object` — When custom mappings are configured on the resource, the result is included here.
- `pass_through` `array of object` — The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
  - `service_id` `string` **required** — Identifier for the service to which this pass_through should be applied.
  - `operation_id` `string` — Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request.
  - `extend_object` `object` — Simple object allowing any properties for direct extension.
  - `extend_paths` `array of object` — Array of objects for structured data modifications via paths.
    - `path` `string` **required** — JSONPath string specifying where to apply the value. — example: `$.nested.property`
    - `value` `any` **required** — The value to set at the specified path, can be any type.
- `accounting_period` `string` — Accounting period — example: `01-24`
- `attachments` `array of object`
  - `name` `string` — The name of the file — example: `sample.jpg`
  - `mime_type` `string` — The MIME type of the file. — example: `image/jpeg`
  - `is_compressed` `boolean` — Whether the file is c ompressed. — example: `false`
  - `encoding` `string` — The encoding of the file. — example: `base64`
  - `content` `string` — The content of the file. — example: `data:image/jpeg;base64,...`
  - `notes` `string` — The notes of the file. — example: `A sample image`

### Responses

#### 200 — Bill Updated

- `status_code` `integer` **required** — HTTP Response Status Code — example: `200`
- `status` `string` **required** — HTTP Response Status — example: `OK`
- `service` `string` **required** — Apideck ID of service provider — example: `xero`
- `resource` `string` **required** — Unified API resource name — example: `bills`
- `operation` `string` **required** — Operation performed — example: `update`
- `data` `object` **required** — A object containing a unique identifier for the resource that was created, updated, or deleted.
  - `id` `string` **required** — The unique identifier of the resource — example: `12345`
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

---
