On Sphere.io, I know it is possible to attach custom data to Product
objects, using the custom attributes.
Is it possible to do something similar with the Customer
and Order
objects? Just untyped key-value String pairs would be fine for my scenario (For now, anyway. Later I might need to attach JSON documents).
If yes, is it also possible to filter the objects based on the custom data?
I am using the Sphere Java SDK.
Custom objects API is a simple key-value store that can be used to extend objects such as customer or order with custom JSON documents. If you wanted to attach a birthday to a customer, you could implement it with a custom object where the container could be called "customer-birthdays" and the key would be the id of the customer. Every time you would load a customer object and you would require the birthday, you would have to fetch it using it's id from the key-value store.
The SPHERE.IO backend does not know anything about the associations between a customer and it's birthday. This means that when querying customers it is not possible to include the attached birthday in the query predicate.
The custom objects API is also exposed in the Java SDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With