{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hostinger/main/json-schema/hostinger-billing-v1-subscription-subscription-resource-schema.json",
  "title": "Billing.V1.Subscription.SubscriptionResource",
  "x-generated": "2026-10-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hostinger-billing-subscriptions-api-openapi.yml#/components/schemas/Billing.V1.Subscription.SubscriptionResource",
  "properties": {
    "id": {
      "description": "Subscription ID",
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "cancelled",
        "not_renewing",
        "transferred",
        "in_trial",
        "future"
      ]
    },
    "billing_period": {
      "type": "integer"
    },
    "billing_period_unit": {
      "type": "string"
    },
    "currency_code": {
      "type": "string"
    },
    "total_price": {
      "description": "Total price in cents",
      "type": "integer"
    },
    "renewal_price": {
      "description": "Renewal price in cents",
      "type": "integer"
    },
    "is_auto_renewed": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "description": "Final date when the subscription will be or was cancelled and expire. Set when a cancellation is scheduled (e.g. after auto-renewal is disabled) or the subscription is already cancelled; `null` otherwise.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "next_billing_at": {
      "description": "Date when the next charge will happen while the subscription is auto-renewing. Only relevant when `is_auto_renewed` is `true`; ignore it otherwise.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "type": "object"
}