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

# Create purchase order

> Create a new purchase order.



## OpenAPI

````yaml post /v1/purchase-order
openapi: 3.0.0
info:
  title: ibana public api
  description: Public API for ibana
  version: 1.0.0
  contact:
    name: ibana
    url: https://ibana.io
    email: dev@ibana.io
servers:
  - url: http://localhost:3001
security: []
tags: []
paths:
  /v1/purchase-order:
    post:
      tags:
        - Purchase Order
      summary: Create purchase order
      description: Create a new purchase order.
      operationId: PurchaseOrderController_create_v1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePurchaseOrderDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrderResponseDto'
      security:
        - bearer: []
components:
  schemas:
    CreatePurchaseOrderDto:
      type: object
      properties:
        purchaseOrderNumber:
          type: string
          description: The purchase order number.
          example: 247000-08
        externalId:
          type: string
          description: The external ID of the purchase order.
          example: '1234567890'
        deliveryDate:
          format: date-time
          type: string
          description: The delivery date of the purchase order.
          example: '2024-06-21'
        orderDate:
          format: date-time
          type: string
          description: The order date of the purchase order.
          example: '2024-06-21'
        counterpartyId:
          type: string
          description: >-
            The ID of an existing counterparty that will receive the purchase
            order.
          example: 90b9e856-a662-41e0-a1b2-32e06f83141f
        counterparty:
          description: The counterparty of the purchase order.
          allOf:
            - $ref: '#/components/schemas/CreateCounterpartyDto'
        lineItems:
          description: The line items of the purchase order.
          type: array
          items:
            $ref: '#/components/schemas/CreatePurchaseOrderLineItemDto'
        currency:
          type: string
          nullable: false
          enum:
            - EUR
            - USD
            - GBP
            - JPY
            - AUD
            - CAD
            - CHF
            - CNY
            - HKD
            - NZD
            - SEK
            - KRW
            - SGD
            - NOK
            - MXN
            - INR
            - BRL
            - RUB
            - ZAR
            - TRY
            - AED
            - THB
            - DKK
            - HUF
            - PLN
            - TWD
            - SAR
            - MYR
            - IDR
          default: EUR
          description: The currency of the purchase order.
      required:
        - purchaseOrderNumber
        - currency
    PurchaseOrderResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        purchaseOrderNumber:
          type: string
          description: The unique number of the purchase order.
        externalId:
          type: string
          description: The external ID of the purchase order.
        orderDate:
          format: date-time
          type: string
          description: The date of the purchase order.
        deliveryDate:
          format: date-time
          type: string
          description: The date of the delivery of the purchase order.
        counterparty:
          description: The counterparty of the purchase order.
          allOf:
            - $ref: '#/components/schemas/CounterpartyResponseDto'
        lineItems:
          description: The line items of the purchase order.
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrderLineItemResponseDto'
        currency:
          type: string
          description: The currency of the purchase order
        counterpartyId:
          type: string
          description: The counterparty ID
        counterpartyName:
          type: string
          description: The counterparty name
        totalOrderAmount:
          type: number
          description: Total monetary amount of the purchase order
        totalInvoicedAmount:
          type: number
          description: Total monetary amount invoiced for this purchase order
        totalLineItems:
          type: number
          description: Total number of line items in the purchase order
        fullyInvoicedLineItemsCount:
          type: number
          description: Number of line items that are fully invoiced (quantity-wise)
        fullyDeliveredLineItemsCount:
          type: number
          description: Number of line items that are fully delivered (quantity-wise)
        invoiceCompletionPercentage:
          type: number
          description: Percentage of order amount that has been invoiced (monetary)
        totalOrderQuantity:
          type: number
          description: Total quantity ordered across all line items
        totalDeliveredQuantity:
          type: number
          description: Total quantity delivered across all line items
        uniqueDeliveriesCount:
          type: number
          description: Number of unique deliveries for this purchase order
        totalInvoicedQuantity:
          type: number
          description: Total quantity invoiced across all line items
        uniqueInvoicesCount:
          type: number
          description: Number of unique invoices for this purchase order
        outstandingInvoiceAmount:
          type: number
          description: Monetary amount still pending invoicing
      required:
        - currency
        - counterpartyId
        - counterpartyName
        - totalOrderAmount
        - totalInvoicedAmount
        - totalLineItems
        - fullyInvoicedLineItemsCount
        - fullyDeliveredLineItemsCount
        - invoiceCompletionPercentage
        - totalOrderQuantity
        - totalDeliveredQuantity
        - uniqueDeliveriesCount
        - totalInvoicedQuantity
        - uniqueInvoicesCount
        - outstandingInvoiceAmount
    CreateCounterpartyDto:
      type: object
      properties:
        email:
          type: string
          example: john@example.com
          description: The email of the counterparty.
        name:
          type: string
          example: John Doe
          description: Name of the counterparty.
        description:
          type: string
          example: Supplier for monthly raw material
          description: Description of the counterparty to.
        vat:
          type: string
          example: GB123456789
          description: VAT number used in the EU if the counterparty is a company
        accountsPayableNumber:
          type: string
          example: 30001
          description: Accounts payable number of the counterparty. Used in bookkeeping.
        accountsPayableMode:
          type: string
          enum:
            - AUTO
            - MANUAL
            - NONE
          description: How to set the accounts payable number for this counterparty.
        accountsReceivableNumber:
          type: string
          example: 10001
          description: Accounts receivable number of the counterparty. Used in bookkeeping.
        street:
          type: string
          example: Main Street 123
          description: Street name and number of the counterparty.
        city:
          type: string
          example: Vienna
          description: City of the counterparty.
        zip:
          type: string
          example: '1010'
          description: ZIP or postal code of the counterparty.
        country:
          type: string
          example: AT
          description: Country of the counterparty using ISO 3166-1 alpha-2 code.
        paymentTermsDays:
          type: number
          example: 30
          description: Payment term in days
        skontoPercentage:
          type: number
          example: 2.5
          description: Early payment discount percentage
        skontoDays:
          type: number
          example: 10
          description: Days for early payment discount
        defaultLedgerAccount:
          type: string
          example: 0000 - Ledger Account Name
          description: Default ledger account of the counterparty. Used in invoices.
        bankAccount:
          description: Bank account of the counterparty
          allOf:
            - $ref: '#/components/schemas/CreateBankAccountDto'
        paymentReminderEmails:
          type: string
          description: Email addresses for payment reminders, separated by commas
        cardBookingPreference:
          type: string
          enum:
            - INVOICE_COUNTERPARTY
            - ORG_CARD_COMMON
          description: >-
            Default bookkeeping behavior for card-paid invoices of this
            counterparty.
    CreatePurchaseOrderLineItemDto:
      type: object
      properties:
        externalId:
          type: string
          description: The external ID of the line item.
          example: '1234567890'
        productCode:
          type: string
          description: The product code used to link the line item to a product.
          example: '1234567890'
        title:
          type: string
          description: The title of the line item.
          example: Product Title
        unit:
          type: string
          description: The unit of the line item.
          example: '1234567890'
        quantity:
          type: number
          description: The quantity of the line item.
          example: 1
        unitPrice:
          type: number
          description: The unit price of the line item (net amount, excluding tax).
          example: 1
        pricePerQuantity:
          type: number
          description: The pricing basis of the unit price (e.g. 100 for "1.84 per 100").
          example: 100
        totalPrice:
          type: number
          description: >-
            The total price of the line item (net amount, excluding tax).
            Calculated as quantity / pricePerQuantity * unitPrice.
          example: 100
        discount:
          type: number
          description: The discount of the line item.
          example: 5
        taxRate:
          type: number
          description: The tax rate of the line item.
          example: 20
        taxAmount:
          type: number
          description: The tax amount of the line item.
          example: 150
    CounterpartyResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        email:
          type: string
          description: The email of the counterparty.
        name:
          type: string
          description: The name of the counterparty.
        description:
          type: string
          description: The description of the counterparty.
        vat:
          type: string
          description: The EU VAT number of the counterparty.
        accountsPayableNumber:
          type: string
          example: 22 0391919
          description: Accounts payable number of the counterparty. Used in bookkeeping.
        accountsPayableMode:
          type: string
          enum:
            - AUTO
            - MANUAL
            - NONE
          description: How accounts payable number is managed for this counterparty.
        street:
          type: string
          description: Street name and number of the counterparty.
        city:
          type: string
          description: City of the counterparty.
        zip:
          type: string
          description: ZIP or postal code of the counterparty.
        country:
          type: string
          description: Country of the counterparty using ISO 3166-1 alpha-2 code.
        paymentTermsDays:
          type: number
          description: Payment term in days
        skontoPercentage:
          type: number
          description: Early payment discount percentage
        skontoDays:
          type: number
          description: Days for early payment discount
        organization:
          description: The organization of the counterparty.
          allOf:
            - $ref: '#/components/schemas/OrganizationResponseDto'
        bankAccount:
          description: The bank account of the counterparty.
          allOf:
            - $ref: '#/components/schemas/BankAccountResponseDto'
        transactions:
          description: The transactions of the counterparty.
          allOf:
            - $ref: '#/components/schemas/TransactionResponseDto'
        cardBookingPreference:
          type: string
          enum:
            - INVOICE_COUNTERPARTY
            - ORG_CARD_COMMON
          description: >-
            Default booking preference for card-paid invoices of this
            counterparty.
        apBalance:
          description: Derived AP balance for this counterparty.
          allOf:
            - $ref: '#/components/schemas/CounterpartyApBalanceResponseDto'
      required:
        - email
        - name
        - description
        - vat
        - accountsPayableNumber
        - accountsPayableMode
        - street
        - city
        - zip
        - country
        - paymentTermsDays
        - skontoPercentage
        - skontoDays
        - organization
        - bankAccount
        - transactions
        - cardBookingPreference
    PurchaseOrderLineItemResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        productCode:
          type: number
          description: >-
            Unique identifier or code for the product or service in this line
            item.
        externalId:
          type: string
          description: External identifier for this line item from the source system.
        title:
          type: string
          description: Brief title or name of the product or service in this line item.
        summary:
          type: string
          description: Short semantic summary of what this line item represents.
        description:
          type: string
          description: >-
            Detailed description of the product, service, or purpose of this
            line item.
        quantity:
          type: number
          description: Number of units for this line item.
        unit:
          type: number
          description: >-
            Unit of measure for this line item (e.g., "pcs", "kg", "discount"
            for discounts).
        unitPrice:
          type: number
          description: >-
            Price per unit for this line item (net amount, excluding tax), in
            the invoice currency.
        pricePerQuantity:
          type: number
          description: >-
            Pricing basis for the displayed unit price, e.g. 100 for "1.84 per
            100".
        totalPrice:
          type: number
          description: >-
            Total price for this line item (net amount, excluding tax).
            Calculated as quantity / pricePerQuantity * unitPrice, in the
            invoice currency.
        discount:
          type: number
          description: >-
            Discount amount for this line item, in the invoice currency
            (negative for discounts).
        taxRate:
          type: number
          description: Tax rate applied to this line item, in percent.
        taxAmount:
          type: number
          description: Total tax amount for this line item, in the invoice currency.
        deliveredQuantity:
          type: number
          description: Total quantity delivered for this line item
        invoicedQuantity:
          type: number
          description: Total quantity invoiced for this line item
        invoicedTotalAmount:
          type: number
          description: Total amount invoiced for this line item
        deliveryPercentage:
          type: number
          description: Percentage of ordered quantity that has been delivered
        invoicedPercentage:
          type: number
          description: Percentage of ordered quantity that has been invoiced
    CreateBankAccountDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the bank account holder
        iban:
          type: string
          description: IBAN of the bank account holder
      required:
        - name
        - iban
    OrganizationResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        name:
          type: string
          description: The name of the organization.
        slug:
          type: string
          description: The slug of the organization.
        inCaseOfLawCustomerId:
          type: string
          description: >-
            The In case of law customer ID for this organization, if already
            connected.
          nullable: true
        logoFileName:
          type: string
          description: The logo file name.
        country:
          type: string
          description: The country of the organization using ISO 3166-1 alpha-2 code
        vatNumber:
          type: string
          description: The VAT number of the organization
        featureFlags:
          description: The feature flags associated with the organization.
          type: array
          items:
            $ref: '#/components/schemas/FeatureFlagResponseDto'
        baseCurrency:
          type: string
          description: The base currency of the organization
          enum:
            - EUR
            - USD
            - GBP
            - JPY
            - AUD
            - CAD
            - CHF
            - CNY
            - HKD
            - NZD
            - SEK
            - KRW
            - SGD
            - NOK
            - MXN
            - INR
            - BRL
            - RUB
            - ZAR
            - TRY
            - AED
            - THB
            - DKK
            - HUF
            - PLN
            - TWD
            - SAR
            - MYR
            - IDR
          default: EUR
        paymentRunBatchBooking:
          type: boolean
          description: >-
            Default setting for whether payment runs should be exported as batch
            booking or single bookings.
        paymentRunVerificationOfPayee:
          type: boolean
          description: >-
            Default setting for whether the bank should perform verification of
            payee (IBAN-Name check) for payment runs.
        invoiceExportIncludeForeignCurrencies:
          type: boolean
          description: >-
            When true, invoice exports include original currency/amounts; when
            false, exports use EUR only (foreign amounts converted).
        allowDirectInvoiceApproval:
          type: boolean
          description: >-
            Whether direct approval is allowed for invoice approval workflows in
            this organization.
        allowDirectPaymentRunApproval:
          type: boolean
          description: >-
            Whether direct approval is allowed for payment run approval
            workflows in this organization.
        cardCommonBookingTargetName:
          type: string
          description: >-
            Configured shared card booking target display name used for card
            bookkeeping export.
          nullable: true
        cardCommonBookingTargetAccountsPayableNumber:
          type: string
          description: >-
            Configured shared card booking target accounts payable number used
            for card bookkeeping export.
          nullable: true
        cardFxDifferenceLedgerAccount:
          type: string
          description: >-
            Configured ledger account used for FX difference lines in card
            bookkeeping export.
          nullable: true
        customExportFormats:
          description: Custom export formats enabled for this organization
          example:
            - custom_experta
          type: array
          items:
            type: string
        autoPopulateCustomerEmailFromMetadata:
          type: boolean
          description: >-
            Determines if the organization automatically populates customer
            email addresses from email metadata for AR invoices.
        autoPopulateSupplierEmailFromMetadata:
          type: boolean
          description: >-
            Determines if the organization automatically populates supplier
            email addresses from email metadata for AP invoices.
        excludedEmailDomains:
          type: string
          description: >-
            Comma-separated list of email domains that should be excluded from
            auto-population.
      required:
        - name
        - slug
        - logoFileName
        - country
        - vatNumber
        - featureFlags
        - baseCurrency
        - paymentRunBatchBooking
        - paymentRunVerificationOfPayee
        - invoiceExportIncludeForeignCurrencies
        - allowDirectInvoiceApproval
        - allowDirectPaymentRunApproval
        - customExportFormats
        - autoPopulateCustomerEmailFromMetadata
        - autoPopulateSupplierEmailFromMetadata
        - excludedEmailDomains
    BankAccountResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        name:
          type: string
          description: The name of the bank account holder.
        iban:
          type: string
          description: The IBAN of the bank account.
        bic:
          type: string
          description: The BIC of the bank account.
        countryCode:
          type: string
          description: The country code of the bank account.
        address:
          type: string
          description: The address of the bank account holder.
      required:
        - name
        - iban
        - bic
        - countryCode
        - address
    TransactionResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        amount:
          type: number
          description: The amount of the transaction.
        remittanceInformation:
          type: string
          description: The remittance information of the transaction.
        requestedExecutionDate:
          format: date-time
          type: string
          description: The requested execution date of the transaction.
        skontoAmount:
          type: number
          description: The amount of the skonto.
        skontoDate:
          format: date-time
          type: string
          description: The date of the skonto.
        ignoreSkontoDeadline:
          type: boolean
          description: Determines if the skonto deadline should be ignored.
        express:
          type: boolean
          description: >-
            Determines if the transaction should be processed as an instant or
            urgent payment.
        currency:
          type: string
          nullable: false
          enum:
            - EUR
            - USD
            - GBP
            - JPY
            - AUD
            - CAD
            - CHF
            - CNY
            - HKD
            - NZD
            - SEK
            - KRW
            - SGD
            - NOK
            - MXN
            - INR
            - BRL
            - RUB
            - ZAR
            - TRY
            - AED
            - THB
            - DKK
            - HUF
            - PLN
            - TWD
            - SAR
            - MYR
            - IDR
          description: The currency of the transaction.
        creditor:
          description: The creditor of the transaction.
          allOf:
            - $ref: '#/components/schemas/BankAccountResponseDto'
        debitor:
          description: The debitor of the transaction.
          allOf:
            - $ref: '#/components/schemas/BankAccountResponseDto'
        analysis:
          description: The analysis of the transaction.
          allOf:
            - $ref: '#/components/schemas/AnalysisResponseDto'
        archived:
          type: boolean
          description: Determines if the transaction has been archived.
        archivedDate:
          format: date-time
          type: string
          description: The date and time the transaction was archived.
        archivedByUser:
          description: The user that archived the transaction.
          allOf:
            - $ref: '#/components/schemas/UserResponseDto'
        paymentRun:
          description: The payment run the transaction is assigned to
          allOf:
            - $ref: '#/components/schemas/PaymentRunResponseDto'
        counterparty:
          description: The counterparty of the transaction.
          allOf:
            - $ref: '#/components/schemas/CounterpartyResponseDto'
        invoice:
          description: The invoice associated with the transaction.
          allOf:
            - $ref: '#/components/schemas/TransactionInvoiceInfoDto'
    CounterpartyApBalanceResponseDto:
      type: object
      properties:
        openInvoiceAmount:
          type: number
        approvedOpenCreditNoteAmount:
          type: number
        manualCreditAmount:
          type: number
        totalAvailableCredit:
          type: number
        netPayableAmount:
          type: number
        remainingCreditBalance:
          type: number
        scheduledBankTransferAmount:
          type: number
        remainingToScheduleAmount:
          type: number
        unapprovedCreditNoteAmount:
          type: number
        appliedInvoiceCreditAmount:
          type: number
        balancesByCurrency:
          type: array
          items:
            $ref: '#/components/schemas/CounterpartyApBalanceCurrencyResponseDto'
      required:
        - openInvoiceAmount
        - approvedOpenCreditNoteAmount
        - manualCreditAmount
        - totalAvailableCredit
        - netPayableAmount
        - remainingCreditBalance
        - scheduledBankTransferAmount
        - remainingToScheduleAmount
        - unapprovedCreditNoteAmount
        - appliedInvoiceCreditAmount
    FeatureFlagResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        featureName:
          type: string
          description: The name of the feature.
        isEnabled:
          type: boolean
          description: A boolean that indicates if the feature is enabled.
      required:
        - featureName
        - isEnabled
    AnalysisResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        analysisRules:
          description: The analysis rules of the transaction.
          allOf:
            - $ref: '#/components/schemas/AnalysisRuleResponseDto'
      required:
        - analysisRules
    UserResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        email:
          type: string
          description: The email of the user.
        name:
          type: string
          description: The name of the user.
        authId:
          type: string
          description: The workOs authentication id of the user.
        role:
          type: string
          description: The role the user has in the organization.
        hasPushNotification:
          type: boolean
          description: >-
            A boolean that determines if the user has push notifications
            enabled.
        featureFlags:
          type: array
          description: The feature flags available to the user.
          items:
            type: string
            enum:
              - invoice
              - ar-invoice
              - transaction
              - candis
              - bank-transaction
              - webhook
              - procurement
              - ai-search
              - insights
              - payment-cards
              - in-case-of-law
        organization:
          description: The active organization the user is in.
          allOf:
            - $ref: '#/components/schemas/OrganizationResponseDto'
      required:
        - email
        - name
        - authId
        - role
        - hasPushNotification
        - organization
    PaymentRunResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Id of the payment run
        createdAt:
          format: date-time
          type: string
          description: Creation date of the payment run
        createdById:
          type: string
          description: Id of the user who created the payment run
        createdByName:
          type: string
          description: Name of the user who created the payment run
        organizationId:
          type: string
          description: Id of the orgnaization
        sumAmount:
          type: number
          description: Total amount of all transactions in the payment run
        sumAmountWithSkonto:
          type: number
          description: Total amount of all transactions in the payment run with skonto
        sumBookedAmount:
          type: number
          description: >-
            Total amount of all transactions in the payment run at the time of
            booking
        transactionCount:
          type: number
          description: Count of transactions in the payment run
        batchBooking:
          type: boolean
          description: >-
            Override setting for whether this payment run should be exported as
            batch booking. If null, uses the organization default.
      required:
        - id
        - createdAt
        - createdById
        - createdByName
        - organizationId
        - sumAmount
        - sumAmountWithSkonto
        - sumBookedAmount
        - transactionCount
    TransactionInvoiceInfoDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the invoice.
        invoiceNumber:
          type: string
          description: The invoice number.
        status:
          type: string
          description: The status of the invoice.
        totalAmount:
          type: number
          description: The total amount of the invoice.
        dueDate:
          format: date-time
          type: string
          description: The due date of the invoice.
        invoiceDate:
          format: date-time
          type: string
          description: The date of the invoice.
        currency:
          type: string
          description: The currency of the invoice.
      required:
        - id
        - invoiceNumber
        - status
        - totalAmount
        - dueDate
        - invoiceDate
        - currency
    CounterpartyApBalanceCurrencyResponseDto:
      type: object
      properties:
        currency:
          type: string
          enum:
            - EUR
            - USD
            - GBP
            - JPY
            - AUD
            - CAD
            - CHF
            - CNY
            - HKD
            - NZD
            - SEK
            - KRW
            - SGD
            - NOK
            - MXN
            - INR
            - BRL
            - RUB
            - ZAR
            - TRY
            - AED
            - THB
            - DKK
            - HUF
            - PLN
            - TWD
            - SAR
            - MYR
            - IDR
        approvedOpenCreditNoteAmount:
          type: number
        manualCreditAmount:
          type: number
        totalAvailableCredit:
          type: number
        appliedInvoiceCreditAmount:
          type: number
        remainingCreditBalance:
          type: number
      required:
        - currency
        - approvedOpenCreditNoteAmount
        - manualCreditAmount
        - totalAvailableCredit
        - appliedInvoiceCreditAmount
        - remainingCreditBalance
    AnalysisRuleResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity.
        createdAt:
          format: date-time
          type: string
          description: The date and time the entity was created.
        updatedAt:
          format: date-time
          type: string
          description: The date and time the entity was last updated.
        type:
          type: string
          enum:
            - AMOUNT_DEVIATION
            - AMOUNT_DEVIATION_SAME_IBAN
            - AMOUNT_DEVIATION_SAME_COUNTRY
            - SAME_IBAN_DIFFERENT_NAME
            - SAME_NAME_DIFFERENT_IBAN
            - NEW_BANK_ACCOUNT
            - DUPLICATE_INVOICE
            - PAYMENT_REMINDER
          description: The type of the analysis rule.
        severity:
          type: string
          enum:
            - NORMAL
            - INFO
            - WARNING
            - SUSPICIOUS
          description: The severity of the analysis rule.
        markedOk:
          type: boolean
          description: Determines if the transaction was marked as ok by a user.
        markedOkReason:
          type: string
          description: The reason why the transaction was marked as ok.
        markedOkDate:
          format: date-time
          type: string
          description: The date and time the transaction was marked as ok.
        value:
          type: string
          description: 'The value of the analysis rule. '
        markedOkUser:
          description: The user that marked the transaction as ok.
          allOf:
            - $ref: '#/components/schemas/UserResponseDto'
      required:
        - type
        - severity
        - markedOk
        - markedOkReason
        - markedOkDate
        - value
        - markedOkUser
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````