Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Mage ai Mage ai Commercetools Orders Schema

From Leeroopedia


Knowledge Sources
Domains Data_Integration, Commercetools, Schema
Last Updated 2026-02-09 00:00 GMT

Overview

JSON Schema definition for Commercetools order records used by the Singer-based Commercetools source connector.

Description

This schema defines the structure and types for order data extracted from the Commercetools Orders API. It is loaded by the Commercetools source connector during stream discovery to validate and type-check extracted records. The schema follows JSON Schema draft-07 (declared via $schema) and includes top-level properties such as id, version, createdAt (date-time format), createdBy, lastModifiedAt (date-time format), lastModifiedBy, completedAt (date-time format), orderNumber, customerId, customerEmail, anonymousId, store, lineItems (an array of line item objects), customLineItems, and totalPrice. Several nested objects use additionalProperties: true to allow flexible schemas.

Usage

This schema is automatically loaded by the Commercetools 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/commercetools/schemas/orders.json
  • Lines: 1-542

Signature

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": { "type": ["null", "string"] },
    "version": { "type": ["null", "number"] },
    "createdAt": { "type": ["null", "string"], "format": "date-time" },
    "createdBy": { "type": ["null", "object"], "additionalProperties": true },
    "lastModifiedAt": { "type": ["null", "string"], "format": "date-time" },
    "lastModifiedBy": { "type": ["null", "object"], "additionalProperties": true },
    "completedAt": { "type": ["null", "string"], "format": "date-time" },
    "orderNumber": { "type": ["null", "string"] },
    "customerId": { "type": ["null", "string"] },
    "customerEmail": { "type": ["null", "string"] },
    "lineItems": { "type": ["null", "array"], "items": { "type": ["null", "object"], "..." : "..." } },
    "totalPrice": { "..." : "..." }
  }
}

Import

# Loaded automatically by Source.load_schemas_from_folder()
# Path: mage_integrations/mage_integrations/sources/commercetools/schemas/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_path = os.path.join(
    "mage_integrations/mage_integrations/sources/commercetools/schemas",
    "orders.json"
)
with open(schema_path) as f:
    schema = json.load(f)

print(list(schema["properties"].keys()))

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment