{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-customer-schema.json",
  "title": "Customer",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-customers-api-openapi.yml#/components/schemas/Customer",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique customer identifier. Prefix: cust_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "customer"
      ]
    },
    "name": {
      "type": "string",
      "description": "Customer name. 3-50 characters. Allowed: alphanumeric, period, apostrophe, forward slash, @, parentheses."
    },
    "contact": {
      "type": "string",
      "description": "Phone number. Max 15 characters. Include country code (e.g. +919876543210). Minimum 8 digits."
    },
    "email": {
      "type": "string",
      "description": "Email address. Max 64 characters."
    },
    "gstin": {
      "type": "string",
      "description": "Goods and Services Tax Identification Number (optional)."
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "created_at": {
      "type": "integer",
      "description": "Unix timestamp of customer creation."
    }
  },
  "$defs": {
    "Notes": {
      "type": "object",
      "description": "Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 15
    }
  }
}