Working with custom properties

Some Yotpo entities allow you to enrich the object custom properties on top of the object schema.

Why use custom properties?

Custom properties serve two purposes:

  • They allow you to enrich the entity with product line-specific information. As only this information will be used, you can keep your core integration code lean and manage the additional custom properties only when needed. This API reference indicates custom properties with specific functionality for each API entity.
  • Some Yotpo features allow you to augment our entity model with your own fields and use them dynamically. For example, reviews can be filtered based on dynamic fields added to the order entity.

Using custom properties

Custom properties are manifested as a key<>value set.

Example:

"custom_properties": {
      "is_blocklisted": true,
      "review_form_tag": "electronics"
}

To remove an existing custom property, simply update the entity and pass the properties set with an empty string as the value for the property you want to remove.

Validation

Property name format:

  • Contains only lower case characters, numbers, and the "_" (underscore) symbol
  • Contains a maximum of 32 characters

Property value format:

  • Contains a maximum of 255 characters

There may be additional validation rules for custom properties that are mentioned in the schema. These will be specified in the entity description.