> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/interfaces/withcustomdata.md).

# WithCustomData

Interface for entities with custom JSON data fields

Audience: Programmer

The `WithCustomData` interface is implemented by entities that support storing custom attributes in a JSON data field. This enables flexible schema extension without database migrations.

## Fields

| Field  | Type  | Description                      |
| ------ | ----- | -------------------------------- |
| `data` | `Map` | Custom attributes stored as JSON |

## Implementing Types

* InventoryItem
* Customer
* Supplier
* PickingOrder
* PickingOrderItem
* ReceivingInbound
* ReceivingInboundItem
* Repository
* RepositoryMovement
* InventoryCollection
* InventoryItemSet
* Transaction
* Workflow
* WorkflowSignal

## Usage

```graphql
query {
  inventoryItems(
    where: {
      Data: ["color", "red"]
      DataHasKey: "size"
    }
  ) {
    edges {
      node {
        id
        data  # Map field from WithCustomData
      }
    }
  }
}
```

## Querying Data Fields

Use these filters to query JSON data:

* `Data` - Match exact value at path
* `DataHasKey` - Check if key exists
* `DataIn` - Value is in list
* `DataContains` - String contains substring

See [Advanced JSON Field Queries](https://github.com/pyck-ai/docs/blob/main/graphql/advanced/json-field-queries.md) for detailed examples.

## Best Practices

1. Define a schema for your custom data
2. Document expected fields
3. Validate data structure on write
4. Use consistent naming conventions
5. Consider performance for deep queries

## See Also

* [Map Scalar](/graphql-api/scalars/map.md) - The Map type used for data
* [Advanced JSON Queries](https://github.com/pyck-ai/docs/blob/main/graphql/advanced/json-field-queries.md) - Query techniques


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/interfaces/withcustomdata.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
