{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/toku/json-schema/toku-paginated-response-get-customer-response-schema.json",
  "title": "PaginatedResponse[GetCustomerResponse]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/toku-customers-api-openapi.yml#/components/schemas/PaginatedResponse_GetCustomerResponse_",
  "properties": {
    "items": {
      "description": "Elementos de la página actual.",
      "items": {
        "$ref": "#/$defs/Customer"
      },
      "title": "Items",
      "type": "array"
    },
    "next_cursor": {
      "description": "Cursor de la página siguiente. Reenvíalo como `next_cursor` en la próxima llamada para continuar; es `null` cuando no hay más páginas.",
      "title": "Next Cursor",
      "type": "string"
    }
  },
  "required": [
    "items"
  ],
  "type": "object",
  "$defs": {
    "Customer": {
      "description": "Cliente de la organización: la persona o empresa a la que se le cobra.\n\nEs el punto de partida de la integración: las Subscriptions y las Invoices se crean siempre asociadas a un Customer, y los medios de pago quedan guardados a su nombre.\n\nPara referenciarlo sirve tanto el identificador que Toku devuelve al crearlo como el `external_id` con el que lo conoce la organización integrada.",
      "properties": {
        "agent_phone_number": {
          "description": "Número de teléfono del agente por defecto.",
          "maxLength": 16,
          "title": "Agent Phone Number",
          "type": "string"
        },
        "default_agent": {
          "description": "Correo del agente por defecto que contactará al cliente cuando se abra un ticket.",
          "maxLength": 128,
          "title": "Default Agent",
          "type": "string"
        },
        "default_receipt_type": {
          "allOf": [
            {
              "$ref": "#/$defs/ReceiptType"
            }
          ],
          "default": "bill",
          "description": "Tipo de documento tributario que se emitirá por defecto para el cliente."
        },
        "external_id": {
          "description": "Identificador externo del cliente definido por la organización. Por defecto, las organizaciones usan el government_id como identificador externo del cliente.",
          "maxLength": 128,
          "title": "External Id",
          "type": "string"
        },
        "fiscal_regime": {
          "description": "Régimen fiscal del cliente, requerido para generar el recibo CFDI (México).",
          "title": "Fiscal Regime",
          "type": "string"
        },
        "government_id": {
          "description": "Identificador tributario o personal del cliente según su país. Por ejemplo, el RUT de una persona en Chile: 18.579.787-K.",
          "title": "Government Id",
          "type": "string"
        },
        "id": {
          "description": "Identificador público del cliente.",
          "title": "Id",
          "type": "string"
        },
        "mail": {
          "description": "Correo electrónico del cliente.",
          "maxLength": 128,
          "title": "Mail",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Campos adicionales definidos por cada organización para el cliente.",
          "title": "Metadata",
          "type": "object"
        },
        "name": {
          "description": "Nombre del cliente.",
          "maxLength": 128,
          "title": "Name",
          "type": "string"
        },
        "pac_mandate_id": {
          "description": "Identificador del mandato PAC (Pago Automático de Cuentas) asociado al cliente.",
          "maxLength": 64,
          "title": "Pac Mandate Id",
          "type": "string"
        },
        "phone_number": {
          "description": "Número de teléfono del cliente.",
          "maxLength": 16,
          "title": "Phone Number",
          "type": "string"
        },
        "rfc": {
          "description": "RFC del cliente (México); si está presente, la deuda generará el documento tributario correspondiente.",
          "maxLength": 16,
          "title": "Rfc",
          "type": "string"
        },
        "secondary_emails": {
          "description": "Lista de correos electrónicos secundarios del cliente.",
          "items": {
            "type": "string"
          },
          "title": "Secondary Emails",
          "type": "array"
        },
        "send_mail": {
          "default": false,
          "description": "Determina si se debe emitir el webhook 'invoice.no_payment_method' al crear el cliente.",
          "title": "Send Mail",
          "type": "boolean"
        },
        "silenced_until": {
          "description": "Fecha y hora en que expira el silenciamiento del cliente. Si es null, el cliente no está silenciado.",
          "format": "date-time",
          "title": "Silenced Until",
          "type": "string"
        },
        "tax_zip_code": {
          "description": "Código postal tributario del cliente, requerido para generar el recibo CFDI (México).",
          "title": "Tax Zip Code",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "title": "Customer",
      "type": "object"
    },
    "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"
    }
  }
}