Skip to main content

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​

AttributeTypeRequired when creatingDescription
keystringYesName of the additional attribute.
valuevaries by value_typeYesStored value.
value_typestringYesControls validation and how the API expands the stored value.

Supported value_type values are:

  • integer
  • decimal
  • boolean
  • text
  • json

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 metadata to expand metafield keys as attributes on the resource.
  • Include metafields to return the metafields array.

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.