The sphere of sphere.io on objects

In Sphere.io , I know that you can attach user data to Product objects using custom attributes.

Is it possible to do something similar with the Customer and Order objects? Just untyped key-value string pairs would be good for my scenario (for now, anyway, later on, I might have to attach JSON documents).

If so, is it also possible to filter objects based on user data?

I am using the Sphere Java SDK .

+4
source share
2 answers

The custom object API is a simple keystore that can be used to extend objects such as customer or order with custom JSON documents. If you want to associate a birthday with a client, you can implement it using a custom object, where the container can be called "clientโ€™s birthdays" and the key will be the clientโ€™s identifier. Each time you download a client object and you need a birthday, you will need to retrieve it using its id from the key value store.

The SPHERE.IO backend knows nothing about associations between a client and a birthday. This means that when clients request, it is not possible to include the attached birthday in the request predicate.

The custom object API is also displayed in the Java SDK.

+6
source

The feature you were looking for is now (August 4, 2015) added to the commercetools platform (formerly known as SPHERE.IO). You can check the release notes .

There is a new type endpoint here that allows you to define reusable types. You can then set the type in order, and that particular order receives the attributes defined in the type.

+1
source

Source: https://habr.com/ru/post/1496995/


All Articles