{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-external-subscription-list-schema.json",
  "title": "ExternalSubscriptionList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-account-api-openapi.yml#/components/schemas/ExternalSubscriptionList",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "title": "Object type",
      "description": "Will always be List."
    },
    "has_more": {
      "type": "boolean",
      "description": "Indicates there are more results on subsequent pages."
    },
    "next": {
      "type": "string",
      "description": "Path to subsequent page of results."
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExternalSubscription"
      }
    }
  },
  "$defs": {
    "AccountMini": {
      "type": "object",
      "title": "Account mini details",
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 13,
          "readOnly": true
        },
        "object": {
          "type": "string",
          "title": "Object type",
          "readOnly": true
        },
        "code": {
          "type": "string",
          "description": "The unique identifier of the account.",
          "maxLength": 50
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "The email address used for communicating with this customer.",
          "maxLength": 255
        },
        "first_name": {
          "type": "string",
          "maxLength": 255
        },
        "last_name": {
          "type": "string",
          "maxLength": 255
        },
        "company": {
          "type": "string",
          "maxLength": 255
        },
        "parent_account_id": {
          "type": "string",
          "maxLength": 13
        },
        "bill_to": {
          "type": "string",
          "maxLength": 6
        },
        "dunning_campaign_id": {
          "type": "string",
          "title": "Dunning Campaign ID",
          "description": "Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used."
        }
      }
    },
    "ExternalPaymentPhase": {
      "type": "object",
      "description": "Details of payments in the lifecycle of a subscription from an external resource that is not managed by the Recurly platform, e.g. App Store or Google Play Store.",
      "properties": {
        "id": {
          "type": "string",
          "title": "External payment phase ID",
          "description": "System-generated unique identifier for an external payment phase ID, e.g. `e28zov4fw0v2`."
        },
        "object": {
          "type": "string",
          "title": "Object type"
        },
        "started_at": {
          "type": "string",
          "format": "date-time",
          "title": "Started At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "starting_billing_period_index": {
          "type": "integer",
          "title": "Starting Billing Period Index"
        },
        "ending_billing_period_index": {
          "type": "integer",
          "title": "Ending Billing Period Index"
        },
        "offer_type": {
          "type": "string",
          "title": "Offer Type",
          "description": "Type of discount offer given, e.g. \"FREE_TRIAL\""
        },
        "offer_name": {
          "type": "string",
          "title": "Offer Name",
          "description": "Name of the discount offer given, e.g. \"introductory\""
        },
        "period_count": {
          "type": "integer",
          "title": "Period Count",
          "description": "Number of billing periods"
        },
        "period_length": {
          "type": "string",
          "title": "Period Length",
          "description": "Billing cycle length"
        },
        "amount": {
          "type": "string",
          "format": "decimal",
          "title": "Amount",
          "minimum": 0,
          "description": "Allows up to 9 decimal places"
        },
        "currency": {
          "type": "string",
          "title": "Currency",
          "description": "3-letter ISO 4217 currency code.",
          "maxLength": 3
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created at",
          "description": "When the external subscription was created in Recurly."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated at",
          "description": "When the external subscription was updated in Recurly."
        }
      }
    },
    "ExternalProductMini": {
      "type": "object",
      "title": "External product mini details",
      "description": "Just the important parts.",
      "properties": {
        "id": {
          "type": "string",
          "title": "External product ID",
          "readOnly": true
        },
        "object": {
          "type": "string",
          "title": "Object type",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "The merchant-facing name of the external product."
        }
      }
    },
    "ExternalProductReferenceMini": {
      "type": "object",
      "title": "External Product Reference details",
      "description": "External Product Reference details",
      "properties": {
        "id": {
          "type": "string",
          "title": "External Product ID",
          "description": "System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`."
        },
        "object": {
          "type": "string",
          "title": "object"
        },
        "reference_code": {
          "type": "string",
          "title": "reference_code",
          "description": "A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store."
        },
        "external_connection_type": {
          "type": "string",
          "title": "external_connection_type",
          "description": "Source connection platform."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the external product was created in Recurly."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the external product was updated in Recurly."
        }
      }
    },
    "ExternalSubscription": {
      "type": "object",
      "description": "Subscription from an external resource such as Apple App Store or Google Play Store.",
      "properties": {
        "id": {
          "type": "string",
          "title": "External subscription ID",
          "description": "System-generated unique identifier for an external subscription ID, e.g. `e28zov4fw0v2`."
        },
        "object": {
          "type": "string",
          "title": "Object type"
        },
        "account": {
          "$ref": "#/$defs/AccountMini"
        },
        "external_product_reference": {
          "$ref": "#/$defs/ExternalProductReferenceMini"
        },
        "external_product": {
          "$ref": "#/$defs/ExternalProductMini"
        },
        "plan": {
          "$ref": "#/$defs/PlanMini"
        },
        "external_payment_phases": {
          "type": "array",
          "title": "External payment phases",
          "description": "The phases of the external subscription payment lifecycle.",
          "items": {
            "$ref": "#/$defs/ExternalPaymentPhase"
          }
        },
        "external_id": {
          "type": "string",
          "title": "External Id",
          "description": "The id of the subscription in the external systems., I.e. Apple App Store or Google Play Store."
        },
        "uuid": {
          "type": "string",
          "title": "Uuid",
          "description": "Universally Unique Identifier created automatically."
        },
        "last_purchased": {
          "type": "string",
          "format": "date-time",
          "title": "Last purchased",
          "description": "When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade."
        },
        "auto_renew": {
          "type": "boolean",
          "title": "Auto-renew",
          "description": "An indication of whether or not the external subscription will auto-renew at the expiration date.",
          "default": false
        },
        "in_grace_period": {
          "type": "boolean",
          "title": "In grace period",
          "description": "An indication of whether or not the external subscription is in a grace period.",
          "default": false
        },
        "app_identifier": {
          "type": "string",
          "title": "App identifier",
          "description": "Identifier of the app that generated the external subscription."
        },
        "quantity": {
          "type": "integer",
          "title": "Quantity",
          "description": "An indication of the quantity of a subscribed item's quantity.",
          "default": 1,
          "minimum": 0
        },
        "state": {
          "type": "string",
          "description": "External subscriptions can be active, canceled, expired, past_due, voided, revoked, or paused.",
          "default": "active"
        },
        "activated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Activated at",
          "description": "When the external subscription was activated in the external platform."
        },
        "canceled_at": {
          "type": "string",
          "format": "date-time",
          "title": "Canceled at",
          "description": "When the external subscription was canceled in the external platform."
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Expires at",
          "description": "When the external subscription expires in the external platform."
        },
        "trial_started_at": {
          "type": "string",
          "format": "date-time",
          "title": "Trial started at",
          "description": "When the external subscription trial period started in the external platform."
        },
        "trial_ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Trial ends at",
          "description": "When the external subscription trial period ends in the external platform."
        },
        "test": {
          "type": "boolean",
          "title": "Test",
          "description": "An indication of whether or not the external subscription was purchased in a sandbox environment.",
          "default": false
        },
        "imported": {
          "type": "boolean",
          "title": "Imported",
          "description": "An indication of whether or not the external subscription was created by a historical data import.",
          "default": false
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created at",
          "description": "When the external subscription was created in Recurly."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated at",
          "description": "When the external subscription was updated in Recurly."
        }
      }
    },
    "PlanCode": {
      "type": "string",
      "title": "Plan code",
      "description": "Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.",
      "pattern": "/^[a-z0-9_+-]+$/",
      "maxLength": 50
    },
    "PlanMini": {
      "type": "object",
      "title": "Plan mini details",
      "description": "Just the important parts.",
      "properties": {
        "id": {
          "type": "string",
          "title": "Plan ID",
          "maxLength": 13,
          "readOnly": true
        },
        "object": {
          "type": "string",
          "title": "Object type",
          "readOnly": true
        },
        "code": {
          "$ref": "#/$defs/PlanCode"
        },
        "name": {
          "$ref": "#/$defs/PlanName"
        }
      }
    },
    "PlanName": {
      "type": "string",
      "title": "Name",
      "description": "This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.",
      "maxLength": 255
    }
  }
}