components:
  schemas:
    ContractsPayable:
      additionalProperties: false
      properties:
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        current_balance:
          type: string
      required:
      - contract_id
      - currency_code
      - current_balance
      type: object
    DataloaderParamsPost:
      additionalProperties: false
      properties:
        ids:
          items:
            minimum: 0
            type: integer
          type: array
      required:
      - ids
      type: object
    FilterKey:
      additionalProperties: false
      properties:
        detail_groups:
          items:
            minLength: 1
            type: string
          type: array
        worksheet_payable_after_tax_ids:
          items:
            minimum: 0
            type: integer
          type: array
      type: object
    FilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          anyOf:
          - nullable: true
            type: object
          - $ref: '#/components/schemas/FilterKey'
      type: object
    GenericSuccessResponse:
      additionalProperties: false
      properties:
        message:
          default: OK
          type: string
      type: object
    LastPaymentBulkFilterKey:
      additionalProperties: false
      properties:
        account_ids:
          items:
            minimum: 0
            type: integer
          minItems: 1
          type: array
      required:
      - account_ids
      type: object
    LastPaymentBulkFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          $ref: '#/components/schemas/LastPaymentBulkFilterKey'
      required:
      - filters
      type: object
    PaginatedWorksheetAccountContractClosingBalanceOutput:
      additionalProperties: false
      properties:
        items:
          example:
          - abacus_event_id: 1
            account_id: 1
            amount: '1.0'
            contract_id: 1
            currency_code: USD
            includes_tax_adjustments: true
            ledger_account_contract_id: 1
            reference_payment_entity_id: 1
            statement_period_id: 1
            worksheet_account_contract_closing_balance_id: 1
          - abacus_event_id: 2
            account_id: 2
            amount: '2.0'
            contract_id: 2
            currency_code: USD
            includes_tax_adjustments: false
            ledger_account_contract_id: 2
            reference_payment_entity_id: 2
            statement_period_id: 2
            worksheet_account_contract_closing_balance_id: 2
          items:
            $ref: '#/components/schemas/WorksheetAccountContractClosingBalance'
          type: array
        total_count:
          example: 2
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    PaginatedWorksheetAccountContractPayableDetailsOutput:
      additionalProperties: false
      properties:
        items:
          example:
          - account_id: 1
            amount_payable: '1.0'
            contract_id: 1
            currency: USD
            notes: some notes
            payable_detail_type_id: 1
            reference_target_id: 1
            reference_target_table: some_target_table_1
            statement_period_id: 1
            target_id: 1
            target_table: some_table_1
            worksheet_account_contract_payable_after_tax_id: 1
            worksheet_account_contract_payable_details_id: 1
          - account_id: 2
            amount_payable: '2.0'
            contract_id: 2
            currency: USD
            payable_detail_type_id: 2
            statement_period_id: 2
            target_id: 2
            target_table: some_table_2
            worksheet_account_contract_payable_after_tax_id: 2
            worksheet_account_contract_payable_details_id: 2
          items:
            $ref: '#/components/schemas/WorksheetAccountContractPayableDetailsDetail'
          type: array
        limit:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
        offset:
          default: 0
          minimum: 0
          type: integer
        total_count:
          example: 2
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    PayableDetailsBulkFilterKey:
      additionalProperties: false
      properties:
        payable_detail_type_ids:
          items:
            minimum: 0
            type: integer
          type: array
        payment_group_payment_account_ids:
          items:
            minimum: 0
            type: integer
          minItems: 1
          type: array
      required:
      - payment_group_payment_account_ids
      type: object
    PayableDetailsBulkFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          $ref: '#/components/schemas/PayableDetailsBulkFilterKey'
      required:
      - filters
      type: object
    PaymentAllocationFlowthrough:
      additionalProperties: false
      properties:
        amount_to_ledger:
          type: number
        amount_to_payment:
          type: number
        contract_id:
          minimum: 0
          type: integer
        created_at:
          format: null
          pattern: null
          type: string
        created_by:
          type: string
        currency_code:
          minLength: 1
          type: string
        description:
          nullable: true
          type: string
        last_modified:
          format: null
          pattern: null
          type: string
        last_modified_by:
          type: string
        ledger_status:
          enum:
          - debited
          - returned
          - init
          - attached_to_payment
          type: string
        ledger_status_modified:
          format: date-time
          nullable: true
          type: string
        payee_id:
          minimum: 0
          type: integer
        payee_type:
          enum:
          - account_payee
          - payee
          type: string
        payment_allocation_id:
          minimum: 0
          type: integer
        payment_allocation_type:
          enum:
          - collaborator
          - flowthrough
          - transfer_of_earning
          type: string
        payment_status:
          enum:
          - init
          - attached_to_payment
          - paid
          - returned
          type: string
        payment_status_modified:
          format: date-time
          nullable: true
          type: string
        statement_period_id:
          minimum: 0
          type: integer
      required:
      - amount_to_ledger
      - amount_to_payment
      - contract_id
      - created_at
      - created_by
      - currency_code
      - last_modified
      - last_modified_by
      - ledger_status
      - payee_id
      - payee_type
      - payment_allocation_id
      - payment_allocation_type
      - payment_status
      - statement_period_id
      type: object
    PaymentAllocationFlowthroughBulkDelete:
      additionalProperties: false
      properties:
        payment_allocation_ids:
          items:
            minimum: 0
            type: integer
          type: array
      required:
      - payment_allocation_ids
      type: object
    PaymentAllocationFlowthroughBulkRequest:
      additionalProperties: false
      properties:
        contract_ids:
          default: null
          items:
            minimum: 0
            type: integer
          nullable: true
          type: array
        ledger_statuses:
          default: null
          items:
            enum:
            - debited
            - returned
            - init
            - attached_to_payment
            type: string
          nullable: true
          type: array
        payment_allocation_ids:
          default: null
          items:
            minimum: 0
            type: integer
          nullable: true
          type: array
        payment_statuses:
          default: null
          items:
            enum:
            - init
            - attached_to_payment
            - paid
            - returned
            type: string
          nullable: true
          type: array
      type: object
    PaymentAllocationFlowthroughBulkUpdate:
      additionalProperties: false
      properties:
        ledger_status:
          enum:
          - debited
          - returned
          - init
          - attached_to_payment
          type: string
        payment_allocation_id:
          minimum: 0
          type: integer
        payment_status:
          description: 'Allowed transitions: None -> init | init -> attached_to_payment
            | returned -> attached_to_payment | attached_to_payment -> paid, init,
            returned | paid -> returned'
          enum:
          - init
          - attached_to_payment
          - paid
          - returned
          type: string
      required:
      - payment_allocation_id
      type: object
    PaymentAllocationFlowthroughList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentAllocationFlowthrough'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    PaymentDebitCreditDataEntry:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        worksheet_account_contract_payable_after_tax_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount
      - contract_id
      - currency_code
      - worksheet_account_contract_payable_after_tax_id
      type: object
    PaymentGroupCriteria:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        account_ids:
          items:
            minimum: 0
            type: integer
          maxItems: 100
          minItems: 1
          type: array
        currency_codes:
          items:
            type: string
          type: array
        payment_schedules:
          items:
            enum:
            - 30_days_after_month_end
            - 45_days_after_month_end
            - 60_days_after_month_end
            - 90_days_after_month_end
            - 30_days_after_quarter_end
            - 45_days_after_quarter_end
            - 60_days_after_quarter_end
            - 90_days_after_quarter_end
            - 30_days_after_half_year_end
            - 45_days_after_half_year_end
            - 60_days_after_half_year_end
            - 90_days_after_half_year_end
            - TEMPORARY
            type: string
          type: array
        reference_agreement_types:
          items:
            minimum: 0
            type: integer
          type: array
        reference_payment_entities:
          items:
            minimum: 0
            type: integer
          type: array
      type: object
    PaymentGroupCriteria1:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        account_ids:
          items:
            minimum: 0
            type: integer
          maxItems: 100
          minItems: 1
          type: array
        currency_codes:
          items:
            type: string
          type: array
        payment_schedules:
          items:
            enum:
            - 30_days_after_month_end
            - 45_days_after_month_end
            - 60_days_after_month_end
            - 90_days_after_month_end
            - 30_days_after_quarter_end
            - 45_days_after_quarter_end
            - 60_days_after_quarter_end
            - 90_days_after_quarter_end
            - 30_days_after_half_year_end
            - 45_days_after_half_year_end
            - 60_days_after_half_year_end
            - 90_days_after_half_year_end
            - TEMPORARY
            type: string
          type: array
        reference_agreement_types:
          items:
            minimum: 0
            type: integer
          type: array
        reference_payment_entities:
          items:
            minimum: 0
            type: integer
          type: array
        reference_payment_type_id:
          minimum: 0
          type: integer
      type: object
    PaymentGroupDetail:
      additionalProperties: false
      properties:
        group_criteria:
          $ref: '#/components/schemas/PaymentGroupCriteria1'
        group_name:
          minLength: 1
          type: string
        is_reusable:
          type: boolean
        payment_group_id:
          minimum: 0
          type: integer
      required:
      - group_name
      - payment_group_id
      type: object
    PaymentGroupList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentGroupDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      type: object
    PaymentGroupPaymentAccount:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        balance_after_tax:
          type: number
        contracts_payable:
          items:
            $ref: '#/components/schemas/ContractsPayable'
          type: array
        currency_code:
          minLength: 1
          type: string
        currency_name:
          minLength: 1
          type: string
        current_balance:
          type: number
        current_statement_period_name:
          minLength: 1
          type: string
        last_payment:
          type: number
        last_statement_period_id:
          minimum: 0
          nullable: true
          type: integer
        last_statement_period_name:
          type: string
        note:
          type: string
        payoneer_program_id:
          minimum: 0
          type: integer
        prior_payment_group_payment_id:
          minimum: 0
          type: integer
        tax_withholding:
          nullable: true
          type: number
        vat_amount:
          nullable: true
          type: number
      required:
      - account_id
      - balance_after_tax
      - contracts_payable
      - currency_code
      - current_balance
      - last_payment
      - payoneer_program_id
      type: object
    PaymentGroupPaymentAccount1:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        balance_after_tax:
          type: number
        contracts_payable:
          items:
            $ref: '#/components/schemas/ContractsPayable'
          type: array
        currency_code:
          minLength: 1
          type: string
        currency_name:
          minLength: 1
          type: string
        current_balance:
          type: number
        current_statement_period_id:
          minimum: 0
          type: integer
        current_statement_period_name:
          minLength: 1
          type: string
        last_payment:
          type: number
        last_statement_period_id:
          minimum: 0
          nullable: true
          type: integer
        last_statement_period_name:
          type: string
        note:
          type: string
        payment_group_payment_account_id:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payoneer_program_id:
          minimum: 0
          type: integer
        prior_payment_group_payment_id:
          minimum: 0
          type: integer
        tax_withholding:
          nullable: true
          type: number
        vat_amount:
          nullable: true
          type: number
      required:
      - account_id
      - balance_after_tax
      - contracts_payable
      - currency_code
      - current_balance
      - current_statement_period_id
      - last_payment
      - payment_group_payment_account_id
      - payment_group_payment_id
      - payoneer_program_id
      type: object
    PaymentGroupPaymentAccountFilterKey:
      additionalProperties: false
      properties:
        account_ids:
          items:
            minimum: 0
            type: integer
          type: array
        contract_ids:
          items:
            minimum: 0
            type: integer
          type: array
        payment_statuses:
          items:
            minLength: 1
            type: string
          type: array
      type: object
    PaymentGroupPaymentAccountFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          allOf:
          - $ref: '#/components/schemas/PaymentGroupPaymentAccountFilterKey'
          default: {}
      type: object
    PaymentGroupPaymentAccountList:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        account_name:
          minLength: 1
          type: string
        account_payee_id:
          minimum: 0
          type: integer
        balance_after_tax:
          type: number
        contracts_payable:
          items:
            $ref: '#/components/schemas/ContractsPayable'
          type: array
        currency_code:
          minLength: 1
          type: string
        currency_name:
          minLength: 1
          type: string
        current_balance:
          type: number
        current_statement_period_id:
          minimum: 0
          type: integer
        current_statement_period_name:
          minLength: 1
          type: string
        last_payment:
          type: number
        last_statement_period_id:
          minimum: 0
          nullable: true
          type: integer
        last_statement_period_name:
          type: string
        note:
          type: string
        payment_difference:
          type: number
        payment_error_code:
          minLength: 1
          type: string
        payment_group_payment_account_id:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payment_status:
          minLength: 1
          type: string
        payoneer_payee_id:
          minimum: 0
          type: integer
        payoneer_program_id:
          minimum: 0
          type: integer
        percent_difference:
          type: number
        prior_payment_group_payment_id:
          minimum: 0
          type: integer
        tax_withholding:
          nullable: true
          type: number
        vat_amount:
          nullable: true
          type: number
      required:
      - account_id
      - balance_after_tax
      - contracts_payable
      - currency_code
      - current_balance
      - current_statement_period_id
      - last_payment
      - payment_group_payment_account_id
      - payment_group_payment_id
      - payoneer_program_id
      type: object
    PaymentGroupPaymentAccountListItems:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentGroupPaymentAccountList'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    PaymentGroupPaymentAccountListResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentGroupPaymentAccount1'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    PaymentGroupPaymentAccountPut:
      additionalProperties: false
      properties:
        note:
          minLength: 1
          type: string
      required:
      - note
      type: object
    PaymentGroupPaymentBatch:
      additionalProperties: false
      properties:
        batch_num:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payoneer_program_id:
          minimum: 0
          type: integer
      required:
      - batch_num
      - payment_group_payment_id
      - payoneer_program_id
      type: object
    PaymentGroupPaymentBatch1:
      additionalProperties: false
      properties:
        batch_num:
          minimum: 0
          type: integer
        payment_group_payment_batch_id:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payoneer_program_id:
          minimum: 0
          type: integer
      required:
      - batch_num
      - payment_group_payment_batch_id
      - payment_group_payment_id
      - payoneer_program_id
      type: object
    PaymentGroupPaymentBatchAccount:
      additionalProperties: false
      properties:
        payment_group_payment_account_id:
          minimum: 0
          type: integer
        payment_group_payment_batch_id:
          minimum: 0
          type: integer
      required:
      - payment_group_payment_account_id
      - payment_group_payment_batch_id
      type: object
    PaymentGroupPaymentBatchAccount1:
      additionalProperties: false
      properties:
        payment_group_payment_account_id:
          minimum: 0
          type: integer
        payment_group_payment_batch_account_id:
          minimum: 0
          type: integer
        payment_group_payment_batch_id:
          minimum: 0
          type: integer
      required:
      - payment_group_payment_account_id
      - payment_group_payment_batch_account_id
      - payment_group_payment_batch_id
      type: object
    PaymentGroupPaymentBatchStatus:
      additionalProperties: false
      properties:
        abacus_state_id:
          minimum: 0
          type: integer
        action_status:
          type: string
        batch_num:
          minimum: 0
          type: integer
        error_message:
          type: string
        payment_group_payment_batch_id:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payoneer_program_id:
          minimum: 0
          type: integer
      required:
      - abacus_state_id
      - action_status
      - batch_num
      - payment_group_payment_batch_id
      - payment_group_payment_id
      - payoneer_program_id
      type: object
    PaymentGroupPaymentDetail:
      additionalProperties: false
      properties:
        payment_group_id:
          minimum: 0
          type: integer
        payment_name:
          minLength: 1
          type: string
      required:
      - payment_group_id
      - payment_name
      type: object
    PaymentGroupPaymentDetail1:
      additionalProperties: false
      properties:
        account_count:
          minimum: 0
          type: integer
        created_at:
          format: null
          pattern: null
          type: string
        payment_group_id:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payment_name:
          minLength: 1
          type: string
        statement_period_id:
          minimum: 0
          type: integer
      required:
      - account_count
      - payment_group_id
      - payment_group_payment_id
      - payment_name
      type: object
    PaymentGroupPaymentList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentGroupPaymentDetail1'
          type: array
        total_count:
          minimum: 0
          type: integer
      type: object
    PaymentGroupPaymentOverview:
      additionalProperties: false
      properties:
        account_count:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        currency_total:
          type: number
        payment_group_payment_id:
          minimum: 0
          type: integer
      type: object
    PaymentGroupPaymentOverviewDataloader:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/PaymentGroupPaymentOverview'
      type: object
    PaymentGroupPaymentOverviewDataloaderResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentGroupPaymentOverviewDataloader'
          type: array
      type: object
    PaymentGroupPaymentStatusOverview:
      additionalProperties: false
      properties:
        number_of_canceled_payments:
          minimum: 0
          type: integer
        number_of_failed_payments:
          minimum: 0
          type: integer
        number_of_payments_failed_with_batch:
          minimum: 0
          type: integer
        number_of_pending_payments:
          minimum: 0
          type: integer
        number_of_successful_payments:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
      required:
      - payment_group_payment_id
      type: object
    PaymentGroupPaymentStatusOverviewDataloader:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentGroupPaymentStatusOverviewDataloaderItem'
          type: array
      type: object
    PaymentGroupPaymentStatusOverviewDataloaderItem:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/PaymentGroupPaymentStatusOverview'
      type: object
    PaymentGroupPaymentTotals:
      additionalProperties: false
      properties:
        account_count:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        currency_total:
          type: number
        payment_entity_name:
          type: string
        payoneer_program_id:
          minimum: 0
          type: integer
      type: object
    PaymentGroupPost:
      additionalProperties: false
      properties:
        group_criteria:
          $ref: '#/components/schemas/PaymentGroupCriteria'
        group_name:
          minLength: 1
          type: string
        is_reusable:
          type: boolean
        payment_name:
          minLength: 1
          type: string
      required:
      - group_name
      type: object
    PaymentGroupPostResponse:
      additionalProperties: false
      properties:
        account_count:
          minimum: 0
          type: integer
        created_at:
          format: null
          pattern: null
          type: string
        group_criteria:
          $ref: '#/components/schemas/PaymentGroupCriteria1'
        group_name:
          minLength: 1
          type: string
        is_reusable:
          type: boolean
        payment_group_id:
          minimum: 0
          type: integer
        payment_group_payment_id:
          minimum: 0
          type: integer
        payment_name:
          minLength: 1
          type: string
        statement_period_id:
          minimum: 0
          type: integer
      required:
      - account_count
      - group_name
      - payment_group_id
      - payment_group_payment_id
      - payment_name
      type: object
    PaymentGroupPut:
      additionalProperties: false
      properties:
        group_name:
          minLength: 1
          type: string
        is_reusable:
          enum:
          - false
          type: boolean
      type: object
    PaymentMinimum:
      additionalProperties: false
      properties:
        check_amount:
          type: number
        currency_code:
          minLength: 1
          type: string
        currency_name:
          minLength: 1
          type: string
        payment_minimum_id:
          minimum: 0
          type: integer
        western_union_amount:
          nullable: true
          type: number
        wire_transfer_amount:
          type: number
      required:
      - check_amount
      - currency_code
      - payment_minimum_id
      - wire_transfer_amount
      type: object
    PaymentMinimumList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentMinimum'
          type: array
        total_count:
          type: integer
      type: object
    PaymentMinimumPut:
      additionalProperties: false
      properties:
        check_amount:
          type: number
        payment_minimum_id:
          minimum: 0
          type: integer
        western_union_amount:
          nullable: true
          type: number
        wire_transfer_amount:
          type: number
      required:
      - payment_minimum_id
      type: object
    PaymentSearchFilterKey:
      additionalProperties: false
      properties:
        account:
          type: string
        contract:
          type: string
        payment_created_date_from:
          format: null
          pattern: null
          type: string
        payment_created_date_to:
          format: null
          pattern: null
          type: string
        payment_release_date_from:
          format: null
          pattern: null
          type: string
        payment_release_date_to:
          format: null
          pattern: null
          type: string
        payment_statuses:
          items:
            enum:
            - pending_acceptance
            - accepted
            - failure
            - successful
            - cancelled
            - not_paid
            type: string
          type: array
        payment_types:
          items:
            enum:
            - balance_payment
            - advance_payment
            - custom_payment
            type: string
          type: array
      type: object
    PaymentSearchFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          $ref: '#/components/schemas/PaymentSearchFilterKey'
      required:
      - filters
      type: object
    PaymentSearchItem:
      additionalProperties: false
      properties:
        _id:
          type: string
        account_id:
          type: integer
        account_name:
          type: string
        contract_id:
          type: integer
        contract_name:
          type: string
        currency:
          type: string
        error_message:
          nullable: true
          type: string
        payment_created_date:
          format: null
          nullable: true
          pattern: null
          type: string
        payment_id:
          type: integer
        payment_name:
          type: string
        payment_release_date:
          format: null
          nullable: true
          pattern: null
          type: string
        payment_status:
          type: string
        payment_type:
          type: string
        post_tax_amount:
          type: number
        pre_tax_amount:
          type: number
        sent_statement_period_id:
          nullable: true
          type: integer
        sent_statement_period_name:
          nullable: true
          type: string
        statement_period_id:
          type: integer
        statement_period_name:
          type: string
      required:
      - account_id
      - account_name
      - contract_id
      - contract_name
      - currency
      - payment_id
      - payment_name
      - payment_status
      - payment_type
      - statement_period_id
      - statement_period_name
      type: object
    PaymentSearchList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentSearchItem'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    ReferencePaymentType:
      additionalProperties: false
      properties:
        is_internal:
          type: boolean
        notes:
          nullable: true
          type: string
        payment_service:
          minLength: 1
          type: string
        payment_type:
          minLength: 1
          type: string
        reference_payment_type_id:
          minimum: 0
          type: integer
      required:
      - is_internal
      - payment_service
      - payment_type
      type: object
    ReferencePaymentTypeDataloader:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/ReferencePaymentTypeDataloaderItem'
          type: array
      type: object
    ReferencePaymentTypeDataloaderItem:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/ReferencePaymentType'
      type: object
    ReferenceTaxWithholdingDetail:
      additionalProperties: false
      properties:
        country_of_tax_residence:
          type: string
        country_of_withholding:
          type: string
        is_resource_provisioned:
          nullable: true
          type: boolean
        reference_tax_withholding_id:
          minimum: 0
          type: integer
        tax_rate:
          type: number
      type: object
    ReferenceTaxWithholdingList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/ReferenceTaxWithholdingDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      type: object
    ReportPaymentDetail:
      additionalProperties: false
      properties:
        created_at:
          format: null
          pattern: null
          type: string
        created_by:
          type: string
        last_modified:
          format: null
          pattern: null
          type: string
        last_modified_by:
          type: string
        original_filename:
          nullable: true
          type: string
        report_export_url:
          minLength: 1
          type: string
        report_payment_id:
          minimum: 0
          type: integer
        report_type:
          enum:
          - approval
          - summary
          type: string
        target_id:
          minimum: 0
          type: integer
        target_type:
          maxLength: 64
          minLength: 1
          type: string
      required:
      - created_at
      - created_by
      - last_modified
      - last_modified_by
      - report_export_url
      - report_payment_id
      - report_type
      - target_id
      - target_type
      type: object
    ReportPaymentDownload:
      additionalProperties: false
      properties:
        download_url:
          minLength: 1
          type: string
      required:
      - download_url
      type: object
    ReportPaymentGroupPaymentDetail:
      additionalProperties: false
      properties:
        original_filename:
          nullable: true
          type: string
        payment_group_payment_id:
          minimum: 0
          type: integer
        report_export_url:
          minLength: 1
          type: string
        report_payment_group_payment_id:
          minimum: 0
          type: integer
        report_type:
          enum:
          - approval
          - summary
          type: string
      required:
      - payment_group_payment_id
      - report_export_url
      - report_payment_group_payment_id
      - report_type
      type: object
    ReportPaymentGroupPaymentDownload:
      additionalProperties: false
      properties:
        download_url:
          minLength: 1
          type: string
      required:
      - download_url
      type: object
    ReportPaymentGroupPaymentPut:
      additionalProperties: false
      properties:
        report_export_url:
          minLength: 1
          type: string
        report_type:
          enum:
          - approval
          - summary
          type: string
      required:
      - report_export_url
      - report_type
      type: object
    ReportPaymentPut:
      additionalProperties: false
      properties:
        report_export_url:
          minLength: 1
          type: string
        report_type:
          enum:
          - approval
          - summary
          type: string
      required:
      - report_export_url
      - report_type
      type: object
    TaxCorrectionDeleteRequest:
      additionalProperties: false
      properties:
        worksheet_tax_correction_ids:
          items:
            minimum: 0
            type: integer
          type: array
      required:
      - worksheet_tax_correction_ids
      type: object
    TaxableRevenueCatchupFilterKey:
      additionalProperties: false
      properties:
        account_ids:
          items:
            minimum: 0
            type: integer
          type: array
      type: object
    TaxableRevenueCatchupFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          allOf:
          - $ref: '#/components/schemas/TaxableRevenueCatchupFilterKey'
          default: {}
      type: object
    WorksheetAccountContractClosingBalance:
      additionalProperties: false
      properties:
        abacus_event_id:
          minimum: 0
          type: integer
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        includes_tax_adjustments:
          type: boolean
        ledger_account_contract_id:
          minimum: 0
          type: integer
        reference_payment_entity_id:
          minimum: 0
          type: integer
        statement_period_id:
          minimum: 0
          type: integer
        worksheet_account_contract_closing_balance_id:
          minimum: 0
          type: integer
      required:
      - abacus_event_id
      - account_id
      - amount
      - contract_id
      - currency_code
      - includes_tax_adjustments
      - ledger_account_contract_id
      - reference_payment_entity_id
      - statement_period_id
      - worksheet_account_contract_closing_balance_id
      type: object
    WorksheetAccountContractClosingBalanceBulkFilterKey:
      additionalProperties: false
      properties:
        worksheet_closing_balance_ids:
          items:
            minimum: 1
            type: integer
          maxItems: 300
          minItems: 1
          type: array
      type: object
    WorksheetAccountContractClosingBalanceBulkFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          $ref: '#/components/schemas/WorksheetAccountContractClosingBalanceBulkFilterKey'
      type: object
    WorksheetAccountContractClosingBalanceDataloader:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetAccountContractClosingBalanceDataloaderItem'
          type: array
      type: object
    WorksheetAccountContractClosingBalanceDataloaderItem:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/WorksheetAccountContractClosingBalance'
      type: object
    WorksheetAccountContractClosingBalanceInput:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        includes_tax_adjustments:
          type: boolean
        ledger_account_contract_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount
      - contract_id
      - currency_code
      - includes_tax_adjustments
      - ledger_account_contract_id
      type: object
    WorksheetAccountContractPayableDetailsBulkDelete:
      additionalProperties: false
      properties:
        worksheet_account_contract_payable_after_tax_ids:
          items:
            minimum: 0
            type: integer
          minItems: 1
          type: array
      required:
      - worksheet_account_contract_payable_after_tax_ids
      type: object
    WorksheetAccountContractPayableDetailsCreate:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount_payable:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency:
          minLength: 1
          type: string
        notes:
          nullable: true
          type: string
        payable_detail_type_id:
          minimum: 0
          nullable: true
          type: integer
        reference_target_id:
          minimum: 0
          nullable: true
          type: integer
        reference_target_table:
          nullable: true
          type: string
        target_id:
          minimum: 0
          type: integer
        target_table:
          minLength: 1
          type: string
        worksheet_account_contract_payable_after_tax_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount_payable
      - contract_id
      - currency
      - target_id
      - target_table
      - worksheet_account_contract_payable_after_tax_id
      type: object
    WorksheetAccountContractPayableDetailsDetail:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount_payable:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency:
          minLength: 1
          type: string
        notes:
          nullable: true
          type: string
        payable_detail_type_id:
          minimum: 0
          nullable: true
          type: integer
        reference_target_id:
          minimum: 0
          nullable: true
          type: integer
        reference_target_table:
          nullable: true
          type: string
        statement_period_id:
          minimum: 0
          type: integer
        target_id:
          minimum: 0
          type: integer
        target_table:
          minLength: 1
          type: string
        worksheet_account_contract_payable_after_tax_id:
          minimum: 0
          type: integer
        worksheet_account_contract_payable_details_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount_payable
      - contract_id
      - currency
      - statement_period_id
      - target_id
      - target_table
      - worksheet_account_contract_payable_after_tax_id
      - worksheet_account_contract_payable_details_id
      type: object
    WorksheetAccountContractTaxableRevenueCreate:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        is_us_revenue:
          type: boolean
        reference_payment_entity_id:
          minimum: 0
          type: integer
        revenue_transaction_type:
          enum:
          - digital
          - physical
          - closing_balance
          type: string
        statement_period_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount
      - contract_id
      - currency_code
      - is_us_revenue
      - reference_payment_entity_id
      - revenue_transaction_type
      - statement_period_id
      type: object
    WorksheetAccountContractTaxableRevenueDetail:
      additionalProperties: false
      properties:
        account_contract_taxable_revenue_id:
          minimum: 0
          type: integer
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        is_us_revenue:
          type: boolean
        reference_payment_entity_id:
          minimum: 0
          type: integer
        revenue_transaction_type:
          enum:
          - digital
          - physical
          - closing_balance
          type: string
        statement_period_id:
          minimum: 0
          type: integer
        worksheet_account_contract_closing_balance_id:
          minimum: 0
          type: integer
      required:
      - account_contract_taxable_revenue_id
      - account_id
      - amount
      - contract_id
      - currency_code
      - is_us_revenue
      - reference_payment_entity_id
      - revenue_transaction_type
      - statement_period_id
      - worksheet_account_contract_closing_balance_id
      type: object
    WorksheetAccountContractTaxableRevenueFilterKey:
      additionalProperties: false
      properties:
        closing_balance_ids:
          items:
            minimum: 0
            type: integer
          type: array
        contract_ids:
          items:
            minimum: 0
            type: integer
          type: array
      type: object
    WorksheetAccountContractTaxableRevenueFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          allOf:
          - $ref: '#/components/schemas/WorksheetAccountContractTaxableRevenueFilterKey'
          default: {}
      type: object
    WorksheetAccountContractTaxableRevenueList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetAccountContractTaxableRevenueDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    WorksheetPayableBalanceAfterTax:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        contract_id:
          minimum: 0
          type: integer
        country_of_tax_policy:
          minLength: 1
          type: string
        country_of_tax_residence:
          minLength: 1
          type: string
        currency_code:
          minLength: 1
          type: string
        payable_amount_post_tax:
          type: number
        payable_amount_pre_tax:
          type: number
        tax_withholding_amount:
          nullable: true
          type: number
        vat_amount:
          nullable: true
          type: number
        worksheet_account_contract_closing_balance_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - contract_id
      - country_of_tax_residence
      - currency_code
      - payable_amount_post_tax
      - payable_amount_pre_tax
      - worksheet_account_contract_closing_balance_id
      type: object
    WorksheetPayableBalanceAfterTaxBulkUpdate:
      additionalProperties: false
      properties:
        payable_amount_post_tax:
          type: number
        tax_withholding_amount:
          nullable: true
          type: number
        vat_amount:
          nullable: true
          type: number
        worksheet_account_contract_payable_after_tax_id:
          minimum: 0
          type: integer
      required:
      - payable_amount_post_tax
      - worksheet_account_contract_payable_after_tax_id
      type: object
    WorksheetPayableBalanceAfterTaxDetail:
      additionalProperties: false
      properties:
        abacus_event_id:
          minimum: 0
          type: integer
        account_id:
          minimum: 0
          type: integer
        contract_id:
          minimum: 0
          type: integer
        country_of_tax_policy:
          minLength: 1
          type: string
        country_of_tax_residence:
          minLength: 1
          type: string
        currency_code:
          minLength: 1
          type: string
        payable_amount_post_tax:
          type: number
        payable_amount_pre_tax:
          type: number
        statement_period_id:
          minimum: 0
          type: integer
        tax_withholding_amount:
          nullable: true
          type: number
        vat_amount:
          nullable: true
          type: number
        worksheet_account_contract_closing_balance_id:
          minimum: 0
          type: integer
        worksheet_account_contract_payable_after_tax_id:
          minimum: 0
          type: integer
      required:
      - abacus_event_id
      - account_id
      - contract_id
      - country_of_tax_residence
      - currency_code
      - payable_amount_post_tax
      - payable_amount_pre_tax
      - statement_period_id
      - worksheet_account_contract_closing_balance_id
      - worksheet_account_contract_payable_after_tax_id
      type: object
    WorksheetPayableBalanceAfterTaxList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    WorksheetPayableBalanceAfterTaxOverview:
      additionalProperties: false
      properties:
        payable_amount_post_tax:
          type: number
        payable_amount_pre_tax:
          type: number
        tax_withholding_amount:
          type: number
        vat_amount:
          type: number
      required:
      - payable_amount_post_tax
      - payable_amount_pre_tax
      - tax_withholding_amount
      - vat_amount
      type: object
    WorksheetPaymentContractAdvanceDataloaderItem:
      additionalProperties: false
      properties:
        data:
          anyOf:
          - nullable: true
            type: object
          - $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDetail'
      type: object
    WorksheetPaymentContractAdvanceDataloaderResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDataloaderItem'
          type: array
      type: object
    WorksheetPaymentContractAdvanceDetail:
      additionalProperties: false
      properties:
        amount:
          type: number
        amount_after_withholding_and_vat:
          type: number
        amount_after_withholding_and_vat_payee_currency:
          type: number
        amount_payee_currency:
          type: number
        contract_advance_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        exchange_rate:
          type: number
        exchange_rate_statement_period_id:
          minimum: 0
          type: integer
        is_internal:
          type: boolean
        payee_currency_code:
          minLength: 1
          type: string
        payment_name:
          minLength: 1
          type: string
        salesforce_id:
          minLength: 1
          type: string
        statement_period_id:
          minimum: 0
          type: integer
        us_source_income_rate:
          type: number
        vat_amount:
          type: number
        vat_amount_payee_currency:
          type: number
        withholding_tax_amount:
          type: number
        withholding_tax_amount_payee_currency:
          type: number
        worksheet_payment_contract_advance_id:
          minimum: 0
          type: integer
      required:
      - amount
      - amount_after_withholding_and_vat
      - amount_after_withholding_and_vat_payee_currency
      - amount_payee_currency
      - contract_advance_id
      - currency_code
      - exchange_rate
      - exchange_rate_statement_period_id
      - is_internal
      - payee_currency_code
      - payment_name
      - salesforce_id
      - statement_period_id
      - us_source_income_rate
      - vat_amount
      - vat_amount_payee_currency
      - withholding_tax_amount
      - withholding_tax_amount_payee_currency
      - worksheet_payment_contract_advance_id
      type: object
    WorksheetPaymentContractAdvanceList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDetail'
          type: array
        total_count:
          type: integer
      type: object
    WorksheetPaymentContractAdvancePost:
      additionalProperties: false
      properties:
        amount:
          type: number
        amount_after_withholding_and_vat:
          minimum: '0'
          type: number
        currency_code:
          minLength: 1
          type: string
        exchange_rate_id:
          minimum: 0
          nullable: true
          type: integer
        is_internal:
          type: boolean
        payee_currency_code:
          minLength: 1
          type: string
        payment_name:
          minLength: 1
          type: string
        statement_period_id:
          minimum: 0
          type: integer
        us_source_income_rate:
          maximum: '100'
          minimum: '0'
          nullable: true
          type: number
        vat_amount:
          minimum: '0'
          type: number
        withholding_tax_amount:
          maximum: '0'
          type: number
      required:
      - amount
      - amount_after_withholding_and_vat
      - currency_code
      - is_internal
      - payee_currency_code
      - payment_name
      - statement_period_id
      - vat_amount
      - withholding_tax_amount
      type: object
    WorksheetPaymentContractAdvancePut:
      additionalProperties: false
      properties:
        salesforce_id:
          nullable: true
          type: string
      required:
      - salesforce_id
      type: object
    WorksheetPaymentCustomDetail:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        activity_statement_period_id:
          minimum: 0
          type: integer
        amount:
          type: number
        amount_after_withholding_and_vat:
          type: number
        contract_id:
          minimum: 0
          type: integer
        created_at:
          format: null
          pattern: null
          type: string
        created_by:
          type: string
        currency_code:
          minLength: 1
          type: string
        last_modified:
          format: null
          pattern: null
          type: string
        last_modified_by:
          type: string
        payment_name:
          minLength: 1
          type: string
        statement_period_id:
          minimum: 0
          type: integer
        vat_amount:
          nullable: true
          type: number
        vat_rate:
          minimum: '0'
          nullable: true
          type: number
        withholding_tax_amount:
          nullable: true
          type: number
        withholding_tax_rate:
          minimum: '0'
          nullable: true
          type: number
        worksheet_payment_custom_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - activity_statement_period_id
      - amount
      - amount_after_withholding_and_vat
      - contract_id
      - created_at
      - created_by
      - currency_code
      - last_modified
      - last_modified_by
      - payment_name
      - statement_period_id
      - worksheet_payment_custom_id
      type: object
    WorksheetPaymentCustomFilterKey:
      additionalProperties: false
      properties:
        worksheet_payment_custom_ids:
          items:
            minimum: 0
            type: integer
          type: array
      type: object
    WorksheetPaymentCustomFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          allOf:
          - $ref: '#/components/schemas/WorksheetPaymentCustomFilterKey'
          default: {}
      type: object
    WorksheetPaymentCustomList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetPaymentCustomDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    WorksheetPaymentCustomPost:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        activity_statement_period_id:
          minimum: 0
          type: integer
        amount:
          minimum: '0'
          type: number
        amount_after_withholding_and_vat:
          minimum: '0'
          type: number
        contract_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        payment_name:
          minLength: 1
          type: string
        statement_period_id:
          minimum: 0
          type: integer
        vat_amount:
          default: '0'
          type: number
        vat_rate:
          default: '0'
          minimum: '0'
          type: number
        withholding_tax_amount:
          default: '0'
          type: number
        withholding_tax_rate:
          default: '0'
          minimum: '0'
          type: number
      required:
      - account_id
      - activity_statement_period_id
      - amount
      - amount_after_withholding_and_vat
      - contract_id
      - currency_code
      - payment_name
      - statement_period_id
      type: object
    WorksheetTaxCorrectionCreate:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        correction_statement_period_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        note:
          nullable: true
          type: string
        payable_detail_type_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount
      - contract_id
      - correction_statement_period_id
      - currency_code
      - payable_detail_type_id
      type: object
    WorksheetTaxCorrectionDetail:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        amount:
          type: number
        contract_id:
          minimum: 0
          type: integer
        correction_statement_period_id:
          minimum: 0
          type: integer
        currency_code:
          minLength: 1
          type: string
        note:
          nullable: true
          type: string
        payable_detail_type_id:
          minimum: 0
          type: integer
        worksheet_tax_correction_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - amount
      - contract_id
      - correction_statement_period_id
      - currency_code
      - payable_detail_type_id
      - worksheet_tax_correction_id
      type: object
    WorksheetTaxCorrectionVATCreate:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        base_amount_payee_currency:
          type: number
        contract_id:
          minimum: 0
          type: integer
        correction_statement_period_id:
          minimum: 0
          type: integer
        net_amount_payee_currency:
          type: number
        note:
          nullable: true
          type: string
        payable_detail_type_id:
          minimum: 0
          type: integer
        payee_currency_code:
          minLength: 1
          type: string
        vat_amount_payee_currency:
          type: number
        vat_amount_vat_currency:
          type: number
        vat_category:
          enum:
          - distribution_fee
          - gross_revenue
          - closing_balance
          - commission
          type: string
        vat_currency_code:
          minLength: 1
          type: string
        vat_rate:
          type: number
        wht_amount_payee_currency:
          nullable: true
          type: number
        wht_amount_vat_currency:
          nullable: true
          type: number
        wht_rate:
          nullable: true
          type: number
      required:
      - account_id
      - base_amount_payee_currency
      - contract_id
      - correction_statement_period_id
      - net_amount_payee_currency
      - payable_detail_type_id
      - payee_currency_code
      - vat_amount_payee_currency
      - vat_amount_vat_currency
      - vat_currency_code
      - vat_rate
      type: object
    WorksheetTaxCorrectionVATDetail:
      additionalProperties: false
      properties:
        account_id:
          minimum: 0
          type: integer
        base_amount_payee_currency:
          type: number
        contract_id:
          minimum: 0
          type: integer
        correction_statement_period_id:
          minimum: 0
          type: integer
        net_amount_payee_currency:
          type: number
        note:
          nullable: true
          type: string
        payable_detail_type_id:
          minimum: 0
          type: integer
        payee_currency_code:
          minLength: 1
          type: string
        vat_amount_payee_currency:
          type: number
        vat_amount_vat_currency:
          type: number
        vat_category:
          enum:
          - distribution_fee
          - gross_revenue
          - closing_balance
          - commission
          type: string
        vat_currency_code:
          minLength: 1
          type: string
        vat_rate:
          type: number
        wht_amount_payee_currency:
          nullable: true
          type: number
        wht_amount_vat_currency:
          nullable: true
          type: number
        wht_rate:
          nullable: true
          type: number
        worksheet_tax_correction_vat_id:
          minimum: 0
          type: integer
      required:
      - account_id
      - base_amount_payee_currency
      - contract_id
      - correction_statement_period_id
      - net_amount_payee_currency
      - payable_detail_type_id
      - payee_currency_code
      - vat_amount_payee_currency
      - vat_amount_vat_currency
      - vat_currency_code
      - vat_rate
      - worksheet_tax_correction_vat_id
      type: object
    WorksheetTaxCorrectionsFilterKey:
      additionalProperties: false
      properties:
        contract_ids:
          items:
            minimum: 0
            type: integer
          type: array
        correction_statement_period_id:
          minimum: 0
          type: integer
      type: object
    WorksheetTaxCorrectionsFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          allOf:
          - $ref: '#/components/schemas/WorksheetTaxCorrectionsFilterKey'
          default: {}
      type: object
    WorksheetTaxCorrectionsList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetTaxCorrectionDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
    WorksheetTaxCorrectionsVATDelete:
      additionalProperties: false
      properties:
        worksheet_tax_correction_vat_ids:
          items:
            minimum: 0
            type: integer
          type: array
      required:
      - worksheet_tax_correction_vat_ids
      type: object
    WorksheetTaxCorrectionsVATFilterKey:
      additionalProperties: false
      properties:
        contract_ids:
          items:
            minimum: 0
            type: integer
          type: array
        correction_statement_period_id:
          minimum: 0
          type: integer
        worksheet_tax_correction_vat_ids:
          items:
            minimum: 0
            type: integer
          type: array
      type: object
    WorksheetTaxCorrectionsVATFilterParamsPost:
      additionalProperties: false
      properties:
        filters:
          allOf:
          - $ref: '#/components/schemas/WorksheetTaxCorrectionsVATFilterKey'
          default: {}
      type: object
    WorksheetTaxCorrectionsVATList:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorksheetTaxCorrectionVATDetail'
          type: array
        total_count:
          minimum: 0
          type: integer
      required:
      - total_count
      type: object
