{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-subscription-discount-codes-result-dto-schema.json",
  "title": "SubscriptionDiscountCodesResultDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-subscriptiondiscountcodes-api-api-openapi.yml#/components/schemas/SubscriptionDiscountCodesResultDto",
  "type": "object",
  "properties": {
    "page": {
      "type": "number",
      "description": "Current page number"
    },
    "limit": {
      "type": "number",
      "description": "Number of items per page"
    },
    "totalItems": {
      "type": "number",
      "description": "Total number of items"
    },
    "totalPages": {
      "type": "number",
      "description": "Total number of pages"
    },
    "subscriptionDiscountCodes": {
      "description": "Array of subscription discount codes for the current page",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubscriptionDiscountCodeDto"
      }
    }
  },
  "required": [
    "page",
    "limit",
    "totalItems",
    "totalPages",
    "subscriptionDiscountCodes"
  ],
  "$defs": {
    "SubscriptionDiscountCodeDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "deletedAt": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "subscriptionId": {
          "type": "string",
          "description": "The id of the subscription"
        },
        "code": {
          "type": "string",
          "description": "The discount code"
        },
        "discountCodeExternalId": {
          "type": "string",
          "description": "The shopify id of the discount code"
        },
        "type": {
          "type": "string",
          "enum": [
            "MANUAL",
            "CODE_DISCOUNT",
            "AUTOMATIC_DISCOUNT"
          ]
        },
        "targetType": {
          "type": "string",
          "enum": [
            "SHIPPING_LINE",
            "LINE_ITEM"
          ]
        },
        "discountModifier": {
          "type": "string",
          "enum": [
            "PERCENTAGE",
            "FIXED_AMOUNT"
          ]
        },
        "discount": {
          "type": "number"
        },
        "recurringCycleLimit": {
          "type": "number"
        },
        "usageCount": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "createdAt",
        "updatedAt",
        "deletedAt",
        "subscriptionId",
        "code",
        "discountCodeExternalId",
        "type",
        "targetType",
        "discountModifier",
        "discount",
        "usageCount"
      ]
    }
  }
}