Queries and mutations for managing Custom Objects in the platform.

Queries

Query Custom Objects

QUERYcustomObjects
Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​
container​
String​

Get Custom Object

QUERYcustomObject
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

container​
String​

Mutations

Create or Update Custom Object

MUTATIONcreateOrUpdateCustomObject
Arguments
draft​

Delete Custom Object

MUTATIONdeleteCustomObject
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

container​
String​
personalDataErasure​
Boolean​
Default: false​

Output types

CustomObject

container​
String​

Namespace to group CustomObjects.

key​
String​
User-defined unique identifier of the CustomObject within the defined container.
value​
Json​
Can be any JSON standard type, such as number, string, boolean, array, object, or a common API data type.
  • For values of type Reference the integrity of the data is not guaranteed. If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.
referencedResources​
Array of ReferencedResource​
BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
id​
String​

Unique identifier of the CustomObject.

version​
Long​

Current version of the CustomObject.

createdAt​

Date and time (UTC) the CustomObject was initially created.

lastModifiedAt​

Date and time (UTC) the CustomObject was last updated.

createdBy​

IDs and references that created the CustomObject.

lastModifiedBy​

IDs and references that last modified the CustomObject.

CustomObjectQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​
Array of CustomObject​

ReferencedResource

BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
path​
String​
objs​

Input types

CustomObjectDraft

An input object used to create a new, or update an existing Custom Object.

The value should be passed in a form of escaped JSON.

Example for value field:
"{ \"stringField\": \"myVal\", \"numberField\": 123, \"boolField\": false, \"nestedObject\": { \"nestedObjectKey\": \"anotherValue\" }, \"dateField\": \"2018-10-12T14:00:00.000Z\" }"
key​
String​
User-defined unique identifier of the CustomObject within the defined container.
container​
String​

Namespace to group CustomObjects.

value​
String​

The value should be passed in a form of escaped JSON.

Example for value field:
"{ \"stringField\": \"myVal\", \"numberField\": 123, \"boolField\": false, \"nestedObject\": { \"nestedObjectKey\": \"anotherValue\" }, \"dateField\": \"2018-10-12T14:00:00.000Z\" }"
version​
Long​

Current version of the CustomObject.