Implementation:Mage ai Mage ai Chargebee Common Invoices Schema
| Knowledge Sources | |
|---|---|
| Domains | Data_Integration, Chargebee, Schema |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
JSON Schema definition for Chargebee invoice records used by the Singer-based Chargebee source connector.
Description
This schema defines the structure and types for invoice 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, po_number, channel, generated_at, customer_id, recurring, status, vat_number, price_type, date, due_date, net_term_days, currency_code, total, and amount_paid. The root type is a nullable object with additionalProperties set to false, ensuring strict validation against the defined property set. At 680 lines, this is the largest of the common schemas, reflecting the comprehensive nature of invoice data in Chargebee.
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 invoices stream.
Code Reference
Source Location
- Repository: mage-ai
- File: mage_integrations/mage_integrations/sources/chargebee/schemas/common/invoices.json
- Lines: 1-680
Signature
{
"type": ["null", "object"],
"additionalProperties": false,
"properties": {
"id": { "type": ["null", "string"] },
"po_number": { "type": ["null", "string"] },
"channel": { "type": ["null", "string"] },
"generated_at": { "type": ["null", "string"], "format": "date-time" },
"customer_id": { "type": ["null", "string"] },
"recurring": { "type": ["null", "boolean"] },
"status": { "type": ["null", "string"] },
"vat_number": { "type": ["null", "string"] },
"price_type": { "type": ["null", "string"] },
"date": { "type": ["null", "string"], "format": "date-time" },
"due_date": { "type": ["null", "string"], "format": "date-time" },
"net_term_days": { "type": ["null", "integer"] },
"currency_code": { "type": ["null", "string"] },
"total": { "type": ["null", "integer"] },
"amount_paid": { "type": ["null", "integer"] }
// ... additional properties
}
}
Import
# Loaded automatically by Source.load_schemas_from_folder()
# Path: mage_integrations/mage_integrations/sources/chargebee/schemas/common/invoices.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",
"invoices.json"
)
with open(schema_path) as f:
schema = json.load(f)
# schema["properties"] contains field definitions
print(list(schema["properties"].keys()))