> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/api/introduction/field-naming-and-data-structure-guidelines.md).

# Field Naming & Data Structure Guidelines

{% hint style="warning" %}
This document describes our internal API field and structure guidelines, which we share publicly so you can better understand how and why we design our API the way we do.Field Naming & Data Structure Guidelines
{% endhint %}

## 1. Field Naming Rules

#### UIDs

* All fields that reference a technical unique identifier must end with Uid.

  Example: productUid, orderUid

#### Quantities

* All fields that reference a stock or quantity must start with quantity.

  Example: quantityOrdered, quantityInStock, quantityReserved

#### Entity References

* Fields that refer to another entity must always use the same field name as in the original entity.

  Example: If an order line references a product, the field must be called productUid.

## 2. Field Types

* Uid — Required unique identifier (string)
* OptionalUid — Optional unique identifier (string)
  * Use Uid when the reference is required.
  * Use OptionalUid when the reference is optional or can be unset.

## 3. Clearing Fields

* Text fields — Clear by sending an empty string "".
* Uid fields (OptionalUid) — Clear by sending an empty string "".
* Date fields — Clear by sending null.

## 4. Lists & Search Responses

#### All list and search endpoints must return:

* items — The array of results.
* paging — Pagination information.

## 5. Pagination Rules

#### The paging object must include:

| **Field**      | Description                                          |
| -------------- | ---------------------------------------------------- |
| **totalCount** | Total number of elements in the result set.          |
| **pageNumber** | Current page number (defaults to 1 if not provided). |
| **pageSize**   | Number of items requested per page.                  |

#### Example:

A search with 27 results and pageSize = 24:

```
{
  "totalCount": 27,
  "pageNumber": 1,
  "pageSize": 24
}
```

#### To check if there are more pages:

* If items.length < pageSize, this is the last page.

This format keeps your internal rules crystal-clear for your own developers, but also makes it easy for external devs to understand how to structure their requests and interpret responses.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flowretail.com/api/introduction/field-naming-and-data-structure-guidelines.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
