{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-get-advance-response-schema.json",
  "title": "GetAdvanceResponse",
  "description": "Response schema for a single advance.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canopyservicing-com-advances-api-openapi.yml#/components/schemas/GetAdvanceResponse",
  "properties": {
    "account_id": {
      "type": "string",
      "title": "Account Id",
      "description": "The unique identifier of the account.",
      "hidden": false
    },
    "advance_id": {
      "type": "string",
      "title": "Advance Id",
      "description": "The unique identifier of the advance.",
      "hidden": false
    },
    "effective_at": {
      "type": "string",
      "title": "Effective At",
      "description": "The date at which the advance became effective.",
      "hidden": false
    },
    "balances": {
      "$ref": "#/$defs/AdvanceBalanceBreakdown",
      "description": "The breakdown of balances on the advance.",
      "hidden": false
    },
    "currency": {
      "type": "string",
      "title": "Currency",
      "description": "The currency of the advance.",
      "hidden": false
    },
    "repayment_pace": {
      "type": "number",
      "title": "Repayment Pace",
      "description": "The pace of repayment for the advance.",
      "hidden": false
    },
    "status": {
      "$ref": "#/$defs/AdvanceStatusType",
      "description": "The status of the advance.",
      "hidden": false
    },
    "term": {
      "$ref": "#/$defs/AdvanceTerm",
      "description": "Term information for the advance.",
      "hidden": false
    },
    "maturity_at": {
      "type": "string",
      "title": "Maturity At",
      "description": "The maturity date (last payment due date) of the advance.",
      "hidden": false
    },
    "factor_rate": {
      "type": "number",
      "title": "Factor Rate",
      "description": "Ratio of the total repayment amount to the advance amount.",
      "hidden": false
    }
  },
  "type": "object",
  "required": [
    "account_id",
    "advance_id",
    "effective_at",
    "balances",
    "currency",
    "repayment_pace",
    "status",
    "term",
    "maturity_at",
    "factor_rate"
  ],
  "$defs": {
    "AdvanceBalance": {
      "properties": {
        "original_amount_cents": {
          "type": "integer",
          "title": "Original Amount Cents",
          "description": "Original amount in cents.",
          "hidden": false
        },
        "balance_cents": {
          "type": "integer",
          "title": "Balance Cents",
          "description": "Current balance in cents.",
          "hidden": false
        },
        "due_to_date_cents": {
          "type": "integer",
          "title": "Due To Date Cents",
          "description": "Amount due to date in cents.",
          "hidden": false
        }
      },
      "type": "object",
      "required": [
        "original_amount_cents",
        "balance_cents",
        "due_to_date_cents"
      ],
      "title": "AdvanceBalance"
    },
    "AdvanceBalanceBreakdown": {
      "properties": {
        "repayment": {
          "$ref": "#/$defs/AdvanceBalance",
          "description": "Original and remaining repayment balances.",
          "hidden": false
        },
        "advance": {
          "$ref": "#/$defs/AdvanceBalance",
          "description": "Original and remaining advance balances.",
          "hidden": false
        },
        "fee": {
          "$ref": "#/$defs/AdvanceBalance",
          "description": "Original and remaining fee balances.",
          "hidden": false
        }
      },
      "type": "object",
      "required": [
        "repayment",
        "advance",
        "fee"
      ],
      "title": "AdvanceBalanceBreakdown",
      "description": "Breakdown of the advance balance."
    },
    "AdvanceStatusType": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "PAID_OFF"
      ],
      "title": "AdvanceStatusType"
    },
    "AdvanceTerm": {
      "properties": {
        "cycles": {
          "type": "integer",
          "title": "Cycles",
          "description": "The number of payment cycles for the advance.",
          "hidden": false
        },
        "cycle_length": {
          "type": "string",
          "title": "Cycle Length",
          "description": "The length of each cycle.",
          "hidden": false
        }
      },
      "type": "object",
      "required": [
        "cycles",
        "cycle_length"
      ],
      "title": "AdvanceTerm",
      "description": "Term information for an advance."
    }
  }
}