Autonomous AP API

Public REST API for integrating with AppZen Autonomous AP — submit invoices, purchase orders, goods receipts and master data, and retrieve AI audit results and risk scores. Swagger 2.0, 54 operations across 19 resource groups.

OpenAPI Specification

appzen-autonomous-ap-openapi-original.yml Raw ↑
swagger: "2.0"
info:
  title: Autonomous AP APIs
  description: Public APIs for integrating with Autonomous AP
  version: 2.0.3
host: <env>.appzen.com
schemes:
  - https
basePath: /dictionary-data-services

securityDefinitions:
  API Key Header:
    type: apiKey
    in: header
    name: x-api-key
  Customer Id Header:
    type: apiKey
    in: header
    name: customer-id
  Customer Key Header:
    type: apiKey
    in: header
    name: customer-key

security:
  - API Key Header: [ ]
    Customer Id Header: [ ]
    Customer Key Header: [ ]

################################################################################################################
#                                            PARAMETERS
################################################################################################################
parameters:

  uuid:
    in: path
    description: Globally unique identifier for an uploaded document
    required: true
    name: uuid
    type: string

  payment-terms-json-schema:
    in: body
    required: true
    name: payment-terms-json-schema
    schema:
      $ref: '#/definitions/payment-term'

  suppliers-json-schema:
    in: body
    required: true
    name: suppliers-json-schema
    schema:
      $ref: '#/definitions/suppliers-json-schema'

  external-group-id:
    in: path
    description: The group identifier in the source ERP system (e.g. "AP-GROUP-1001"). This is the stable identity of an externally managed group.
    required: true
    name: external-group-id
    type: string

  user-group-json-schema:
    in: body
    required: true
    name: user-group-json-schema
    schema:
      $ref: '#/definitions/user-group-json-schema'

  invoice-account-segment:
    in: body
    required: false
    name: invoice-account-segment
    schema:
      $ref: '#/definitions/invoice-account-segment'

  invoice-line:
    in: body
    required: false
    name: invoice-line
    schema:
      $ref: '#/definitions/invoice-line'

  invoice-audit-results-json-schema:
    in: body
    required: true
    name: invoice-audit-results-json-schema
    schema:
      $ref: '#/definitions/invoice-audit-results-json-schema'

  invoice-audit-results-search-json-schema:
    in: body
    required: true
    name: invoice-audit-results-search-json-schema
    schema:
      $ref: '#/definitions/invoice-audit-results-search-json-schema'

  purchase-order-json-schema:
    in: body
    required: true
    name: purchase-order-json-schema
    schema:
      $ref: '#/definitions/purchase-order-json-schema'

  goods-receipt-json-schema:
    in: body
    required: true
    name: goods-receipt-json-schema
    schema:
      $ref: '#/definitions/goods-receipt-json-schema'

  tax-json-schema:
    in: body
    required: true
    name: tax-json-schema
    schema:
      $ref: '#/definitions/tax-json-schema'

  purchase-order:
    in: body
    required: true
    name: purchase-order
    schema:
      $ref: '#/definitions/purchase-order'

  invoice-json-schema:
    in: body
    required: true
    name: invoice-json-schema
    schema:
      $ref: '#/definitions/invoice-json-schema'

  invoice-get-json-schema:
    in: body
    required: true
    name: invoice-get-json-schema
    schema:
      $ref: '#/definitions/invoice-get-json-schema'

  invoice-status-sync-request-schema:
    in: body
    required: true
    name: invoice-json-schema
    schema:
      $ref: '#/definitions/invoice-status-sync-request-schema'

  chart-of-account-input-schema:
    in: body
    required: true
    name: chart-of-account-input-schema
    schema:
      $ref: '#/definitions/chart-of-account-input-schema'

  vat-code:
    in: path
    description: customer vat code
    required: true
    name: vat-code
    type: string

  vat-rate:
    in: path
    description: customer vat rate. If vat record was loaded without a vat rate, set it to 0 in this request
    required: true
    name: vat-rate
    type: number

  vat-id:
    in: path
    description: customer vat id
    required: true
    name: vat-id
    type: string

  tax-id:
    in: path
    description: customer tax id
    required: true
    name: tax-id
    type: string

  vat-json-schema:
    in: body
    required: true
    name: vat-json-schema
    schema:
      $ref: '#/definitions/vat-master'

  unit-of-measures-json-schema:
    in: body
    required: true
    name: unit-of-measures-json-schema
    schema:
      $ref: '#/definitions/unit-of-measure'

  lookup-name-id:
    in: path
    description: lookup table name id
    required: true
    name: lookup-name-id
    type: string

  lookup-item-id:
    in: path
    description: lookup item id
    required: true
    name: lookup-item-id
    type: string

  custom-external-id:
    in: path
    description: external-id for custom data item
    required: true
    name: custom-external-id
    type: string

  lookup-table-json-schema:
    in: body
    required: true
    name: lookup-json-schema
    schema:
      $ref: '#/definitions/lookup-table'

  lookup-json-schema:
    in: body
    required: true
    name: lookup-json-schema
    schema:
      $ref: '#/definitions/lookup'

  custom-data-json-schema:
    in: body
    required: true
    name: custom-data-json-schema
    schema:
      $ref: '#/definitions/custom-data'

  dataset-name:
    in: path
    description: data set name
    required: true
    name: dataset-name
    type: string

  entity-schema:
    in: body
    required: true
    name: entity-schema
    schema:
      $ref: '#/definitions/entity'

  find-invoice-query-spec:
    in: body
    description: Query Criterion for locating Invoices
    required: true
    name: find-invoice-query-spec
    schema:
      $ref: '#/definitions/find-invoice-query-spec'

  find-query-spec:
    in: body
    description: Query Criterion for locating Items
    required: true
    name: find-query-spec
    schema:
      $ref: '#/definitions/find-query-spec'

  external-supplier-id:
    in: path
    description: The external supplier id
    required: true
    name: external-supplier-id
    type: string

  purchase-order-number:
    in: path
    description: The Purchase Order Number
    required: true
    name: purchase-order-number
    type: string

  appzen-invoice-id:
    in: path
    description: Unique AppZen invoice id
    required: true
    name: appzen-invoice-id
    type: string

  appzen-segment-id:
    in: path
    description: Unique AppZen COA segment id
    required: true
    name: appzen-segment-id
    type: string

  import-type:
    in: path
    description: The type of import. *supplier*, *invoice* etc.
    required: true
    name: import-type
    type: string

  import-document-name:
    in: path
    description: The name of document - {uuid}.zip
    required: true
    name: import-document-name
    type: string

  supplier-id:
    in: query
    description: The external supplier id
    required: false
    name: supplier-id
    type: string

  purchase_order_number:
    in: query
    description: The external purchase order number id
    required: true
    name: purchase_order_number
    type: string

  invoice-id:
    in: query
    description: The external invoice id
    required: false
    name: invoice-id
    type: string

  invoice-number:
    in: query
    description: The supplier's invoice number
    required: false
    name: invoice-number
    type: string

  segment_type:
    in: query
    description: External customer segment type
    required: true
    name: segment_type
    type: string

  uuid-query:
    in: query
    description: Globally unique identifier for an invoice
    required: false
    name: uuid
    type: string

  uom-code:
    in: path
    description: Customer specific unit of measure code
    required: true
    name: uom-code
    type: string

