{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/monite/json-schema/monite-accounting-receivable-schema.json",
  "title": "AccountingReceivable",
  "description": "Invoice details retrieved from an accounting system.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monite-accounting-data-pull-api-openapi.yml#/components/schemas/AccountingReceivable",
  "properties": {
    "id": {
      "type": "string",
      "description": "An internal identifier of the invoice in the accounting system."
    },
    "currency": {
      "type": "string",
      "description": "ISO-4217 currency code of the invoice."
    },
    "currency_rate": {
      "type": "number",
      "description": "Rate to convert the total amount of the transaction into the entity's base currency at the time of the transaction."
    },
    "customer_ref": {
      "allOf": [
        {
          "$ref": "#/$defs/AccountingCustomerRefObject"
        }
      ],
      "description": "Information about the customer that the invoice was sent to."
    },
    "due_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "string",
          "format": "date"
        }
      ],
      "description": "Invoice due date."
    },
    "invoice_number": {
      "type": "string",
      "description": "Invoice document number."
    },
    "lines": {
      "items": {
        "$ref": "#/$defs/AccountingLineItem"
      },
      "type": "array"
    },
    "memo": {
      "type": "string",
      "description": "Any additional information or business notes about the invoice."
    },
    "pass_through": {
      "type": "object",
      "description": "An object containing additional invoice data returned by the accounting system. This sometimes includes custom invoice fields."
    },
    "posted_date": {
      "type": "string",
      "format": "date",
      "description": "Date when the invoice was added to the accounting service. This may differ from the invoice creation date."
    }
  },
  "type": "object",
  "$defs": {
    "AccountingCustomerRefObject": {
      "properties": {
        "id": {
          "type": "string",
          "description": "A unique identifier of the customer in the accounting system."
        },
        "company_name": {
          "type": "string",
          "description": "Customer name in the accounting system."
        }
      },
      "type": "object",
      "required": [
        "id"
      ]
    },
    "AccountingLineItem": {
      "properties": {
        "description": {
          "type": "string",
          "description": "The name or description of the product or service being invoiced."
        },
        "discount_amount": {
          "type": "number",
          "description": "Discount amount for this line item (if any)."
        },
        "discount_percentage": {
          "type": "number",
          "description": "Discount percentage for this line item (if any)."
        },
        "ledger_account_id": {
          "type": "string",
          "description": "ID of the ledger account associated with this line item. You can use `GET /ledger_accounts/{ledger_account_id}` to get further details about this ledger account."
        },
        "quantity": {
          "type": "number",
          "description": "The quantity of the product or service."
        },
        "tax_rate_ref": {
          "allOf": [
            {
              "$ref": "#/$defs/AccountingRefObject"
            }
          ],
          "description": "An internal reference to the tax rate in the accounting system that the line item is linked to."
        },
        "unit_amount": {
          "type": "number",
          "description": "The cost per unit of the product or service."
        }
      },
      "type": "object",
      "description": "Contains the details of an invoice line item retrieved from an accounting system."
    },
    "AccountingRefObject": {
      "properties": {
        "id": {
          "type": "string",
          "description": "An internal ID of the tax rate in the accounting system."
        }
      },
      "type": "object"
    }
  }
}