Defining a custom object type in Business Manager
Key Takeaway
Define a custom object type on a staging instance, then replicate it to production with "Object Definitions" selected, because replication removes types defined directly on production.
A custom object type is a data structure you define in B2C Commerce to hold business data that no system object covers. You define the type once in Business Manager by setting its ID, key attribute, replication setting, storage scope and attributes. After that, merchants or code create custom objects, which are instances of the type.
When to use a custom object
Before you build a custom object, check whether a custom attribute on an existing system object meets the need. Creating custom business objects can significantly impact overall performance. Custom objects are also typically unnecessary, so avoid one if another solution exists.
If a custom attribute on an existing system object meets the need...
Use the custom attribute instead of a custom object.
If shoppers must filter on the data in search refinement...
Don't put the data in a custom object, because custom object attributes can't be used in search refinement.
If no other solution exists and the data is especially complex...
Create a custom object type for the data.
A merchant wants a "gift message allowed" flag on each product. That is one value per product, so a custom attribute on products covers it and no custom object is needed. The same merchant also wants to record in-store workshops, each with a date, a capacity and an instructor. No system object holds that data, so a custom object type fits.