---
title: "Create sale/purchase entry (Multiple plans)"
method: POST
path: "/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans"
tags: ["Accounting", "Invoices"]
---

# Create sale/purchase entry (Multiple plans)

`POST /consumers/{consumer_id}/accounting/invoices/multi-analytic-plans`

Create a new sale/purchase entry with multiple analytic plans in the accounting

## Path parameters

- `consumer_id` string, uuid, required

## Query parameters

- `folder_id` string, nullable
- `force_financial_period` string, nullable
- `regroup_lines` 'true' | 'false'
- `ignore_accounting_id` boolean
- `force_currency_exchange` boolean, nullable

## Request body

- InvoiceItemInMultiAnalyticPlans
  - `invoice_type` 'customer_invoice' | 'customer_refund' | 'supplier_invoice' | 'supplier_refund', required
  - `invoice_number` string, nullable — Unique 'number' of the invoice instance in the accounting software. This is an internal reference number. if not specified, will be automatically generated according to the system’s numbering rules. It does not necessarily match the number displayed on an invoice.It is recommended to use this number for idempotency to prevent duplicate entries. Refer to the idempotency documentation in the Developer Guides for more details
  - `currency` string, required — Code (e.g., USD, EUR) of the currency used for invoice amounts.
  - `untaxed_amount` number, required — Total amount of the invoice excluding taxes.
  - `tax_amount` number, required — Total amount of tax applied to the invoice
  - `total` number, required — Total amount of the invoice, including taxes (untaxed_amount + tax_amount).
  - `reference` string, nullable — Optional reference field used to store an external or contextual identifier related to the entry. For purchase invoices, it typically contains the invoice number issued by the supplier. For sales invoices, it may reference a quote number or any other relevant document. Unlike number, this field is not subject to specific format or character restrictions and can hold free-form text.
  - `payment_communication` string, nullable — Field containing the payment reference or communication associated with the invoice (e.g., bank transfer reference, SEPA remittance message). Often used for reconciliation purposes.
  - `customer_memo` string, nullable — Internal or external note associated with the invoice, typically intended for the customer. Can include additional context, comments, or special instructions related to the transaction.
  - `payment_term_id` string, nullable — Technical ID of the payment term associated with the invoice.
  - `withholding_tax` WithholdingTax
    - `tax_rate` number, required — Rate of the withholding tax. Normal withholding tax should have a negative tax rate.
    - `tax_code` string, required — Tax code of the withholding tax. This is the Id of the Tax Code in the accounting software.
    - `tax_amount` number, required — Amount of the withholding tax. This is the amount of the withholding tax that will be applied to the invoice. It should be negative for normal withholding tax.
  - `invoice_date` string, date, required — Accounting date of the invoice (format: YYYY-MM-DD).
  - `due_date` string, date, required — Due date for payment or settlement (format: YYYY-MM-DD).
  - `partner_id` string, nullable — Id of the related third party (supplier or customer) in the accounting software. Used to link the invoice to the corresponding client or supplier record in the accounting system.
  - `journal_id` string, nullable — Identifier of the journal for the invoice. If not provided, the journal will be set automatically if only one exists; otherwise, an error will be thrown.
  - `status` 'draft' | 'posted'
  - `pdf` string, nullable — Base 64 string representing the PDF attached to the invoice.
  - `pdf_name` string, nullable — A name for the PDF file to be created for accounting software that support it.
  - `currency_exchange_rate` number, nullable — Exchange rate applicable at the date of the invoice. Required when the invoice currency is different from the folder's default currency.
  - `invoice_correction` InvoiceCorrection
    - `sale_invoice_correction_tax_code` string, nullable — Tax code to apply on the correction line when the invoice is a sale (customer invoice). Required only when invoice_correction is used for a sale invoice or refund.
    - `purchase_invoice_correction_tax_code` string, nullable — Tax code to apply on the correction line when the invoice is a purchase (supplier invoice). Required only when invoice_correction is used for a purchase invoice or refund.
    - `invoice_correction_credit_account_number` string, nullable — Account number to use for the correction line on a sale (customer invoice).
    - `invoice_correction_debit_account_number` string, nullable — Account number to use for the correction line on a purchase (supplier invoice).
  - `nl_payment_terms_split` NlPaymentTermsSplit
    - `g_account` PaymentTermAccountInfo, required
      - `amount` number, required — Amount to be paid to the G or N account
      - `iban` string, required — IBAN of the G or R account
    - `n_account` PaymentTermAccountInfo, required
      - `amount` number, required — Amount to be paid to the G or N account
      - `iban` string, required — IBAN of the G or R account
  - `shipping_country` string, nullable — Format: ISO 3166-1 codes.
  - `partner_info` AccountToCreate
    - `account_number` string, required
    - `account_name` string, required
  - `lines` InvoiceLineItemInMultiAnalyticPlans[], required
    - `line_number` integer, nullable — Optional line sequence number used to preserve the order of invoice items.
    - `unit_price` number, required — Unit price of the item, before tax.
    - `unit_of_measure` string, nullable — A list of default units can be used for which an advanced mapping has been done (units: 'hour', 'day', 'cm', 'm2', 'm3', 'm', 'km', 'mile', 'g', 'kg', 'ton', 'box', 'pallet', 'roll', 'liter', 'unit'). Custom units of measure must have an identical name in the target software.
    - `quantity` number, required — Quantity of items. This is the amount of units sold or purchased.
    - `untaxed_amount` number, required — Amount excluding tax for the line item (i.e., unit_price × quantity).
    - `tax_rate` number, required — Tax rate used for the line (e.g., 21.0).
    - `tax_amount` number, required — Tax amount calculated for the line (i.e. untaxed_amount * tax_rate).
    - `total` number, required — Total amount for the item, including tax (untaxed_amount + tax_amount).
    - `account_number` string, required — Ledger account number (of type general) used for the line (e.g., 701000).
    - `tax_code` string, required — Indicates the tax code used for the line. This is the Id of the Tax Code in the accounting software.
    - `description` string — Text description for this line item.
    - `analytic_distribution` AnalyticDistribution[], nullable
      - `analytic_plan` string, required — Id of the analytic plan to which the distribution applies.
      - `analytic_accounts` AnalyticDistributionDetail[], required — List of analytic accounts and their respective percentages for the distribution.
        - `analytic_account` string, required
        - `percentage` number, required — Percentage of the untaxed amount attributed to this analytic account. Only whole numbers (no decimals) are allowed. The total across the analytic distribution (all accounts in a given analytic plan) must equal 100%.
  - `start_date` string, date, nullable — Start date of the period covered by the invoice (format: YYYY-MM-DD). This field should be used when the invoice relates to prepaid income or expenses (accruals and deferrals), indicating when the covered period begins.
  - `end_date` string, date, nullable — End date of the period covered by the invoice (format: YYYY-MM-DD). This field should be used when the invoice relates to prepaid income or expenses (accruals and deferrals), indicating when the covered period ends.
  - `payment_method_id` string, nullable — Technical ID of the payment method in the accounting system. This is an indication of the payment method that will be used to pay the invoice. It is not necessarily the payment method that will eventually be used to pay the invoice.

