Implementation:Mage ai Mage ai Stripe Subscription Items Schema
| Knowledge Sources | |
|---|---|
| Domains | Data_Integration, Stripe, Schema |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
JSON Schema definition for Stripe subscription item records used by the Singer-based Stripe source connector.
Description
This schema defines the structure and types for subscription item data extracted from the Stripe Subscription Items API. It is loaded by the Stripe source connector during stream discovery to validate and type-check extracted records. The schema follows the JSON Schema specification and includes top-level properties such as metadata (an open object), canceled_at (date-time format), current_period_end (date-time format), plan (referenced via $ref to shared/plan.json), tax_rates (an array of tax rate objects with id, object, and other fields), price, subscription, trial_start, created, cancel_at_period_end, quantity, tax_percent, current_period_start, start, and billing_thresholds. The root type is ["null", "object"], allowing nullable records.
Usage
This schema is automatically loaded by the Stripe source connector during the discovery phase. It defines the available columns and their types for the subscription_items stream.
Code Reference
Source Location
- Repository: mage-ai
- File: mage_integrations/mage_integrations/sources/stripe/schemas/subscription_items.json
- Lines: 1-456
Signature
{
"type": ["null", "object"],
"properties": {
"metadata": { "type": ["null", "object"], "properties": {} },
"canceled_at": { "type": ["null", "string"], "format": "date-time" },
"current_period_end": { "type": ["null", "string"], "format": "date-time" },
"plan": { "$ref": "shared/plan.json#/" },
"tax_rates": { "type": ["null", "array"], "items": { "type": ["null", "object"], "properties": { "id": {}, "object": {} } } },
"price": { "type": ["null", "object"], "..." : "..." },
"subscription": { "type": ["null", "string"] },
"trial_start": { "type": ["null", "string"], "format": "date-time" },
"created": { "type": ["null", "string"], "format": "date-time" },
"cancel_at_period_end": { "type": ["null", "boolean"] },
"quantity": { "type": ["null", "integer"] },
"tax_percent": { "type": ["null", "number"] },
"current_period_start": { "type": ["null", "string"], "format": "date-time" },
"start": { "type": ["null", "string"], "format": "date-time" },
"billing_thresholds": { "type": ["null", "object"], "..." : "..." }
}
}
Import
# Loaded automatically by Source.load_schemas_from_folder()
# Path: mage_integrations/mage_integrations/sources/stripe/schemas/subscription_items.json
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | JSON file | Yes | Loaded from disk by schema loader |
Outputs
| Name | Type | Description |
|---|---|---|
| schema | dict | JSON Schema object with properties, types, and format constraints |
Usage Examples
import json
import os
schema_path = os.path.join(
"mage_integrations/mage_integrations/sources/stripe/schemas",
"subscription_items.json"
)
with open(schema_path) as f:
schema = json.load(f)
print(list(schema["properties"].keys()))