Implementation:Mage ai Mage ai Chargebee Common Orders Schema
| Knowledge Sources | |
|---|---|
| Domains | Data_Integration, Chargebee, Schema |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
JSON Schema definition for Chargebee order records used by the Singer-based Chargebee source connector.
Description
This schema defines the structure and types for order data extracted from the Chargebee API. It is loaded by the Chargebee source connector during stream discovery to validate and type-check extracted records. The schema follows the JSON Schema specification and includes properties such as id, document_number, invoice_id, subscription_id, customer_id, status, cancellation_reason, payment_status, order_type, price_type, reference_id, fulfillment_status, order_date, shipping_date, and note. The root type is a nullable object, defining order lifecycle fields including fulfillment and shipping tracking.
Usage
This schema is automatically loaded by the Chargebee source connector during the discovery phase. It defines the available columns and their types for the orders stream.
Code Reference
Source Location
- Repository: mage-ai
- File: mage_integrations/mage_integrations/sources/chargebee/schemas/common/orders.json
- Lines: 1-431
Signature
{
"type": ["null", "object"],
"properties": {
"id": { "type": ["null", "string"] },
"document_number": { "type": ["null", "string"] },
"invoice_id": { "type": ["null", "string"] },
"subscription_id": { "type": ["null", "string"] },
"customer_id": { "type": ["null", "string"] },
"status": { "type": ["null", "string"] },
"cancellation_reason": { "type": ["null", "string"] },
"payment_status": { "type": ["null", "string"] },
"order_type": { "type": ["null", "string"] },
"price_type": { "type": ["null", "string"] },
"reference_id": { "type": ["null", "string"] },
"fulfillment_status": { "type": ["null", "string"] },
"order_date": { "type": ["null", "string"], "format": "date-time" },
"shipping_date": { "type": ["null", "string"], "format": "date-time" },
"note": { "type": ["null", "string"] }
// ... additional properties
}
}
Import
# Loaded automatically by Source.load_schemas_from_folder()
# Path: mage_integrations/mage_integrations/sources/chargebee/schemas/common/orders.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 is auto-loaded by the Chargebee source connector
# Manual loading example:
schema_path = os.path.join(
"mage_integrations/mage_integrations/sources/chargebee/schemas/common",
"orders.json"
)
with open(schema_path) as f:
schema = json.load(f)
# schema["properties"] contains field definitions
print(list(schema["properties"].keys()))