## Response `200`

Successful Response

- InvoiceItemOutMultiAnalyticPlans
  - `invoice_type` 'customer_invoice' | 'customer_refund' | 'supplier_invoice' | 'supplier_refund', required
  - `invoice_number` string, nullable — Unique 'number' of the invoice instance in the accounting software. This is an internal reference number. if not specified, will be automatically generated according to the system’s numbering rules. It does not necessarily match the number displayed on an invoice.It is recommended to use this number for idempotency to prevent duplicate entries. Refer to the idempotency documentation in the Developer Guides for more details
  - `currency` string, required — Code (e.g., USD, EUR) of the currency used for invoice amounts.
  - `untaxed_amount` number, required — Total amount of the invoice excluding taxes.
  - `tax_amount` number, required — Total amount of tax applied to the invoice
  - `total` number, required — Total amount of the invoice, including taxes (untaxed_amount + tax_amount).
  - `reference` string, nullable — Optional reference field used to store an external or contextual identifier related to the entry. For purchase invoices, it typically contains the invoice number issued by the supplier. For sales invoices, it may reference a quote number or any other relevant document. Unlike number, this field is not subject to specific format or character restrictions and can hold free-form text.
  - `payment_communication` string, nullable — Field containing the payment reference or communication associated with the invoice (e.g., bank transfer reference, SEPA remittance message). Often used for reconciliation purposes.
  - `customer_memo` string, nullable — Internal or external note associated with the invoice, typically intended for the customer. Can include additional context, comments, or special instructions related to the transaction.
  - `payment_term_id` string, nullable — Technical ID of the payment term associated with the invoice.
  - `withholding_tax` WithholdingTax
    - `tax_rate` number, required — Rate of the withholding tax. Normal withholding tax should have a negative tax rate.
    - `tax_code` string, required — Tax code of the withholding tax. This is the Id of the Tax Code in the accounting software.
    - `tax_amount` number, required — Amount of the withholding tax. This is the amount of the withholding tax that will be applied to the invoice. It should be negative for normal withholding tax.
  - `id` string, nullable
  - `invoice_date` string, date, required — Accounting invoice date. It is automatically set to '1970-01-01' if the value is empty in the accounting system.
  - `due_date` string, date, required — Last Due date of the invoice. The invoice date is used when this information is not given by the software.
  - `partner_id` string, nullable, required
  - `journal_id` string, nullable — Indicates the journal used in for the invoice. If the journal is not given, the journal will be automatically set if only one journal exists otherwise an error will be thrown.
  - `payments` Payment[], nullable
    - `id` string, required
    - `name` string, required
    - `currency` string, required
    - `amount` number, required — Total amount of the payment. A part of this amount could be reconciled with another invoice.
    - `dedicated_amount` number — Amount of the payment dedicated to the invoice.
    - `payment_date` string, date, required
    - `journal_type` 'customer_invoice' | 'customer_refund' | 'supplier_invoice' | 'supplier_refund' | 'financial_operation' | 'miscellaneous_operation' | 'unknown', required
    - `journal_id` string, required
    - `journal_name` string, required
    - `reconciled` boolean, nullable
    - `communication` string, nullable
    - `matching_number` string, nullable
  - `status` 'cancelled' | 'draft' | 'posted' | 'paid'
  - `last_updated_on` string, date-time, nullable — The last time the invoice has been updated.
  - `partner` Partner
    - `external_reference` string, nullable — External identifier used to link the client in the accounting system with the corresponding client reference in your own system.
    - `first_name` string, nullable — Only used when the client is an individual (is_company=false). Indicates the first name of the client.
    - `last_name` string, nullable — Only used when the client is an individual (is_company=false). Indicates the last name of the client.
    - `name` string, nullable — Full name or legal name of the client (individual or company). This is the name displayed in the accounting software.
    - `function` string, nullable — Only used when the client is an individual (is_company=false). Indicates the function of the client.
    - `is_company` boolean, nullable — Indicates if the client is an individual or a company.
    - `company_id` string, nullable — Only used when the client is an individual (is_company=false). Indicates the id of the company linked to the client.
    - `phone` string, nullable — Phone number of the client.
    - `mobile` string, nullable — Mobile phone number of the client.
    - `email` string, nullable — Email address of the client.
    - `language` string, nullable — Language of the client. Format: ISO 639-1 codes.
    - `internal_notes` string, nullable — Internal notes about the client.
    - `website` string, nullable — Website of the client.
    - `vat` string, nullable — VAT number of the client.
    - `company_number` string, nullable — National identification number of the company.
    - `iban` string, nullable — IBAN account number of the client. DEPRECATED see bank_accounts
    - `bank_account` string, nullable — Bank account number of the client. DEPRECATED see bank_accounts
    - `currency` string, nullable — Indicates the currency of the client (e.g., EUR).
    - `active` boolean, nullable — Indicates if the client is active.
    - `account_number` string, nullable — Ledger account number assigned to the customer in the accounting system as it will appear in the official accounting export file (FEC, SIE, iXBRL, etc.).
    - `id` string, nullable — Id of the client in the accounting software. This is the unique identifier used to reference the client in the system.
    - `last_updated_on` string, date-time, nullable — The last time the client has been updated.
    - `addresses` AddressItemOut[], nullable — List of addresses associated with the client.
      - `address_type` 'main' | 'delivery' | 'invoice', required
      - `name` string, nullable
      - `number` string, nullable
      - `box` string, nullable
      - `phone` string, nullable
      - `mobile` string, nullable
      - `email` string, nullable
      - `street` string, nullable
      - `city` string, nullable
      - `postal_code` string, nullable
      - `country` string, nullable — Format: ISO 3166-1 codes.
    - `third_party_account` string, nullable — Third party account number/code representing the client in the accounting software.
    - `bank_accounts` BankAccountsItem[], nullable — List of bank accounts information associated with the client.
      - `is_primary` boolean, nullable — Indicates whether this is the default bank account for this third-party. Only one bank account per third-party can have is_primary set to true. Defaults to true.
      - `currency` string, nullable — Indicates the currency of the bank account (e.g., EUR).
      - `iban` string, nullable — International Bank Account Number (ISO 13616). Present for countries in the IBAN scheme (e.g., France, Germany, United Kingdom). null for countries that do not participate in the IBAN scheme (e.g., US, Canada, Australia).
      - `bic_swift` string, nullable — Bank Identifier Code (ISO 9362), also known as SWIFT code. 8 or 11 characters. Optional for domestic payments, but required for international wire transfers.
      - `account_number` string, nullable — Local bank account number. Used when the country does not participate in the IBAN scheme (e.g., US, CA, AU). Always paired with a routing_code.
      - `routing_code` RoutingCodeItem
        - `type` 'unknown' | 'ach' | 'sort_code' | 'bsb' | 'transit' | 'ifsc' | 'clabe'
        - `value` string, nullable — The raw routing code value, without spaces or dashes.
  - `due_dates` InvoiceItemDueDatesOut[], nullable — List of all due dates of the invoice.
    - `due_date` string, date, required — Due date of the item.
    - `payment_method` string, nullable — Payment method used to pay the invoice on that due date.
    - `payment_method_id` string, nullable — Technical ID of the payment method used to pay the invoice on that due date.
    - `amount` number, required — Amount due for the invoice on that due date. A positive amount represents debit on customer invoices and supplier refunds or credit on supplier invoices and customer refunds. A negative amount represents credit on customer invoices and supplier refunds or debit on supplier invoices and customer refunds.
  - `attachments_info` ItemAttachmentInfoOut
    - `status` 'unknown' | 'yes' | 'yes_to_request' | 'no', required
    - `attachments` ItemAttachmentInfoAttachment[], nullable — List of attachments available directly for this entry. Populated only when status is 'yes'. When status is 'yes_to_request', this list is empty — use GET /accounting/attachments to fetch the file content.
      - `filename` string, nullable — The name of the attachment.
      - `url` string, nullable — Direct download URL for the attachment file. Only populated when the parent attachments_info.status is 'yes'. When status is 'yes_to_request', this field is null and the file must be retrieved via GET /accounting/attachments with the appropriate type and document_id, which returns the content as a base64-encoded string.
  - `accounting_info` AccountingInfoOut
    - `main_currency` string — Main currency of the accounting folder. ISO-4217 format.
    - `main_currency_total` number — Total amount of the invoice in the accounting folder's currency.
    - `account_number` string, nullable — Client/supplier ledger account used to book the invoice total amount. (optional)
  - `payment_method_id` string, nullable — Technical ID of the payment method in the accounting system. This is the payment method currently linked to the invoice. It is not necessarily the payment method that will eventually be used to pay the invoice.
  - `approval_status` 'unknown' | 'pending' | 'approved' | 'rejected'
  - `lines` InvoiceLineItemOutMultiAnalyticPlans[], required
    - `line_number` integer, nullable — Optional line sequence number used to preserve the order of invoice items.
    - `unit_price` number, required — Unit price of the item, before tax.
    - `unit_of_measure` string, nullable — A list of default units can be used for which an advanced mapping has been done (units: 'hour', 'day', 'cm', 'm2', 'm3', 'm', 'km', 'mile', 'g', 'kg', 'ton', 'box', 'pallet', 'roll', 'liter', 'unit'). Custom units of measure must have an identical name in the target software.
    - `quantity` number, required — Quantity of items. This is the amount of units sold or purchased.
    - `untaxed_amount` number, required — Amount excluding tax for the line item (i.e., unit_price × quantity).
    - `tax_rate` number, required — Tax rate used for the line (e.g., 21.0).
    - `tax_amount` number, required — Tax amount calculated for the line (i.e. untaxed_amount * tax_rate).
    - `total` number, required — Total amount for the item, including tax (untaxed_amount + tax_amount).
    - `account_number` string, nullable — Ledger account number (of type general) used for the line (e.g., 701000).
    - `tax_code` string, nullable — Indicates the tax code used for the line. This is the Id of the Tax Code in the accounting software.
    - `description` string, nullable — Text description for this line.
    - `analytic_distribution` AnalyticDistribution[], nullable — List of analytic distributions for the line item. Each distribution specifies an analytic plan and the associated analytic accounts with their percentages.
      - `analytic_plan` string, required — Id of the analytic plan to which the distribution applies.
      - `analytic_accounts` AnalyticDistributionDetail[], required — List of analytic accounts and their respective percentages for the distribution.
        - `analytic_account` string, required
        - `percentage` number, required — Percentage of the untaxed amount attributed to this analytic account. Only whole numbers (no decimals) are allowed. The total across the analytic distribution (all accounts in a given analytic plan) must equal 100%.

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `422` — Validation Error

---

[API](https://skmtc.net/chift/apis/chift-api.md) · [All operations](https://skmtc.net/chift/apis/chift-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/chift/chift-api/versions/b5f1214a482a/schema)
