{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/checkoutpage-com/json-schema/checkoutpage-com-subscription-detail-response-schema.json",
  "title": "SubscriptionDetailResponse",
  "description": "Envelope containing one subscription.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/checkoutpage-com-subscriptions-api-openapi.yml#/components/schemas/SubscriptionDetailResponse",
  "properties": {
    "data": {
      "properties": {
        "abandonedCartEmailSentAt": {
          "format": "date-time",
          "type": "string"
        },
        "abandonedCartEmailStatus": {
          "enum": [
            "pending",
            "first_sent",
            "second_sent",
            "third_sent",
            "converted",
            "skipped"
          ],
          "type": "string"
        },
        "abandonmentStatus": {
          "description": "'abandoned': checkout was started but not completed and not recovered yet. 'recovered': was abandoned but the customer returned and paid. Absent when the subscription is not an abandoned cart.",
          "enum": [
            "abandoned",
            "recovered"
          ],
          "type": "string"
        },
        "amount": {
          "type": "number"
        },
        "amountUsd": {
          "type": "number"
        },
        "billing": {
          "properties": {
            "address": {
              "properties": {
                "city": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                },
                "line1": {
                  "type": "string"
                },
                "line2": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "billingEmail": {
              "type": "string"
            },
            "companyName": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "cancelAt": {
          "format": "date-time",
          "type": "string"
        },
        "cancelAtPeriodEnd": {
          "type": "boolean"
        },
        "canceledAt": {
          "format": "date-time",
          "type": "string"
        },
        "canceledBy": {
          "type": "string"
        },
        "canceledByApiKey": {
          "allOf": [
            {
              "$ref": "#/$defs/UniqueIdentifier"
            },
            {
              "description": "ID of the API key that canceled the subscription, when cancellation was initiated via the seller API. Best-effort reference — the underlying ApiKey document may be hard-deleted, in which case `canceledByApiKeyName` is the durable audit trail."
            }
          ]
        },
        "canceledByApiKeyName": {
          "description": "Snapshot of the API key's human-readable name at the time of cancellation. Survives a later hard-delete of the ApiKey document.",
          "type": "string"
        },
        "clientIp": {
          "type": "string"
        },
        "couponId": {
          "type": "string"
        },
        "couponSnapshot": {
          "properties": {
            "amountOff": {
              "type": "number"
            },
            "appliesToSetupFee": {
              "type": "boolean"
            },
            "code": {
              "type": "string"
            },
            "currency": {
              "type": "string"
            },
            "deleted": {
              "type": "boolean"
            },
            "duration": {
              "enum": [
                "once",
                "repeating",
                "forever"
              ],
              "type": "string"
            },
            "durationInMonths": {
              "type": "number"
            },
            "label": {
              "type": "string"
            },
            "maxRedemptions": {
              "type": "number"
            },
            "pageIds": {
              "deprecated": true,
              "description": "Deprecated: what a coupon covers is now its `rules`; read them from the coupon (`couponId`). The pages the coupon was limited to when the subscription was bought.",
              "items": {
                "allOf": [
                  {
                    "$ref": "#/$defs/UniqueIdentifier"
                  },
                  {
                    "description": "Unique identifier. Must be in BSON ObjectId format."
                  }
                ]
              },
              "type": "array"
            },
            "percentOff": {
              "type": "number"
            },
            "redeemBy": {
              "format": "date-time",
              "type": "string"
            },
            "timesRedeemed": {
              "type": "number"
            }
          },
          "type": "object"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "currentPeriodEnd": {
          "format": "date-time",
          "type": "string"
        },
        "currentPeriodStart": {
          "format": "date-time",
          "type": "string"
        },
        "customerEmail": {
          "type": "string"
        },
        "customerId": {
          "type": "string"
        },
        "customerName": {
          "type": "string"
        },
        "discountedFromPrice": {
          "type": "number"
        },
        "dynamicPrice": {
          "type": "number"
        },
        "fees": {
          "items": {
            "properties": {
              "amount": {
                "type": "number"
              },
              "fixedAmount": {
                "type": "number"
              },
              "name": {
                "type": "string"
              },
              "percentage": {
                "type": "number"
              },
              "percentageAmount": {
                "type": "number"
              },
              "stripeProductId": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "fields": {
          "items": {
            "properties": {
              "element": {
                "enum": [
                  "checkbox",
                  "quantity",
                  "multiple-choice",
                  "select",
                  "multi-select",
                  "po-number",
                  "text",
                  "textarea",
                  "number",
                  "date-time",
                  "date",
                  "time",
                  "address",
                  "email",
                  "tax-id",
                  "phone",
                  "country"
                ],
                "type": "string"
              },
              "fieldId": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "meta": {
                "additionalProperties": {},
                "type": "object"
              },
              "reference": {
                "type": "string"
              },
              "type": {
                "enum": [
                  "",
                  "company-name",
                  "po-number",
                  "name",
                  "first-name",
                  "last-name",
                  "email",
                  "billing-email",
                  "phone",
                  "address-line1",
                  "address-city",
                  "address-country",
                  "address-line2",
                  "address-postal_code",
                  "address-state",
                  "shipping-name",
                  "shipping-phone",
                  "shipping-address-line1",
                  "shipping-address-city",
                  "shipping-address-country",
                  "shipping-address-line2",
                  "shipping-address-postal_code",
                  "shipping-address-state",
                  "tax-id"
                ],
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "values": {
                "description": "Chosen option values of a multi-select field (an option without a value is named by its label), in the order the options are defined. `value` holds the same values joined with \", \". The matching labels, as they were when the answer was written, are in `meta.selectedOptionLabels` and joined in `meta.selectedOptionLabel`. Absent on every other field type.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "id": {
          "type": "string"
        },
        "interval": {
          "type": "string"
        },
        "intervalCount": {
          "type": "number"
        },
        "isAbandoned": {
          "type": "boolean"
        },
        "lastRefundAt": {
          "format": "date-time",
          "type": "string"
        },
        "lastRefundReason": {
          "type": "string"
        },
        "lastRefundReasonNote": {
          "type": "string"
        },
        "licenseKeyId": {
          "type": "string"
        },
        "livemode": {
          "type": "boolean"
        },
        "locale": {
          "type": "string"
        },
        "orderId": {
          "type": "string"
        },
        "pageId": {
          "type": "string"
        },
        "pageSlug": {
          "type": "string"
        },
        "paymentError": {
          "type": "string"
        },
        "paymentMethod": {
          "properties": {
            "brand": {
              "type": "string"
            },
            "country": {
              "type": "string"
            },
            "expMonth": {
              "description": "Card expiration month.",
              "type": "number"
            },
            "expYear": {
              "description": "Card expiration year.",
              "type": "number"
            },
            "exp_month": {
              "deprecated": true,
              "description": "Card expiration month.",
              "type": "number"
            },
            "exp_year": {
              "deprecated": true,
              "description": "Card expiration year.",
              "type": "number"
            },
            "funding": {
              "type": "string"
            },
            "gateway": {
              "enum": [
                "stripe",
                "paypal",
                "manual"
              ],
              "type": "string"
            },
            "last4": {
              "type": "string"
            },
            "method": {
              "type": "string"
            },
            "mode": {
              "enum": [
                "default",
                "express"
              ],
              "type": "string"
            },
            "wallet": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "paymentStatus": {
          "enum": [
            "draft",
            "deleted",
            "open",
            "paid",
            "uncollectible",
            "void",
            "requires_payment_method",
            "requires_confirmation",
            "requires_action",
            "processing",
            "requires_capture",
            "canceled",
            "succeeded"
          ],
          "type": "string"
        },
        "planIterations": {
          "type": "number"
        },
        "priceId": {
          "description": "Id of the price the customer selected at checkout.",
          "type": [
            "string",
            "null"
          ]
        },
        "priceSnapshot": {
          "$ref": "#/$defs/PriceSnapshot"
        },
        "productId": {
          "type": "string"
        },
        "productPrice": {
          "type": "number"
        },
        "productTitle": {
          "type": "string"
        },
        "quantity": {
          "type": "number"
        },
        "queryParameters": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "reason": {
          "type": "string"
        },
        "recoveredAt": {
          "format": "date-time",
          "type": "string"
        },
        "screenWidth": {
          "type": "number"
        },
        "sellerId": {
          "type": "string"
        },
        "sessionId": {
          "type": "string"
        },
        "setupFee": {
          "type": "number"
        },
        "setupFeeDiscountAmount": {
          "type": "number"
        },
        "setupFeeFees": {
          "items": {
            "properties": {
              "amount": {
                "type": "number"
              },
              "name": {
                "type": "string"
              },
              "percentage": {
                "type": "number"
              },
              "stripeInvoiceItemId": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "setupFeeInvoiceItemId": {
          "type": "string"
        },
        "setupFeeInvoiceItemPaid": {
          "type": "boolean"
        },
        "setupFeeTotal": {
          "type": "number"
        },
        "setupFeeUsd": {
          "type": "number"
        },
        "shipping": {
          "properties": {
            "address": {
              "properties": {
                "city": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                },
                "line1": {
                  "type": "string"
                },
                "line2": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "name": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "sku": {
          "type": "string"
        },
        "startDate": {
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "enum": [
            "draft",
            "draft_expired",
            "incomplete",
            "incomplete_expired",
            "trialing",
            "paused",
            "scheduled",
            "active",
            "past_due",
            "canceled",
            "unpaid",
            "failed",
            "completed"
          ],
          "type": "string"
        },
        "stripeCustomerId": {
          "type": "string"
        },
        "stripePaymentIntentId": {
          "type": "string"
        },
        "stripeSetupIntentId": {
          "type": "string"
        },
        "stripeSubscriptionId": {
          "type": "string"
        },
        "taxRates": {
          "description": "Fixed tax rates applied to this record. Populated when `taxSource` is `fixed_tax_rate`.",
          "items": {
            "$ref": "#/$defs/HistoricalTaxRateSnapshot"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "taxSource": {
          "description": "How tax was applied. `fixed_tax_rate` when tax rates were applied directly to the record. `stripe_tax` when tax was calculated by Stripe based on the transaction details and Stripe Tax settings.",
          "enum": [
            "fixed_tax_rate",
            "stripe_tax",
            null
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "trialEnd": {
          "format": "date-time",
          "type": "string"
        },
        "trialStart": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "upsell": {
          "type": "boolean"
        },
        "upsellChargeId": {
          "description": "For an upsell record, the ID of the payment made on the page before the upsell.",
          "type": "string"
        },
        "upsellPageId": {
          "description": "For an upsell record, the ID of the page the buyer paid on before accepting the upsell (the start of the funnel).",
          "type": "string"
        },
        "upsellSubscriptionId": {
          "description": "For an upsell record, the ID of the subscription created on the page before the upsell.",
          "type": "string"
        },
        "userAgent": {
          "type": "string"
        },
        "variants": {
          "items": {
            "properties": {
              "fees": {
                "items": {
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "percentage": {
                      "type": "number"
                    },
                    "stripeInvoiceItemId": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "name": {
                "type": "string"
              },
              "reference": {
                "type": "string"
              },
              "selectedOptions": {
                "items": {
                  "properties": {
                    "additionalChargeAmount": {
                      "type": "number"
                    },
                    "additionalChargeAmountTotal": {
                      "type": "number"
                    },
                    "additionalChargeAmountUsd": {
                      "type": "number"
                    },
                    "discountAmount": {
                      "type": "number"
                    },
                    "fees": {
                      "items": {
                        "properties": {
                          "amount": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "percentage": {
                            "type": "number"
                          },
                          "stripeInvoiceItemId": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "optionId": {
                      "type": "string"
                    },
                    "optionInvoiceItemId": {
                      "type": "string"
                    },
                    "optionInvoiceItemPaid": {
                      "type": "boolean"
                    },
                    "optionName": {
                      "type": "string"
                    },
                    "optionStripePriceId": {
                      "type": "string"
                    },
                    "optionStripeProductId": {
                      "type": "string"
                    },
                    "optionType": {
                      "enum": [
                        "one_time",
                        "recurring"
                      ],
                      "type": "string"
                    },
                    "quantity": {
                      "type": "number"
                    },
                    "sku": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "selectionType": {
                "enum": [
                  "single",
                  "multiple",
                  "quantity"
                ],
                "type": "string"
              },
              "variantId": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "visitId": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "amount",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    }
  },
  "required": [
    "data"
  ],
  "type": "object",
  "$defs": {
    "HistoricalTaxRateSnapshot": {
      "description": "Tax rate values captured at the time of the transaction.",
      "properties": {
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "default": {
          "type": "boolean"
        },
        "displayName": {
          "description": "The name of the tax rate. Used in the checkout and invoice.",
          "type": "string"
        },
        "inclusive": {
          "description": "Whether the tax rate is inclusive.",
          "type": "boolean"
        },
        "percentage": {
          "description": "The percentage of the tax rate.",
          "maximum": 100,
          "minimum": 0,
          "type": "number"
        },
        "stripeId": {
          "description": "The ID of the tax rate in Stripe at the time of the transaction.",
          "type": "string"
        },
        "taxRate": {
          "allOf": [
            {
              "$ref": "#/$defs/UniqueIdentifier"
            },
            {
              "description": "Tax rate ID this snapshot was taken from."
            }
          ]
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "taxRate",
        "stripeId",
        "displayName",
        "inclusive",
        "percentage"
      ],
      "type": "object"
    },
    "PriceSnapshot": {
      "description": "Frozen snapshot of the purchased price at the point of purchase.",
      "properties": {
        "amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "badge": {
          "type": [
            "string",
            "null"
          ]
        },
        "billingType": {
          "type": [
            "string",
            "null"
          ]
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "discountedFromPrice": {
          "type": [
            "number",
            "null"
          ]
        },
        "label": {
          "type": [
            "string",
            "null"
          ]
        },
        "managedInStripe": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "payWhatYouWant": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "paymentPlan": {
          "description": "Payment plan config the customer purchased on — recurring billing that completes after planIterations cycles. Never present together with recurring.",
          "properties": {
            "billingCycleAnchorConfig": {
              "properties": {
                "dayOfMonth": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "enabled": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "month": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "interval": {
              "type": [
                "string",
                "null"
              ]
            },
            "intervalCount": {
              "type": [
                "number",
                "null"
              ]
            },
            "planIterations": {
              "type": [
                "number",
                "null"
              ]
            },
            "startDate": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "trialPeriodDays": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "priceId": {
          "type": [
            "string",
            "null"
          ]
        },
        "pwywSuggestedPrice": {
          "type": [
            "number",
            "null"
          ]
        },
        "recurring": {
          "description": "Recurring billing config the customer purchased on. Never present together with paymentPlan.",
          "properties": {
            "billingCycleAnchorConfig": {
              "properties": {
                "dayOfMonth": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "enabled": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "month": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "interval": {
              "type": [
                "string",
                "null"
              ]
            },
            "intervalCount": {
              "type": [
                "number",
                "null"
              ]
            },
            "startDate": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "trialPeriodDays": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "setupFee": {
          "type": [
            "number",
            "null"
          ]
        },
        "setupFeeMultipliesWithQuantity": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "stripePriceId": {
          "type": [
            "string",
            "null"
          ]
        },
        "stripePriceLivemode": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "UniqueIdentifier": {
      "description": "Unique identifier for the ticket.",
      "pattern": "^[0-9a-fA-F]{24}$",
      "type": "string"
    }
  }
}