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

# Retrieve one invoice

> Returns a invoice



## OpenAPI

````yaml get /consumers/{consumer_id}/invoicing/invoices/{invoice_id}
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/invoicing/invoices/{invoice_id}:
    get:
      tags:
        - Invoicing
        - Invoices
      summary: Retrieve one invoice
      description: Returns a invoice
      operationId: invoicing_get_invoice
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
        - name: invoice_id
          in: path
          required: true
          schema:
            type: string
            title: Invoice Id
        - name: include_pdf
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BoolParam'
              - type: 'null'
            default: 'false'
            title: Include Pdf
          description: Include the invoice PDF as a base64 encoded string in the response
        - name: include_analytic_accounts
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BoolParam'
              - type: 'null'
            default: 'false'
            title: Include Analytic Accounts
          description: Include analytic accounts in the response
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceItemOutSingle'
        '400':
          content:
            application/json:
              example:
                message: The ID of the invoice doesn't have the correct format.
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              example:
                message: The invoice doesn't exist in the invoicing system.
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - mcp_auth:
            - invoicing
            - invoicing.read
            - invoicing.invoices
            - invoicing.invoices.read
components:
  schemas:
    BoolParam:
      type: string
      enum:
        - 'true'
        - 'false'
      title: BoolParam
    InvoiceItemOutSingle:
      properties:
        id:
          type: string
          title: Id
          description: Technical id in Chift
        source_ref:
          $ref: '#/components/schemas/Ref'
          description: Technical id in the target software
        currency:
          type: string
          title: Currency
          description: Currency matching target sofware name
        invoice_type:
          $ref: '#/components/schemas/InvoicingInvoiceType'
          description: Invoice type
        status:
          $ref: '#/components/schemas/InvoiceStatus'
          description: Status
        invoice_date:
          type: string
          format: date
          title: Invoice Date
          description: Invoicing date
        tax_amount:
          type: number
          title: Tax Amount
          description: Taxes amount
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Untaxed amount
        total:
          type: number
          title: Total
          description: Total amount incl. taxes
        lines:
          items:
            $ref: '#/components/schemas/InvoiceLineItemOut'
          type: array
          title: Lines
          description: Invoice lines
          default: []
        partner_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Partner Id
          description: Technical id of the vendor/customer in Chift
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: Number/sequence
        due_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Due Date
          description: Due date
        reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference
          description: Reference
        payment_communication:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Communication
          description: Payment communication
        customer_memo:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Memo
          description: Customer note/memo
        journal_ref:
          anyOf:
            - $ref: '#/components/schemas/FieldRef'
            - type: 'null'
          description: Journal
        italian_specificities:
          anyOf:
            - $ref: '#/components/schemas/ItalianSpecificities-Output'
            - type: 'null'
          description: Specificities for Italy
        last_updated_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Updated On
        outstanding_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Outstanding Amount
          description: Amount left to be paid
        last_payment_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Last Payment Date
          description: Date of the last payment linked to the invoice
        accounting_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Accounting Date
          description: Accounting date
        payment_method_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Method Id
          description: Technical id of the payment method in Chift
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: Indicates the exchange rate at the date of the invoice.
          default: 1
        pdf:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdf
          description: PDF document in base64
      type: object
      required:
        - id
        - source_ref
        - currency
        - invoice_type
        - status
        - invoice_date
        - tax_amount
        - untaxed_amount
        - total
      title: InvoiceItemOutSingle
      description: Invoice item returned in get 1 invoice
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
      type: object
      required:
        - message
      title: ChiftError
    HTTPValidationError:
      title: Validation Error
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          default: Validation error
        status:
          title: Status
          type: string
          default: error
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    Ref:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Technical id in the target software
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Name of the model/entity in the target software
      type: object
      title: Ref
    InvoicingInvoiceType:
      type: string
      enum:
        - customer_invoice
        - customer_refund
        - supplier_invoice
        - supplier_refund
        - all
      title: InvoicingInvoiceType
    InvoiceStatus:
      type: string
      enum:
        - cancelled
        - draft
        - posted
        - paid
      title: InvoiceStatus
    InvoiceLineItemOut:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Line description
        unit_price:
          type: number
          title: Unit Price
          description: Unit price excl. taxes
        quantity:
          type: number
          title: Quantity
          description: Quantity
        discount_amount:
          type: number
          title: Discount Amount
          description: >-
            Line discount amount excl. taxes, (unit_price * quantity) -
            discount_amount = untaxed_amount
          default: 0
        tax_amount:
          type: number
          title: Tax Amount
          description: Line total taxes amount
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Line total untaxed amount
        total:
          type: number
          title: Total
          description: Line total amount incl. taxes, total = tax_amount + untaxed_amount
        tax_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Tax Rate
          description: Tax rate (e.g. 21.0)
        account_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Number
          description: Number of the accounting account used (e.g. 701000)
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
          description: Technical id of the tax in Chift
        tax_exemption_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Exemption Reason
          description: Tax exemption reason
        unit_of_measure:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit Of Measure
          description: Unit of measure matching target sofware name
        product_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Id
          description: Technical id of the product in Chift
        product_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Code
          description: Product reference
        product_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Name
          description: Product name
        analytic_distribution:
          anyOf:
            - items:
                $ref: '#/components/schemas/AnalyticDistributionInvoicing'
              type: array
            - type: 'null'
          title: Analytic Distribution
          description: >-
            List of analytic distributions for the line item. Each distribution
            specifies an analytic plan and the associated analytic accounts with
            their percentages.
          default: []
      type: object
      required:
        - unit_price
        - quantity
        - tax_amount
        - untaxed_amount
        - total
      title: InvoiceLineItemOut
    FieldRef:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Technical id in the target software
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Name of the model/entity in the target software
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Value the field in the target software
      type: object
      title: FieldRef
    ItalianSpecificities-Output:
      properties:
        stamp_duty_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Stamp Duty Amount
          description: Documentary stamp tax (specific to Italy)
        withholding_tax:
          anyOf:
            - $ref: '#/components/schemas/InvoicingWithholdingTax'
            - type: 'null'
          description: Withholding tax (specific to Italy)
        welfare_fund:
          anyOf:
            - $ref: '#/components/schemas/WelfareFund'
            - type: 'null'
          description: Welfare fund (specific to Italy)
        payment_reporting:
          anyOf:
            - $ref: '#/components/schemas/PaymentReporting'
            - type: 'null'
          description: Payment reporting (specific to Italy)
      type: object
      title: ItalianSpecificities
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnalyticDistributionInvoicing:
      properties:
        analytic_plan_code:
          type: string
          title: Analytic Plan Code
          description: Code of the analytic plan to which the distribution applies.
        analytic_accounts:
          items:
            $ref: '#/components/schemas/AnalyticDistributionDetailInvoicing'
          type: array
          title: Analytic Accounts
          description: >-
            List of analytic accounts and their respective percentages for the
            distribution.
      type: object
      required:
        - analytic_plan_code
        - analytic_accounts
      title: AnalyticDistributionInvoicing
    InvoicingWithholdingTax:
      properties:
        rate:
          type: number
          title: Rate
          description: Rate
        amount:
          type: number
          title: Amount
          description: Amount
        reason:
          anyOf:
            - $ref: '#/components/schemas/WithholdingTaxReason'
            - type: 'null'
          description: Reason
        payment_reason:
          anyOf:
            - $ref: '#/components/schemas/WithholdingTaxPaymentReason'
            - type: 'null'
          description: Payment reason
      type: object
      required:
        - rate
        - amount
      title: InvoicingWithholdingTax
    WelfareFund:
      properties:
        rate:
          type: number
          title: Rate
          description: Rate
        amount:
          type: number
          title: Amount
          description: Amount
        type:
          anyOf:
            - $ref: '#/components/schemas/WelfareFundType'
            - type: 'null'
          description: Type
      type: object
      required:
        - rate
        - amount
      title: WelfareFund
    PaymentReporting:
      properties:
        method:
          anyOf:
            - $ref: '#/components/schemas/PaymentReportingMethod'
            - type: 'null'
          description: Payment method
        conditions:
          anyOf:
            - $ref: '#/components/schemas/PaymentReportingConditions'
            - type: 'null'
          description: Payment conditions
      type: object
      title: PaymentReporting
    AnalyticDistributionDetailInvoicing:
      properties:
        analytic_account_code:
          type: string
          title: Analytic Account Code
          description: Code of the analytic account.
        analytic_account_name:
          type: string
          title: Analytic Account Name
          description: Name of the analytic account.
        percentage:
          type: number
          title: Percentage
          description: >-
            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%.
      type: object
      required:
        - analytic_account_code
        - analytic_account_name
        - percentage
      title: AnalyticDistributionDetailInvoicing
    WithholdingTaxReason:
      type: string
      enum:
        - RT01
        - RT02
        - RT03
        - RT04
        - RT05
        - RT06
      title: WithholdingTaxReason
    WithholdingTaxPaymentReason:
      type: string
      enum:
        - A
        - U
        - R
        - Q
        - H
        - V
        - V2
        - I
        - J
        - K
        - P
        - S
        - T
        - W
        - X
        - 'Y'
        - B
        - C
        - D
        - E
        - F
        - G
        - L
        - L1
        - M
        - M1
        - M2
        - IN
        - O
        - O1
        - V1
      title: WithholdingTaxPaymentReason
    WelfareFundType:
      type: string
      enum:
        - TC01
        - TC02
        - TC03
        - TC04
        - TC05
        - TC06
        - TC07
        - TC08
        - TC09
        - TC10
        - TC11
        - TC12
        - TC13
        - TC14
        - TC15
        - TC16
        - TC17
        - TC18
        - TC19
        - TC20
        - TC21
        - TC22
      title: WelfareFundType
    PaymentReportingMethod:
      type: string
      enum:
        - MP01
        - MP02
        - MP03
        - MP04
        - MP05
        - MP06
        - MP07
        - MP08
        - MP09
        - MP10
        - MP11
        - MP12
        - MP13
        - MP14
        - MP15
        - MP16
        - MP17
        - MP18
        - MP19
        - MP20
        - MP21
        - MP22
        - MP23
      title: PaymentReportingMethod
    PaymentReportingConditions:
      type: string
      enum:
        - TP01
        - TP02
        - TP03
      title: PaymentReportingConditions
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````