Extra attributes (Metafields)
Metafields let you attach project-specific data to supported Ordering.co resources without changing the resource's standard schema.
Current API routes expose metafield operations for these resource families:
- User
- Business
- Category
- Product
- Extra
- Extra option
- Extra option suboption
- Menu
- Offer
- Country
- Address
- Order
- Cart
- Driver group
- Page
Availability and permissions vary by resource. Use the operation shown in the API Reference for the resource you are modifying.
Metafield structure
| Attribute | Type | Required when creating | Description |
|---|---|---|---|
key | string | Yes | Name of the additional attribute. |
value | varies by value_type | Yes | Stored value. |
value_type | string | Yes | Controls validation and how the API expands the stored value. |
Supported value_type values are:
integerdecimalbooleantextjson
The API stores the metafield record with fields such as id, object_id, model, key, value, value_type, created_at, and updated_at.
Reading metafields
Legacy list and detail operations can expose metafields in two forms through the params query parameter:
- Include
metadatato expand metafield keys as attributes on the resource. - Include
metafieldsto return themetafieldsarray.
Support is endpoint-specific. Check the operation schema before relying on either projection.
Expanded attribute example:
{
"id": 1292,
"name": "Example product",
"custom_label": "Example value"
}
Metafield-array example:
{
"id": 1292,
"name": "Example product",
"metafields": [
{
"id": 1,
"object_id": 1292,
"model": "Product",
"key": "custom_label",
"value": "Example value",
"value_type": "text",
"created_at": "2026-01-15 10:00:00",
"updated_at": "2026-01-15 10:00:00"
}
]
}
When neither projection is requested, response behavior can vary by endpoint. Treat the current operation schema as authoritative.