{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/toku/json-schema/toku-create-or-update-customer-payload-schema.json",
  "title": "CreateOrUpdateCustomerPayload",
  "description": "Campos del cuerpo para crear o actualizar un Customer.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/toku-customers-api-openapi.yml#/components/schemas/CreateOrUpdateCustomerPayload",
  "properties": {
    "admin_area": {
      "title": "Admin Area",
      "type": "string"
    },
    "admin_code": {
      "title": "Admin Code",
      "type": "string"
    },
    "agent_phone_number": {
      "maxLength": 16,
      "title": "Agent Phone Number",
      "type": "string"
    },
    "city": {
      "title": "City",
      "type": "string"
    },
    "default_agent": {
      "maxLength": 128,
      "title": "Default Agent",
      "type": "string"
    },
    "default_receipt_type": {
      "allOf": [
        {
          "$ref": "#/$defs/ReceiptType"
        }
      ],
      "default": "bill"
    },
    "detail": {
      "title": "Detail",
      "type": "string"
    },
    "external_id": {
      "description": "Identificador externo del Customer definido por la organización. Se usa como clave de idempotencia al crear o actualizar.",
      "maxLength": 128,
      "title": "External Id",
      "type": "string"
    },
    "fiscal_regime": {
      "maxLength": 4,
      "title": "Fiscal Regime",
      "type": "string"
    },
    "government_id": {
      "description": "Identificador tributario o personal del Customer según su país (por ejemplo, el RUT en Chile).",
      "maxLength": 64,
      "title": "Government Id",
      "type": "string"
    },
    "mail": {
      "description": "Correo electrónico del Customer.",
      "maxLength": 128,
      "title": "Mail",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "Metadata",
      "type": "object"
    },
    "name": {
      "description": "Nombre del Customer.",
      "maxLength": 128,
      "title": "Name",
      "type": "string"
    },
    "neighborhood": {
      "title": "Neighborhood",
      "type": "string"
    },
    "pac_mandate_id": {
      "maxLength": 64,
      "title": "Pac Mandate Id",
      "type": "string"
    },
    "phone_number": {
      "description": "Número de teléfono del Customer.",
      "maxLength": 16,
      "title": "Phone Number",
      "type": "string"
    },
    "postal_code": {
      "title": "Postal Code",
      "type": "string"
    },
    "rfc": {
      "maxLength": 16,
      "title": "Rfc",
      "type": "string"
    },
    "secondary_emails": {
      "items": {
        "type": "string"
      },
      "title": "Secondary Emails",
      "type": "array"
    },
    "send_mail": {
      "default": false,
      "title": "Send Mail",
      "type": "boolean"
    },
    "silenced_until": {
      "format": "date-time",
      "title": "Silenced Until",
      "type": "string"
    },
    "street_name": {
      "title": "Street Name",
      "type": "string"
    },
    "street_number": {
      "title": "Street Number",
      "type": "string"
    },
    "tax_zip_code": {
      "maxLength": 8,
      "title": "Tax Zip Code",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "ReceiptType": {
      "description": "Documento tributario que se emite al cobrar: `bill` es una boleta, `invoice` una factura y `no_receipt` deja el cobro sin documento asociado.",
      "enum": [
        "bill",
        "invoice",
        "no_receipt"
      ],
      "title": "ReceiptType",
      "type": "string"
    }
  }
}