> ## Documentation Index
> Fetch the complete documentation index at: https://tile.run/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema examples

> Examples of schemas and associated responses

### Basic example

<CodeGroup>
  ```json Schema theme={null}
  {
    "name": "SimpleInvoice",
    "description": "Basic invoice information",
    "fields": [
      {
        "name": "invoice_number",
        "description": "Unique invoice identifier",
        "type": "string"
      },
      {
        "name": "total_amount",
        "description": "Total invoice amount",
        "type": "number"
      },
      {
        "name": "issue_date",
        "description": "Invoice issue date",
        "type": "date"
      },
      {
        "name": "due_date",
        "description": "Payment due date",
        "type": "date"
      }
    ]
  }
  ```

  ```json Response theme={null}
  {
    "schema_name": "SimpleInvoice",
    "schema_description": "Basic invoice information",
    "extracted_data": {
      "invoice_number": {
        "name": "invoice_number",
        "value": "INV-2024-001",
        "field_type": "string",
        "confidence": 0.98,
        "source_context": "Found in header section",
        "page_index": 1
      },
      "total_amount": {
        "name": "total_amount",
        "value": 1250.0,
        "field_type": "number",
        "confidence": 0.99,
        "source_context": "Found in totals section",
        "page_index": 1
      },
      "issue_date": {
        "name": "issue_date",
        "value": "2024-03-15",
        "field_type": "date",
        "confidence": 0.97,
        "source_context": "Found in header section",
        "page_index": 1
      },
      "due_date": {
        "name": "due_date",
        "value": "2024-04-14",
        "field_type": "date",
        "confidence": 0.97,
        "source_context": "Found in payment terms section",
        "page_index": 1
      }
    }
  }
  ```
</CodeGroup>

### With arrays and objects

<CodeGroup>
  ```json Schema theme={null}
  {
    "name": "DetailedInvoice",
    "description": "Detailed invoice with line items and customer information",
    "fields": [
      {
        "name": "invoice_number",
        "description": "Unique invoice identifier",
        "type": "string"
      },
      {
        "name": "customer",
        "description": "Customer details",
        "type": "object",
        "fields": [
          {
            "name": "name",
            "description": "Customer name",
            "type": "string"
          },
          {
            "name": "email",
            "description": "Customer email",
            "type": "email"
          },
          {
            "name": "phone",
            "description": "Customer phone",
            "type": "phone"
          }
        ]
      },
      {
        "name": "line_items",
        "description": "Individual invoice items",
        "type": "array",
        "fields": [
          {
            "name": "description",
            "description": "Item description",
            "type": "string"
          },
          {
            "name": "quantity",
            "description": "Quantity of items",
            "type": "number"
          },
          {
            "name": "unit_price",
            "description": "Price per unit",
            "type": "number"
          }
        ]
      }
    ]
  }
  ```

  ```json Response theme={null}
  {
    "schema_name": "DetailedInvoice",
    "schema_description": "Detailed invoice with line items and customer information",
    "extracted_data": {
      "invoice_number": {
        "name": "invoice_number",
        "value": "INV-2024-001",
        "field_type": "string",
        "confidence": 0.98,
        "source_context": "Found in header section",
        "page_index": 1
      },
      "customer": {
        "name": {
          "name": "name",
          "value": "Acme Corp",
          "field_type": "string",
          "confidence": 0.95,
          "source_context": "Found in customer section",
          "page_index": 1
        },
        "email": {
          "name": "email",
          "value": "billing@acme.com",
          "field_type": "email",
          "confidence": 0.95,
          "source_context": "Found in customer section",
          "page_index": 1
        },
        "phone": {
          "name": "phone",
          "value": "+1-555-0123",
          "field_type": "phone",
          "confidence": 0.95,
          "source_context": "Found in customer section",
          "page_index": 1
        }
      },
      "line_items": [
        {
          "description": {
            "name": "description",
            "value": "Web Development Services",
            "field_type": "string",
            "confidence": 0.95,
            "source_context": "Found in line items section",
            "page_index": 1
          },
          "quantity": {
            "name": "quantity",
            "value": 40,
            "field_type": "number",
            "confidence": 0.95,
            "source_context": "Found in line items section",
            "page_index": 1
          },
          "unit_price": {
            "name": "unit_price",
            "value": 150.0,
            "field_type": "number",
            "confidence": 0.95,
            "source_context": "Found in line items section",
            "page_index": 1
          }
        },
        {
          "description": {
            "name": "description",
            "value": "Cloud Hosting - Monthly",
            "field_type": "string",
            "confidence": 0.95,
            "source_context": "Found in line items section",
            "page_index": 1
          },
          "quantity": {
            "name": "quantity",
            "value": 1,
            "field_type": "number",
            "confidence": 0.95,
            "source_context": "Found in line items section",
            "page_index": 1
          },
          "unit_price": {
            "name": "unit_price",
            "value": 299.99,
            "field_type": "number",
            "confidence": 0.95,
            "source_context": "Found in line items section",
            "page_index": 1
          }
        }
      ]
    }
  }
  ```
</CodeGroup>
