{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nmi/json-schema/nmi-subscription-response-schema.json",
  "title": "Subscription Response",
  "description": "Subscription response matching SubscriptionRestSerializer structure",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nmi-subscriptions-api-openapi.yml#/components/schemas/SubscriptionResponse",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "subscription"
      ],
      "description": "Resource type identifier"
    },
    "id": {
      "type": "string",
      "description": "Subscription ID"
    },
    "start_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Subscription start date in UTC ISO 8601 format"
    },
    "next_billing_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Next billing date in UTC ISO 8601 format"
    },
    "amount": {
      "type": "string",
      "description": "Subscription amount"
    },
    "customer_vault_id": {
      "type": "string",
      "description": "Customer vault ID associated with the subscription"
    },
    "delayed_condition": {
      "type": "string",
      "description": "Delayed condition"
    },
    "paused_subscription": {
      "type": "integer",
      "enum": [
        0,
        1
      ],
      "description": "Whether the subscription is paused (0 = active, 1 = paused)"
    },
    "plan": {
      "type": [
        "object",
        "null"
      ],
      "description": "Associated plan",
      "properties": {
        "id": {
          "type": "string",
          "description": "Plan ID"
        },
        "plan_name": {
          "type": "string",
          "description": "Plan name"
        },
        "plan_amount": {
          "type": "string",
          "description": "Plan amount"
        },
        "plan_payments": {
          "type": "string",
          "description": "Number of payments (0 = until canceled)"
        },
        "day_frequency": {
          "type": "string",
          "description": "Day frequency (0 if not applicable)"
        },
        "month_frequency": {
          "type": "string",
          "description": "Month frequency (0 if not applicable)"
        },
        "day_of_month": {
          "type": "string",
          "description": "Day of month (empty if not applicable)"
        }
      }
    }
  },
  "required": [
    "object",
    "id"
  ]
}