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