################################################################################################################
#                                            DEFINITIONS
################################################################################################################
definitions:

  date:
    type: string
    format: 'date'
    example: '2020-11-01'
    description: "date should be in UTC format"

  date-time:
    type: string
    format: date-time
    example: '2024-03-01T11:01:00Z'
    description: "date should be in UTC format"

  uuid:
    type: object
    properties:
      uuid:
        type: string
        example: '5fc03087-d265-11e7-b8c6-83e29cd24f4c'
      status:
        type: string
        example: "CREATED"

  uuid-updated:
    type: object
    properties:
      uuid:
        type: string
        example: '5fc03087-d265-11e7-b8c6-83e29cd24f4c'
      status:
        type: string
        example: "UPDATED"

  signed-url-response:
    type: object
    properties:
      url:
        type: string
        example: 'http://download-link.appzen.com/Staged_Documents/0102/5fc03087-d265-11e7-b8c6-83e29cd24f4c/AEMB7W..<very-long-url>'
      uuid:
        type: string
        example: '5fc03087-d265-11e7-b8c6-83e29cd24f4c'
      expires:
        type: string
        example: '2021-02-23T22:20:47.636Z'

  discounts:
    items:
      properties:
        discount_days:
          default: 0
          example: 0
          description: The discount days
          type: integer
        discount_percent:
          default: 0
          example: 0
          description: The discount percent
          type: integer
        discount_amount:
          default: 0
          example: 0
          description: The discount amount
          type: integer
      type: object
      required:
        - discount_amount
        - discount_days
        - discount_percent
    type: array

  discount:
    type: object
    properties:
      discount_base_amount:
        allOf:
          - $ref: "#/definitions/amount"
        description: Base amount on which the discount is calculated
      discount_percentage:
        type: number
        description: Discount percentage applied
        example: 10.5
      discount_amount:
        allOf:
          - $ref: "#/definitions/amount"
        description: Actual discount amount in currency

  vat-breakdown-item:
    type: object
    properties:
      vat_id:
        type: string
        description: External vat_id
        example: gst_1232ext
      code:
        type: string
        example: GST
      rate:
        type: number
        description: rate as percentage
        minimum: 0
        exclusiveMinimum: true
        example: 20.5
      vat_amount:
        allOf:
          - $ref: "#/definitions/amount"
      jurisdiction_code:
        type: string
        description: Standard tax jurisdiction code
        example: "IN"

  appzen-vat-breakdown-item:
    type: object
    properties:
      code:
        description: A customer vat code maps to one of these predefined list of vat codes mantained by Appzen.
        type: string
        example: VAT
      rate:
        type: number
        description: rate as percentage
        minimum: 0
        exclusiveMinimum: true
        example: 12

  data-lookup-names:
    type: object
    properties:
      coa_lookup_names:
        type: array
        description: If "" or " " (white space only, no lookup context is specified for the corresponding coa_structure element.
        example: [ "us_lookups", "", " ", "f1_list" ]
      supplier_lookup_name:
        type: string
        description: associated supplier lookup name list
        example: "s1"

  invoice-account-segment:
    type: object
    required:
      - code
      - name
      - segment_type
      - appzen_segment_type
      - segment_name_id
    properties:
      code:
        type: string
      name:
        type: string
      segment_type:
        type: string
      appzen_segment_type:
        type: string
        description: "Value represents how appzen understands the customer segment type. OTHER_SEGMENT should be used to map any customer segment type that does not have correspondence with one of the named appzen segment types (e.g. ACCOUNT_SEGMENT, DEPARTMENT_SEGMENT etc). Multiple OTHER_SEGMENT mappings may be specified, if needed."
        enum: [ "OTHER_SEGMENT", "LEGAL_ENTITY_SEGMENT", "COMPANY_SEGMENT", "ACCOUNT_SEGMENT", "DEPARTMENT_SEGMENT", "COST_CENTER_SEGMENT", "VENDOR_SEGMENT", "LOCATION_SEGMENT","USER_SEGMENT", "CUSTOMER_SEGMENT", "PROJECT_SEGMENT", "SPEND_CATEGORY_SEGMENT", "REGION_SEGMENT", "INTERCOMPANY_SEGMENT" ]
        example: "COST_CENTER_SEGMENT"
      segment_name_id:
        type: string

  processed-invoice-account-segment:
    type: object
    properties:
      appzen_segment_type:
        type: string
        description: "Value represents how appzen understands the customer segment type. OTHER_SEGMENT should be used to map any customer segment type that does not have correspondence with one of the named appzen segment types (e.g. ACCOUNT_SEGMENT, DEPARTMENT_SEGMENT etc). Multiple OTHER_SEGMENT mappings may be specified, if needed."
        enum: [ "OTHER_SEGMENT", "LEGAL_ENTITY_SEGMENT", "COMPANY_SEGMENT", "ACCOUNT_SEGMENT", "DEPARTMENT_SEGMENT", "COST_CENTER_SEGMENT", "VENDOR_SEGMENT", "LOCATION_SEGMENT","USER_SEGMENT", "CUSTOMER_SEGMENT", "PROJECT_SEGMENT", "SPEND_CATEGORY_SEGMENT", "REGION_SEGMENT", "INTERCOMPANY_SEGMENT" ]
        example: "COST_CENTER_SEGMENT"
      segment_code:
        type: string
      segment_name:
        type: string
      segment_type:
        type: string

  processed-invoice-other-segment:
    type: object
    properties:
      segment_code:
        type: string
      segment_name:
        type: string
      segment_type:
        type: string

  processed-invoice-other-object-fields:
    type: object
    description: Set of key value pairs, where each value is an object with two keys - name and id
    example:
      code-region: {
        name: 'us-east',
        id: 'region1s'
      }
      code-dept: {
        name: 'wing-1',
        id: '325'
      }

  payment:
    type: object
    properties:
      status:
        type: string
      type:
        type: string
        enum: [ "PAYMENT","DISCOUNT","ADJUSTMENT","CREDIT" ]
        example: "DISCOUNT"
      date:
        allOf:
          - $ref: '#/definitions/date-time'
      scheduled_date:
        allOf:
          - $ref: '#/definitions/date-time'
      description:
        type: string
      amount:
        allOf:
          - $ref: "#/definitions/amount"
      payment_id:
        type: string
      payment_method:
        type: string
      payment_reference_number:
        type: string
      payment_block:
        type: string
      check_number:
        type: string
      remittance_notes:
        type: string
      payment_batch_id:
        type: string
      approval_status:
        type: string
      payment_instructions:
        type: string
      payment_medium:
        type: string
      transaction_fees:
        allOf:
          - $ref: "#/definitions/amount"
      requester:
        type: string
      approver:
        type: string
      exchange_rate:
        allOf:
          - $ref: "#/definitions/exchange-rate"
      bank_information:
        properties:
          bank_account_name:
            default: ''
            type: string
            example: "ABC Bank"
          bank_acct_number:
            type: string
            example: "213-29802-8674"

  po_policy:
    type: object
    properties:
      po_backed:
        type: boolean
      po_match_type:
        allOf:
          - $ref: "#/definitions/po_policy_match_type"
      receipt_type:
        allOf:
          - $ref: "#/definitions/po_receipt_type"

  custom_json_object:
    type: object
    description: Set of key value pairs, where each value is an object with two keys - name and id
    example:
      code-region: {
        name: 'us-east',
        id: 'region1s'
      }
      code-dept: {
        name: 'wing-1',
        id: '325'
      }

  po_policy_match_type:
    type: string
    enum: [ 'PO_NONE_MATCH_TYPE', 'PO_POLICY_TWO_WAY_MATCH', 'PO_POLICY_THREE_WAY_MATCH' ]

  po_receipt_type:
    type: string
    enum: [ 'PO', 'GOODS_RECEIPT' ]

  invoice_line_type:
    type: string
    enum: [ 'NONE_LINE_TYPE', 'GOODS', 'SERVICE', 'FREIGHT', 'TAX', 'MISCELLANEOUS' ]

  bank_account_type:
    type: string
    enum: [ 'CHECKING', 'SAVINGS', 'BUSINESS_CHECKING', 'BUSINESS_SAVINGS', 'MONEY_MARKET', 'CD', 'OTHER' ]

  payment_type:
    type: string
    enum: ["ACH", "DOMESTIC_WIRE", "SEPA_CREDIT_TRANSFER", "INTERNATIONAL_WIRE_SWIFT", "BACS", "BECS", "CHECK_PAPER", "REAL_TIME_PAYMENTS", "VIRTUAL_CARD" ]

  invoice-goods-receipt:
    type: object
    properties:
      receipt_id:
        type: string
        example: "123AB"
        description: "The Receipt ID from source system"
      amount:
        allOf:
          - $ref: '#/definitions/amount'
          - description: "Amount allocated to invoice from this receipt"
      quantity:
        type: integer
        format: int32
        example: 10
        description: "Quantity allocated to invoice from this receipt"

  invoice-line-custom-json:
    type: object
    description: |
      Maximum of 20 fields allowed, 500 chars per field.
      The following is the list of predefined reserved field names. They are the only field names that can have prefix &quot;appzen&#58; &quot;. They are also not subject to the maximum count limit.
      
      appzen&#58; line_level_note_text

    example:
      approval-code: KE-382
      category: internal-projects
      "appzen: line_level_note_text": "Include total check"

  invoice-header-custom-json:
    type: object
    description: |
      Maximum of 20 fields allowed, 500 chars per field.
      The following is the list of predefined reserved field names. They are the only field names that can have prefix &quot;appzen&#58; &quot;. They are also not subject to the maximum count limit.
      
      appzen&#58; vendor_einvoice
      appzen&#58; exchange_rate
      appzen&#58; nota_fiscal_elec_num
      appzen&#58; nota_fiscal_type
      appzen&#58; nota_fiscal_material
      appzen&#58; nota_fiscal_service
      appzen&#58; withholding
      appzen&#58; invoice_category
      appzen&#58; business_place
      appzen&#58; section_code
      appzen&#58; gst_partner
      appzen&#58; place_of_supply
      appzen&#58; invoice_reference_no
      appzen&#58; payment_references
      appzen&#58; qr_reference_code
      appzen&#58; qr_bank
      appzen&#58; qr_unstructured_info
      appzen&#58; qr_structured_info
      appzen&#58; enasarco
      appzen&#58; partner_bank
      appzen&#58; assignment
      appzen&#58; sweden_ocr
      appzen&#58; norway_kid
      appzen&#58; denmark_fik
      appzen&#58; project
      appzen&#58; expenditure_org
      appzen&#58; expenditure_type
      appzen&#58; task
      appzen&#58; work_breakdown_structure
      appzen&#58; latam_vendor_vat_id
      appzen&#58; poland_ksef_id
      appzen&#58; israel_allocation_number
      appzen&#58; buyer_endpoint_id
      appzen&#58; buyer_reference
      appzen&#58; pl_ksef_number
      appzen&#58; pl_ksef_schema_version
      appzen&#58; pl_corrected_invoice_issue_date
      appzen&#58; pl_corrected_invoice_ksef_number
      appzen&#58; pl_corrected_invoice_number
      appzen&#58; pl_reason_for_correction
      appzen&#58; pl_type_of_correction
      appzen&#58; fr_supplier_siren
      appzen&#58; fr_supplier_siret
      appzen&#58; fr_customer_siren
      appzen&#58; fr_customer_siret
      appzen&#58; fr_invoice_format
      appzen&#58; fr_invoice_lifecycle_status
      appzen&#58; it_sdi_codice_destinatario
      appzen&#58; it_sdi_formato_trasmissione
      appzen&#58; it_sdi_id_trasmittente_code
      appzen&#58; it_sdi_id_trasmittente_country
      appzen&#58; it_sdi_pec_destinatario
      appzen&#58; it_sdi_progressivo_invio
      appzen&#58; es_dir3_oficina_contable
      appzen&#58; es_dir3_organo_gestor
      appzen&#58; es_dir3_unidad_tramitadora
      appzen&#58; es_facturae_version
      appzen&#58; de_einvoice_format
      appzen&#58; de_leitweg_id
      appzen&#58; nl_oin
      appzen&#58; nl_preferred_format
      appzen&#58; no_ehf_profile_id
      appzen&#58; no_org_number
      appzen&#58; pt_atcud
      appzen&#58; pt_qr_code_present
      appzen&#58; dk_cvr
      appzen&#58; dk_ean_gln
      appzen&#58; fi_einvoice_address
      appzen&#58; fi_business_id_y_tunnus
      appzen&#58; ie_exchange_rate
      appzen&#58; lu_exchange_rate
      appzen&#58; se_endpoint_id
      appzen&#58; hu_nav_rtir_reporting_required
      appzen&#58; bg_converted_vat_amount
      appzen&#58; be_company_number_kbo_cbe
      appzen&#58; bd_bin_or_tin
      appzen&#58; ca_gst_hst_registration
      appzen&#58; hk_business_registration_number
      appzen&#58; lk_vat_registration
      appzen&#58; mu_vat_number
      appzen&#58; ua_vat_number
      appzen&#58; us_supplier_ein
      appzen&#58; ae_tax_amount_aed
    example:
      approval-code: KE-382
      category: internal-projects
      "appzen: withholding": "23.5"

  invoice-line:
    type: object
    required:
      - total_amount
      - line_number
      - unit_price
      - line_description
      - quantity
    properties:
      line_number:
        type: number
      line_description:
        type: string
      quantity:
        type: number
      unit_price:
        type: object
        required:
          - amount
          - currency
        properties:
          amount:
            type: number
          currency:
            type: string
      total_amount:
        type: object
        required:
          - amount
          - currency
        properties:
          amount:
            type: number
          currency:
            type: string
      tax_amount:
        type: object
        required:
          - amount
          - currency
        properties:
          amount:
            type: number
          currency:
            type: string
      tax_applicability_id:
        type: string
        example: "2A3BL"
      memo:
        type: string
        example: "Partially payed on 12/03"
      amortization_schedule:
        type: string
        example: "monthly"
      price_per_unit:
        type: number
        example: 2.55
      line_vat_amount:
        allOf:
          - $ref: "#/definitions/amount"
      line_vat_breakdown:
        type: array
        items:
          allOf:
            - $ref: "#/definitions/vat-breakdown-item"
            - description: "The break down of vat amount for the invoice line"
      appzen_line_vat_breakdown:
        type: array
        items:
          allOf:
            - $ref: "#/definitions/appzen-vat-breakdown-item"
            - description: "Appzen break down of vat amount for the invoice line"
      purchase_order_number:
        type: string
      purchase_order_line_number:
        type: string
      po_match_type:
        allOf:
          - $ref: "#/definitions/po_policy_match_type"
      line_item_code:
        type: string
      unit_of_measure:
        type: string
      model_number:
        type: string
      currency:
        type: string
      gl_code:
        type: string
      segments:
        type: array
        items:
          type: object
          $ref: "#/definitions/invoice-account-segment"
      has_line_allocations:
        type: boolean
      po_backed_line:
        type: boolean
      line_allocations:
        type: array
        items:
          allOf:
            - $ref: "#/definitions/invoice-line-allocation"
      custom_json:
        allOf:
          - $ref: "#/definitions/invoice-line-custom-json"
      custom_json_object:
        allOf:
          - $ref: "#/definitions/custom_json_object"
      service_start_date:
        allOf:
          - $ref: "#/definitions/date-time"
      service_end_date:
        allOf:
          - $ref: "#/definitions/date-time"
      amortization_start_date:
        allOf:
          - $ref: "#/definitions/date-time"
      amortization_end_date:
        allOf:
          - $ref: "#/definitions/date-time"
      amortization_schedule_details:
        type: object
        properties:
          id:
            type: integer
          name:
            type: string
      line_type:
        allOf:
          - $ref: "#/definitions/invoice_line_type"
      goods_receipts:
        type: array
        items:
          allOf:
            - $ref: '#/definitions/invoice-goods-receipt'
      hsn_sac_code:
        type: string
      
      # PO Condition fields for subsequent invoices (freight, tax, etc.)
      line_conditions:
        type: array
        items:
          allOf:
            - $ref: '#/definitions/invoice-line-condition'
        description: List of PO conditions associated with this invoice line (for subsequent invoice types like freight, tax charges)
      
      # Discount fields at line level
      line_discounts:
        type: array
        items:
          allOf:
            - $ref: '#/definitions/discount'
        description: List of discounts applied at invoice line level
      line_discount:
        allOf:
          - $ref: "#/definitions/amount"
        description: Line level discount amount
      header_discount:
        allOf:
          - $ref: "#/definitions/amount"
        description: Header level discount amount applied to this line
      total_after_line_discount:
        allOf:
          - $ref: "#/definitions/amount"
        description: Total after applying line discounts
      total_after_all_discounts:
        allOf:
          - $ref: "#/definitions/amount"
        description: Total after applying all discounts (line and header)
      


  withholding-tax:
    type: object
    properties:
      type:
        type: string
      code:
        type: string
      base_amount:
        type: object
        required:
          - amount
          - currency
        properties:
          amount:
            type: number
          currency:
            type: string
      wht_amount:
        type: object
        required:
          - amount
          - currency
        properties:
          amount:
            type: number
          currency:
            type: string

  invoice-line-condition:
    type: object
    description: "Represents a PO condition associated with an invoice line (used for subsequent invoice types like freight, tax, etc.)"
    properties:
      scope:
        type: string
        enum: [ 'HEADER', 'LINE' ]
        example: "LINE"
        description: "Whether this charge originated from a header-level PO condition (HEADER) or a line-level PO condition (LINE). Used to match with PO conditions"
      condition_type:
        type: string
        example: "FRA1"
        description: "The condition type code from the PO (e.g., FRA1 for freight, TAX1 for tax). Used to match with PO conditions"
      condition_category:
        type: string
        enum:
          - PURCHASE_ORDER_CONDITION_CATEGORY_UNSPECIFIED
          - TAX_JUR_CODE_TRIGGER
          - TAX_EXEMPTION_LICENSE_VIA_CONDITIONS
          - TOTAL_CHARGES_IS_OIL
          - CHARGES_CONDITION_RECORDS_IS_OIL
          - TAX_JURISDICTION_LEVEL_1_WITH_LICENSE
          - TAX_JURISDICTION_LEVEL_2
          - TAX_JURISDICTION_LEVEL_3
          - TAX_JURISDICTION_LEVEL_4
          - CUSTOMER_RESERVE_5
          - CUSTOMER_RESERVE_6
          - CUSTOMER_RESERVE_7
          - CUSTOMER_RESERVE_8
          - CUSTOMER_RESERVE_9
          - PACKAGING
          - DELIVERY_COSTS
          - INSURANCE
          - CONDITION_TAX
          - CASH_DISCOUNT
          - CONDITION_FREIGHT
          - INTERNAL_PRICE
          - BASIC_PRICE
          - PRICE_FOR_INTERCOMPANY_BILLING
          - CUSTOMER_EXPECTED_PRICE
          - BASE_AMOUNT_EXCLUDING_TAX
          - GENERALLY_NEW_WHEN_COPYING
          - SALES_TAX_WITH_LICENSE_CHECKING
          - INPUT_TAX_NOT_DEDUCTIBLE
          - VARIANTS
          - BASE_AMOUNT_INCLUDING_TAX
          - COSTING
          - INVOICE_LIST_CONDITION
          - STANDARD_COST
          - MOVING_COST
          - DISCOUNT_SURCHARGE_FOR_PRECIOUS_METALS
          - PRICE_COMPONENT
          - EXPECTED_SALES_PRICE_INCLUDING_TAX
          - CUSTOMER_RESERVE_X
          - CUSTOMER_RESERVE_Y
          - CUSTOMER_RESERVE_Z
          - RESERVED_FIXED_EXTRA_PAY
          - TRANSFER_PRICE_FOR_GROUP_VALUATION
          - TRANSFER_PRICE_FOR_PROFIT_CENTERS
          - CONFIRMED_PURCHASE_NET_PRICE
          - DOWN_PAYMENT_REQUEST
          - FREE_GOODS_INCLUSIVE
          - CONDITION_PAYMENT
          - PROFIT_CENTER_COST
          - SHIP_AND_DEBIT_1_IBU_HITEC
          - SHIP_AND_DEBIT_2_IBU_HITEC
          - TP_ILV_BASE_TARIF_COVERS_COSTS
          - SSR_DISCOUNT_IS_OIL
          - PROFIT_CENTER_INTERNAL_PRICE_ROUTE
          - AFS_SEASON_DETERMINATION
          - SSR_PARTNER_COMMISSION_IS_OIL
          - AFS_VALUE_ADDED_SERVICES
        example: "CONDITION_FREIGHT"
        description: "The category of the condition"
      condition_supplier_id:
        type: string
        example: "CARRIER_001"
        description: "[Deprecated] Use charge_vendor_id instead. The supplier/vendor ID for this condition"
        deprecated: true
      charge_vendor_id:
        type: string
        example: "CARRIER_A"
        description: "The actual vendor/supplier ID from the invoice for this charge"
      charge_vendor_name:
        type: string
        example: "DHL Express"
        description: "The vendor/supplier name for this charge"

  invoice-line-allocation:
    type: object
    description: Specify an allocation for an invoice line. Either amount/tax or percentage is required.
    required:
      - amount
      - tax
      - percentage
    properties:
      external_allocation_id:
        type: string
      amount:
        type: number
        example: 25.6
      tax:
        example: 2.56
        type: number
      percentage:
        type: number
        example: 35
      gl_code:
        type: string
      allocation_quantity:
        type: number
      purchase_order_number:
        type: string
      purchase_order_line_number:
        type: integer
      appzen_line_allocation_number:
        type: integer
      goods_receipts:
        type: array
        items:
          allOf:
            - $ref: '#/definitions/invoice-goods-receipt'

  invoice-audit-results-json-schema:
    type: object
    properties:
      audit_results:
        type: object
        properties:
          rules:
            type: array
            items:
              type: object
              properties:
                rule_code:
                  type: string
                  description: A unique identifier of a rule
                  example: "duplicate_invoice_amount"
                risk_message:
                  type: string
                  description: Description of the risk detected
                  example: "No duplicate detected"
                risk_results:
                  type: object
                  properties:
                    risk_level:
                      type: string
                      description: The Risk Level, such as LOW, MEDIUM, or HIGH.
                      example: "LOW"
          risk_level:
            type: string
            description: The risk at invoice header level, such as LOW, MEDIUM, HIGH.
            example: LOW
          status:
            type: string
            description: The overall invoice status, such as Approved, Rejected.
            example: Approved

  invoice-audit-results-search-json-schema:
    type: array
    items:
      type: object
      properties:
        audit_results:
          type: object
          properties:
            uuid:
              type: string
              description: A globally unique identifier for an invoice
              example: "08edd8d9-cc1c-45e1-8bbb-29ffb7e3a404"
            invoice-number:
              type: string
              description: The supplier's invoice number
              example: "MHEIN00051739"
            invoice-id:
              type: string
              description: The external invoice id
              example: "77887788"
            supplier-id:
              type: string
              description: The external supplier id
              example: "7082403"
            rules:
              type: array
              items:
                type: object
                properties:
                  rule_code:
                    type: string
                    description: A unique identifier of a rule
                    example: "duplicate_invoice_amount"
                  risk_message:
                    type: string
                    description: Description of the risk detected
                    example: "No duplicate detected"
                  risk_results:
         

# --- truncated at 32 KB (243 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/appzen/refs/heads/main/openapi/appzen-autonomous-ap-openapi-original.yml