> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Schema (Legacy)

> Legacy fields-array schema for extractors. New projects should prefer JSON Schema.

### Fields Array Structure (`fields`)

> **Note**
>
> This section is relevant for the Fields Array config type. If you are using
> the JSON Schema config type, please see the [JSON Schema Structure](#json-schema-structure-schema) documentation. If you aren't sure
> which config type you are using, please see the [Migrating to JSON Schema](/2025-04-21/product/migrating-to-json-schema) documentation.

```typescript
type ExtractionField = {
  id: string;
  name: string;
  type:
    | "string"
    | "number"
    | "currency"
    | "boolean"
    | "date"
    | "array"
    | "enum"
    | "object"
    | "signature";
  description: string;
  // Required for nested fields (arrays, objects, signatures)
  schema?: ExtractionField[];
  // Required for enums
  enum?: Enum[];
};

type Enum = {
  value: string;
  description: string;
};
```

#### Configuration Examples

#### Basic Example

```typescript
const extractionConfig = {
  type: "EXTRACT",
  fields: [
    {
      id: "invoice_number",
      name: "Invoice Number",
      type: "string",
      description: "The unique identifier for this invoice",
    },
    {
      id: "amount",
      name: "Total Amount",
      type: "currency",
      description: "The total amount of the invoice",
    },
  ],
};
```

#### Example with Nested Fields

```typescript
const complexExtractionConfig = {
  type: "EXTRACT",
  fields: [
    {
      id: "line_items",
      name: "Line Items",
      type: "array",
      description: "Individual items in the invoice",
      schema: [
        {
          id: "item_name",
          name: "Item Name",
          type: "string",
          description: "Name of the item",
        },
        {
          id: "quantity",
          name: "Quantity",
          type: "number",
          description: "Number of items",
        },
        {
          id: "unit_price",
          name: "Unit Price",
          type: "currency",
          description: "Price per unit",
        },
      ],
    },
    {
      id: "payment_status",
      name: "Payment Status",
      type: "enum",
      description: "Current payment status",
      enum: [
        {
          value: "PAID",
          description: "Payment has been completed",
        },
        {
          value: "PENDING",
          description: "Payment is pending",
        },
      ],
    },
  ],
  extractionRules: "- If ...", // Optional extraction rules
  advancedOptions: {
    modelReasoningInsightsEnabled: true,
  },
};
```

#### Example with nested arrays and objects

```typescript
const nestedArrayConfig = {
  type: "EXTRACT",
  fields: [
    {
      id: "orders",
      name: "Orders",
      type: "array",
      description: "List of customer orders",
      schema: [
        {
          id: "order_id",
          name: "Order ID",
          type: "string",
          description: "Unique identifier for the order",
        },
        {
          id: "customer_name",
          name: "Customer Name",
          type: "string",
          description: "Name of the customer",
        },
        {
          id: "shipments",
          name: "Shipments",
          type: "array",
          description: "List of shipments for this order",
          schema: [
            {
              id: "tracking_number",
              name: "Tracking Number",
              type: "string",
              description: "Shipping tracking number",
            },
            {
              id: "ship_date",
              name: "Ship Date",
              type: "date",
              description: "Date the shipment was sent",
            },
            {
              id: "carrier",
              name: "Carrier",
              type: "string",
              description: "Shipping carrier name",
            },
          ],
        },
      ],
    },
  ],
};
```