{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reddit/json-schema/reddit-components-schema-funding-instrument-schema.json",
  "title": "Funding Instrument",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reddit-funding-instruments-api-openapi.yml#/components/schemas/components_schema_funding_instrument",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "description": "The funding instrument ID."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The funding instrument's name."
    },
    "currency": {
      "$ref": "#/$defs/components_enums_billing_currency"
    },
    "credit_limit": {
      "type": "integer",
      "description": "The maximum amount this funding instrument can spend before campaigns linked to it won't run."
    },
    "billable_amount": {
      "type": "integer",
      "description": "The funding instrument's current outstanding debt (local microcurrency)."
    },
    "start_time": {
      "type": [
        "string",
        "null"
      ],
      "description": "When set, campaigns using this funding instrument won't deliver until this time or later ([ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)).",
      "format": "date-time"
    },
    "end_time": {
      "type": [
        "string",
        "null"
      ],
      "description": "When set, campaigns using this funding instrument won't deliver after this time ([ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)).",
      "format": "date-time"
    },
    "is_servable": {
      "type": "boolean",
      "description": "Whether campaigns linked to this funding instrument are allowed to run."
    },
    "reasons_not_servable": {
      "type": "array",
      "description": "Why this funding instrument is not servable. When empty, it is servable.",
      "items": {
        "type": "string",
        "enum": [
          "DATES_OUT_OF_RANGE",
          "CREDIT_LINE_EXHAUSTED",
          "CREDIT_CARD_NOT_APPROVED",
          "NOT_ACTIVE",
          "TEST"
        ]
      }
    },
    "invoice_group_status": {
      "type": [
        "string",
        "null"
      ],
      "description": "Status indicating the eligibility or issues with the invoice group.",
      "enum": [
        "ELIGIBLE",
        "NO_ACTIVE_CL_FOUND",
        "MULTI_BILL_ENTITY_FOUND",
        "MULTI_PO_FOUND",
        "MULTI_PAY_TERMS_FOUND",
        "MULTI_OPPORTUNITY_FOUND",
        null
      ]
    },
    "authorize_status": {
      "type": [
        "string",
        "null"
      ],
      "description": "The state of the credit card attachment. Applies only for `SELF_SERVE` funding instruments.",
      "x-enumDescriptions": {
        "PENDING": "The credit card attachment is waiting for authorization.",
        "APPROVED": "The credit card attachment is authorized for use.",
        "DECLINE_RETRYABLE": "Authorization failed temporarily and may be retried.",
        "DECLINE_TERMINAL": "Authorization failed permanently and should not be retried."
      },
      "enum": [
        "PENDING",
        "APPROVED",
        "DECLINE_RETRYABLE",
        "DECLINE_TERMINAL",
        null
      ]
    }
  },
  "$defs": {
    "components_enums_billing_currency": {
      "type": "string",
      "description": "The currency used in this invoice ([ISO 4217](https://www.iso.org/iso-4217-currency-codes.html)).",
      "enum": [
        "USD",
        "GBP",
        "CAD",
        "EUR",
        "AUD",
        "NZD",
        "SGD",
        "BRL"
      ]
    }
  }
}