{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-billing-customer-schema.json",
  "title": "BillingCustomer",
  "description": "Billing customer information for an organization.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-billing-api-openapi.yml#/components/schemas/BillingCustomer",
  "properties": {
    "org_id": {
      "type": "string",
      "title": "Org Id",
      "description": "Organization ID"
    },
    "has_payment_method": {
      "type": "boolean",
      "title": "Has Payment Method",
      "description": "Whether organization has a payment method on file"
    },
    "invoice_billing_enabled": {
      "type": "boolean",
      "title": "Invoice Billing Enabled",
      "description": "Whether invoice billing is enabled (enterprise customers)"
    },
    "payment_methods": {
      "items": {
        "$ref": "#/$defs/PaymentMethod"
      },
      "type": "array",
      "title": "Payment Methods",
      "description": "List of payment methods on file"
    },
    "stripe_customer_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stripe Customer Id",
      "description": "Stripe customer ID if applicable"
    },
    "created_at": {
      "type": "string",
      "title": "Created At",
      "description": "Customer creation timestamp (ISO format)"
    }
  },
  "type": "object",
  "required": [
    "org_id",
    "has_payment_method",
    "invoice_billing_enabled",
    "payment_methods",
    "created_at"
  ],
  "$defs": {
    "PaymentMethod": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Payment method ID"
        },
        "type": {
          "type": "string",
          "title": "Type",
          "description": "Payment method type (card, bank_account, etc.)"
        },
        "brand": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Brand",
          "description": "Card brand (visa, mastercard, etc.)"
        },
        "last4": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last4",
          "description": "Last 4 digits of the card or account number"
        },
        "exp_month": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exp Month",
          "description": "Expiration month of the card"
        },
        "exp_year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exp Year",
          "description": "Expiration year of the card"
        },
        "is_default": {
          "type": "boolean",
          "title": "Is Default",
          "description": "Whether this is the default payment method"
        }
      },
      "type": "object",
      "required": [
        "id",
        "type",
        "is_default"
      ],
      "title": "PaymentMethod",
      "description": "Payment method information."
    }
  }
}