info:
  title: ows-payment API Specifications
  version: 1.0.0
openapi: 3.0.0
paths:
  /hello/:
    get:
      description: Check the health of the application.
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: OK
  /payment-allocations/flowthrough:
    delete:
      description: Bulk delete payment allocation flowthrough max (300) items at once.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentAllocationFlowthroughBulkDelete'
        required: false
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - payment allocation
    put:
      description: Bulk update payment allocation flowthrough max (300) items at once.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/PaymentAllocationFlowthroughBulkUpdate'
              type: array
        required: false
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: OK
      tags:
      - payment allocation
  /payment-allocations/flowthrough/bulk:
    post:
      description: Bulk retrieval of flowthrough payment allocations.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentAllocationFlowthroughBulkRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAllocationFlowthroughList'
          description: OK
      tags:
      - Payment Allocation
  /payment-group-payment-account/last-payment/bulk:
    post:
      description: Get list of last payment group payments by account_ids and payment_statuses.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LastPaymentBulkFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccountListResponse'
          description: OK
      tags:
      - payment group payment account
  /payment-group-payment-account/last-payment/{account_id}:
    get:
      deprecated: true
      description: This endpoint is deprecated and will be removed. Please use POST::/last-payment/bulk
        instead.
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccount1'
          description: OK
  /payment-group-payment-account/payable-details/bulk:
    post:
      description: Get worksheet account contract payable details by payment_group_payment_account_ids.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayableDetailsBulkFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWorksheetAccountContractPayableDetailsOutput'
          description: OK
      tags:
      - payment group payment account
  /payment-group-payment-account/pending-payment/{account_id}:
    get:
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccount1'
          description: OK
  /payment-group-payment-account/search:
    post:
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGroupPaymentAccountFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccountListResponse'
          description: OK
  /payment-group-payment-account/{object_id}/:
    delete:
      description: Delete payment group payment account.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
      tags:
      - payment group payment account
    get:
      description: Get payment group payment account.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccount1'
          description: OK
      tags:
      - payment group payment account
    put:
      description: Update payment group payment account.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGroupPaymentAccountPut'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccount1'
          description: Created
      tags:
      - payment group payment account
  /payment-group-payment-account/{payment_group_payment_account_id}/{payment_type}/credit:
    get:
      description: Get credit data for payment group payment account for "wht", "vat"
        or "payment" payment_type.
      parameters:
      - in: path
        name: payment_group_payment_account_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: payment_type
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentDebitCreditDataEntry'
                type: array
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - payment group payment account
  /payment-group-payment-batch-account/bulk/:
    post:
      description: Bulk create payment group payment batch account records.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/PaymentGroupPaymentBatchAccount'
              type: array
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentGroupPaymentBatchAccount1'
                type: array
          description: Created
      tags:
      - payment group payment batch account
  /payment-group-payment-batch/:
    post:
      description: Create payment group payment batch.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGroupPaymentBatch'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentBatch1'
          description: Created
      tags:
      - payment group payment batch
  /payment-group-payment-batch/{batch_id}:
    get:
      description: Get payment group payment batch by id
      parameters:
      - in: path
        name: batch_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentBatch1'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - payment group payment batch
  /payment-group-payment-batch/{batch_id}/{payment_type}/debit:
    get:
      description: Get debit data for payment group payment batch for "wht" or "payment"
        payment_type.
      parameters:
      - in: path
        name: batch_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: payment_type
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentDebitCreditDataEntry'
                type: array
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - payment group payment batch
  /payment-group-payment/:
    get:
      description: Get payment group payments list.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentList'
          description: OK
      tags:
      - Payment Group Payment
    post:
      description: Create payment group payment.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGroupPaymentDetail'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentDetail1'
          description: Created
      tags:
      - Payment Group Payment
  /payment-group-payment/overview/dataloader:
    post:
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataloaderParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentOverviewDataloaderResponse'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
  /payment-group-payment/payment-status-overview/dataloader:
    post:
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataloaderParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentStatusOverviewDataloader'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
  /payment-group-payment/{object_id}/:
    delete:
      description: Delete payment group payment.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - Payment Group Payment
    get:
      description: Get payment group payment.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentDetail1'
          description: OK
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/accounts/:
    get:
      description: Get payment group payments accounts list.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 5000
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - in: query
        name: sort_by
        required: false
        schema:
          default: account_name
          type: string
      - in: query
        name: sort_order
        required: false
        schema:
          default: asc
          type: string
      - in: query
        name: search_term
        required: false
        schema:
          nullable: true
          type: string
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccountListItems'
          description: OK
      tags:
      - Payment Group Payment
    post:
      description: Get payment group payments list.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/PaymentGroupPaymentAccount'
              type: array
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentGroupPaymentAccount1'
                type: array
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/accounts/pending/:
    get:
      description: Get pending payment group payments accounts list.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 5000
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - in: query
        name: sort_by
        required: false
        schema:
          default: account_name
          type: string
      - in: query
        name: sort_order
        required: false
        schema:
          default: asc
          type: string
      - in: query
        name: search_term
        required: false
        schema:
          nullable: true
          type: string
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentAccountListItems'
          description: OK
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/irrevocable_revert:
    delete:
      description: Hard delete payment_group_payment related data for irrevocable
        revert to draft. This permanently deletes payment_group_payment_account_detail,
        payment_group_payment_account, and report_payment_group_payment records.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
        '403':
          content:
            application/json:
              schema: {}
          description: Forbidden
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/overview:
    get:
      description: Get total amounts and total number of accounts by currency_code.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentGroupPaymentOverview'
                type: array
          description: OK
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/payment-batches/:
    get:
      description: Returns all payment batches for a given payment_group_payment_id
        regardless of status.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentGroupPaymentBatchStatus'
                type: array
          description: OK
      summary: Get payment batches for a payment group payment.
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/payment-batches/{payment_batch_status}:
    get:
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: payment_batch_status
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentGroupPaymentBatchStatus'
                type: array
          description: OK
      summary: Get payment batches for a payment group payment filtered by status.
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/payment-status-overview/:
    get:
      description: Payment status overview for a specified payment_group_payment
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPaymentStatusOverview'
          description: OK
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/program-currency-totals:
    get:
      description: Get total amounts grouped by payoneer program id.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentGroupPaymentTotals'
                type: array
          description: OK
      tags:
      - Payment Group Payment
  /payment-group-payment/{payment_group_payment_id}/report:
    put:
      description: Create or update payment group payment report.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportPaymentGroupPaymentPut'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentGroupPaymentDetail'
          description: OK
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentGroupPaymentDetail'
          description: Created
      tags:
      - reports
  /payment-group-payment/{payment_group_payment_id}/reports:
    get:
      description: Get reports by payment group payment.
      parameters:
      - in: path
        name: payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ReportPaymentGroupPaymentDetail'
                type: array
          description: OK
      tags:
      - reports
  /payment-group/:
    post:
      description: Create payment_group.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGroupPost'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupPostResponse'
          description: Created
      tags:
      - Payment Group
  /payment-group/reusable-groups/:
    get:
      description: Get reusable payment groups.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupList'
          description: OK
      tags:
      - Payment Group
  /payment-group/{object_id}:
    get:
      description: Get payment_group.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupDetail'
          description: OK
      tags:
      - Payment Group
    put:
      description: Update payment_group.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGroupPut'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGroupDetail'
          description: OK
      tags:
      - Payment Group
  /payment-minimums:
    get:
      description: List all payment minimums.
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMinimumList'
          description: OK
      tags:
      - payment-minimums
    put:
      description: Bulk update payment minimums.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/PaymentMinimumPut'
              type: array
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PaymentMinimum'
                type: array
          description: Created
      tags:
      - payment-minimums
  /payment-minimums/by-currency/:
    get:
      description: Get all payment minimum amounts grouped by currency code.
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties:
                  properties:
                    check_amount:
                      type: string
                    western_union_amount:
                      type: string
                    wire_transfer_amount:
                      type: string
                  type: object
                type: object
          description: OK
      tags:
      - payment-minimums
  /payment-minimums/{currency_code}:
    get:
      description: Get payment minimum by currency code.
      parameters:
      - in: path
        name: currency_code
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMinimum'
          description: OK
      tags:
      - payment-minimums
  /payment-search/search:
    post:
      description: Search payments by filters via Cortex Search.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentSearchFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentSearchList'
          description: OK
      tags:
      - payment search
  /payment/advance/worksheet/dataloader:
    post:
      description: Dataloader for worksheet payment contract advances by IDs.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataloaderParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDataloaderResponse'
          description: OK
      tags:
      - Worksheet Payment Contract Advance
  /payment/advance/worksheet/{object_id}:
    delete:
      description: Delete worksheet payment contract advance.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - Worksheet Payment Contract Advance
    get:
      description: Get worksheet payment contract advance.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDetail'
          description: OK
      tags:
      - Worksheet Payment Contract Advance
    put:
      description: Update worksheet payment contract advance.
      parameters:
      - in: path
        name: object_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetPaymentContractAdvancePut'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDetail'
          description: Created
      tags:
      - Worksheet Payment Contract Advance
  /payment/advance/{contract_advance_id}:
    post:
      description: Create worksheet payment contract advance.
      parameters:
      - in: path
        name: contract_advance_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetPaymentContractAdvancePost'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentContractAdvanceDetail'
          description: Created
      tags:
      - Worksheet Payment Contract Advance
  /payment/custom:
    post:
      description: Create a new WorksheetPaymentCustom record.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetPaymentCustomPost'
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentCustomDetail'
          description: Created
      tags:
      - worksheet payment custom
  /payment/custom/{worksheet_payment_custom_id}:
    delete:
      description: Delete a WorksheetPaymentCustom record by ID.
      parameters:
      - in: path
        name: worksheet_payment_custom_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - worksheet payment custom
    get:
      description: Get a single WorksheetPaymentCustom record by ID.
      parameters:
      - in: path
        name: worksheet_payment_custom_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentCustomDetail'
          description: OK
      tags:
      - worksheet payment custom
  /payments/advances:
    get:
      description: List worksheet payment contract advances.
      parameters:
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          type: integer
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          type: integer
      - in: query
        name: salesforce_id
        required: false
        schema:
          default: null
          nullable: true
          type: string
      - in: query
        name: contract_advance_id
        required: false
        schema:
          default: null
          nullable: true
          type: integer
      - explode: true
        in: query
        name: payment_statuses
        required: false
        schema:
          default: []
          items:
            type: string
          type: array
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentContractAdvanceList'
          description: OK
      tags:
      - Worksheet Payment Contract Advance
  /payments/custom/bulk:
    post:
      description: Get a list of WorksheetPaymentCustom records.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetPaymentCustomFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPaymentCustomList'
          description: OK
      tags:
      - worksheet payment custom
  /reference-payment-type/dataloader:
    post:
      description: Dataloader for reference payment types
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataloaderParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferencePaymentTypeDataloader'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - reference payment type
  /reference-tax-withholding:
    get:
      description: List endpoint for reference_tax_withholding.
      parameters:
      - in: query
        name: country_of_withholding
        required: false
        schema:
          maxLength: 3
          minLength: 3
          type: string
      - in: query
        name: country_of_tax_residence
        required: false
        schema:
          maxLength: 3
          minLength: 3
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferenceTaxWithholdingList'
          description: OK
      tags:
      - tax withholding
  /report-payment-group-payment/{report_payment_group_payment_id}:
    delete:
      description: Delete payment group payment report by id.
      parameters:
      - in: path
        name: report_payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - reports
    get:
      description: Get payment group payment report by id.
      parameters:
      - in: path
        name: report_payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentGroupPaymentDetail'
          description: OK
      tags:
      - reports
  /report-payment-group-payment/{report_payment_group_payment_id}/download:
    get:
      description: Download payment group payment report.
      parameters:
      - in: path
        name: report_payment_group_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentGroupPaymentDownload'
          description: OK
      tags:
      - reports
  /report-payment/{report_payment_id}/:
    get:
      description: Get report by id.
      parameters:
      - in: path
        name: report_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentDetail'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - reports
  /report-payment/{report_payment_id}/download/:
    get:
      description: Download report by id.
      parameters:
      - in: path
        name: report_payment_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentDownload'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - reports
  /reports/{target_type}/{target_id}/:
    get:
      description: Get reports by target.
      parameters:
      - in: path
        name: target_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: target_type
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ReportPaymentDetail'
                type: array
          description: OK
      tags:
      - reports
    put:
      description: Create payment report entity.
      parameters:
      - in: path
        name: target_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: target_type
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportPaymentPut'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportPaymentDetail'
          description: OK
      tags:
      - reports
  /tax-corrections/bulk/:
    delete:
      description: Delete endpoint for worksheet_tax_corrections
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxCorrectionDeleteRequest'
        required: true
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - tax correction
    post:
      description: Bulk creation endpoint for worksheet_tax_correction.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetTaxCorrectionCreate'
              type: array
        required: true
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Created
      tags:
      - tax correction
  /tax-corrections/vat/bulk/:
    delete:
      description: Delete endpoint for worksheet_tax_correction_vat
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetTaxCorrectionsVATDelete'
        required: true
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - tax correction VAT
    post:
      description: Bulk creation endpoint for worksheet_tax_correction_vat.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetTaxCorrectionVATCreate'
              type: array
        required: true
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Created
      tags:
      - tax correction VAT
  /tax-corrections/vat/{correction_status}/:
    post:
      description: List endpoint for worksheet_tax_correction_vat.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - in: path
        name: correction_status
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetTaxCorrectionsVATFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetTaxCorrectionsVATList'
          description: OK
      tags:
      - tax correction VAT
  /tax-corrections/{correction_type}/{correction_status}/:
    post:
      description: List endpoint for worksheet_tax_correction.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - in: path
        name: correction_type
        required: true
        schema:
          type: string
      - in: path
        name: correction_status
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetTaxCorrectionsFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetTaxCorrectionsList'
          description: OK
      tags:
      - tax correction
  /worksheet-account-contract-closing-balance/bulk:
    post:
      description: Get list of Worksheet Account Contract Closing Balances by IDs.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetAccountContractClosingBalanceBulkFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWorksheetAccountContractClosingBalanceOutput'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - closing balance
  /worksheet-account-contract-closing-balance/by-payment-account-ids/dataloader:
    post:
      description: Dataloader for closing balances instances
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataloaderParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetAccountContractClosingBalanceDataloader'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - closing balance
  /worksheet-account-contract-closing-balance/event/{event_id}/bulk/:
    delete:
      description: Bulk delete worksheet_account_contract_closing_balance by event_id.
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - closing balance
  ? /worksheet-account-contract-closing-balance/event/{event_id}/statement-period/{statement_period_id}/payment-entity/{payment_entity_id}/bulk/
  : post:
      description: Bulk create worksheet_account_contract_closing_balance records.
      parameters:
      - in: path
        name: payment_entity_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetAccountContractClosingBalanceInput'
              type: array
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WorksheetAccountContractClosingBalance'
                type: array
          description: Created
      tags:
      - closing balance
  /worksheet-account-contract-closing-balance/event/{event_id}/taxable-revenue/copy/:
    post:
      description: Endpoint for bulk copy from close balance to taxable revenue.
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Created
      tags:
      - closing balance
  /worksheet-account-contract-closing-balance/statement-period/{statement_period_id}/:
    get:
      description: Get list of Worksheet Account Contract Closing Balances for a statement
        period
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - explode: false
        in: query
        name: account_ids
        required: false
        schema:
          default: ''
          example:
          - 1
          - 2
          items:
            minimum: 1
            type: integer
          maxItems: 300
          minItems: 0
          type: array
        style: form
      - explode: false
        in: query
        name: contract_ids
        required: false
        schema:
          default: ''
          example:
          - 1
          - 2
          items:
            minimum: 1
            type: integer
          maxItems: 300
          minItems: 0
          type: array
        style: form
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWorksheetAccountContractClosingBalanceOutput'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - closing balance
  /worksheet-account-contract-payable-details/bulk:
    delete:
      description: Bulk soft delete vat/wht correction rows of worksheet_account_contract_payable_details
        by worksheet_account_contract_payable_after_tax_id. Max (300) items at once.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetAccountContractPayableDetailsBulkDelete'
        required: false
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - payable details
  /worksheet-account-contract-payable-details/event/{event_id}/:
    delete:
      description: Delete Worksheet Account Contract Payable Details by event_id
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - payable details
  /worksheet-account-contract-payable-details/event/{event_id}/statement-period/{statement_period_id}/bulk/:
    post:
      description: Bulk create worksheet_account_contract_payable_details records.
      parameters:
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetAccountContractPayableDetailsCreate'
              type: array
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WorksheetAccountContractPayableDetailsCreate'
                type: array
          description: Created
      tags:
      - payable details
  /worksheet-account-contract-payable-details/statement-period/{statement_period_id}/:
    post:
      description: Get Worksheet Account Contract Payable Details by statement_period_id
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWorksheetAccountContractPayableDetailsOutput'
          description: OK
        '400':
          content:
            application/json:
              schema: {}
          description: Bad Request
      tags:
      - payable details
  /worksheet-account-contract-taxable-revenue/catchup:
    post:
      description: Catchup taxable revenue records starting from last payment statement
        period.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxableRevenueCatchupFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetAccountContractTaxableRevenueList'
          description: OK
      tags:
      - taxable revenue
  /worksheet-account-contract-taxable-revenue/event/{event_id}/:
    delete:
      description: Delete endpoint for worksheet_account_contract_taxable_revenue
        by event_id
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
      tags:
      - taxable revenue
  /worksheet-account-contract-taxable-revenue/event/{event_id}/bulk/:
    post:
      description: Bulk creation endpoint for worksheet_account_contract_taxable_revenue.
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetAccountContractTaxableRevenueCreate'
              type: array
        required: true
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Created
      tags:
      - taxable revenue
  /worksheet-account-contract-taxable-revenue/statement-period/{statement_period_id}/:
    post:
      description: Get worksheet_account_contract_taxable_revenue list by statement_period_id
        and filters.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksheetAccountContractTaxableRevenueFilterParamsPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetAccountContractTaxableRevenueList'
          description: OK
      tags:
      - taxable revenue
  /worksheet-payable-balance-after-tax/bulk:
    put:
      description: Bulk update worksheet_payable_balance_after_tax records by worksheet_account_contract_payable_after_tax_id.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxBulkUpdate'
              type: array
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxDetail'
                type: array
          description: OK
      tags:
      - worksheet payable balance after tax
  /worksheet-payable-balance-after-tax/event/{event_id}/:
    get:
      description: Get worksheet_payable_balance_after_tax data by event_id or statement_period_id.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - explode: true
        in: query
        name: contract_ids
        required: false
        schema:
          items:
            minimum: 0
            type: integer
          nullable: true
          type: array
        style: form
      - in: query
        name: sort_by
        required: false
        schema:
          nullable: true
          type: string
      - in: query
        name: sort_order
        required: false
        schema:
          default: asc
          nullable: true
          type: string
      - in: query
        name: search_term
        required: false
        schema:
          nullable: true
          type: string
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxList'
          description: OK
      tags:
      - worksheet payable balance after tax
  /worksheet-payable-balance-after-tax/event/{event_id}/bulk:
    delete:
      description: Bulk delete worksheet_payable_balance_after_tax by event_id.
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
      tags:
      - worksheet payable balance after tax
  /worksheet-payable-balance-after-tax/event/{event_id}/overview/:
    get:
      description: Get aggregated overview for worksheet_payable_balance_after_tax
        data by event_id.
      parameters:
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxOverview'
          description: OK
      tags:
      - worksheet payable balance after tax overview
  /worksheet-payable-balance-after-tax/event/{event_id}/statement-period/{statement_period_id}/bulk/:
    post:
      description: Insert one or more worksheet_payable_balance_after_tax records.
      parameters:
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      - in: path
        name: event_id
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/WorksheetPayableBalanceAfterTax'
              type: array
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
          description: Created
      tags:
      - worksheet payable balance after tax
  /worksheet-payable-balance-after-tax/statement-period/{statement_period_id}/:
    get:
      description: Get worksheet_payable_balance_after_tax data by event_id or statement_period_id.
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          maximum: 300
          minimum: 1
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          minimum: 0
          type: integer
      - explode: true
        in: query
        name: contract_ids
        required: false
        schema:
          items:
            minimum: 0
            type: integer
          nullable: true
          type: array
        style: form
      - in: query
        name: sort_by
        required: false
        schema:
          nullable: true
          type: string
      - in: query
        name: sort_order
        required: false
        schema:
          default: asc
          nullable: true
          type: string
      - in: query
        name: search_term
        required: false
        schema:
          nullable: true
          type: string
      - in: path
        name: statement_period_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxList'
          description: OK
      tags:
      - worksheet payable balance after tax
  /worksheet-payable-balance-after-tax/{worksheet_account_contract_payable_after_tax_id}/:
    delete:
      parameters:
      - in: path
        name: worksheet_account_contract_payable_after_tax_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '204':
          content:
            application/json:
              schema: {}
          description: No Content
    get:
      description: Get detail data for worksheet_payable_balance_after_tax.
      parameters:
      - in: path
        name: worksheet_account_contract_payable_after_tax_id
        required: true
        schema:
          format: int32
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetPayableBalanceAfterTaxDetail'
          description: OK
      tags:
      - worksheet payable balance after tax detail
servers:
- description: QA server
  url: https://qa-ows-payment.theorchard.io
- description: Local server
  url: http://0.0.0.0:5000/
