Questions tagged [commercetools]

The commercetools platform is a scalabale HTTP API-based cloud eCommerce solution that allows developers to create commerce solutions for all devices and platforms

The commercetools platform is a platform-as-a-Service eCommerce solution (formerly known as SPHERE.IO).

The HTTP API is the main and first-class way for developers to work with the platform.

You can work in your favorite programming language and framework and there are SDKs for Java 8, PHP and Node.js.

Getting started:

76 questions
1
vote
1 answer

ProductProjectionByKeyGet not retrieving Channel Reference by Key

When getting product details by product key from commercetools, The response that I get does not have the Channel Key as channelId but instead I get a random UUID (I believe the reference id). final ProductProjectionByKeyGet…
Raj Kumar
  • 33
  • 1
  • 4
1
vote
2 answers

How to map a JsonNode into a java object with Commercetools SphereJsonUtils.readObjects with nested objects?

I can’t seem to work out the nested objects from a Json response. Here is my code: import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import…
Eva
  • 11
  • 2
1
vote
1 answer

How to get amount of variants across all products in a commercetools project?

How to build a query (GraphQL or regular REST endpoint) which will return the amount of variants in all products in a commercetools project? I think facets can help, but I'm not entirely sure how.
LEQADA
  • 1,913
  • 3
  • 22
  • 41
1
vote
1 answer

How can I execute graphql in java?

I have this JSON. How can I execute it to commercetools in java? String myJson = "{ "query Sphere":{ "products":{ "results":{ "masterData":{ "current":{ …
Mefisto_Fell
  • 876
  • 1
  • 10
  • 30
1
vote
1 answer

How to set default value of ProductType attribute in Commercetools platform?

I wanna to set up default value if a ProductType attribute is empty or null. This is the documentation I referred: https://commercetools.github.io/commercetools-jvm-sdk/apidocs/io/sphere/sdk/meta/ProductAttributeDocumentation.html
Mefisto_Fell
  • 876
  • 1
  • 10
  • 30
1
vote
1 answer

How to use "Like" where predicate in commerce tools

I am using commerce tools and I want to fetch data for matching result. For example: I need to fetch "keyword" by giving key only, same as we do by using like in SQL. Has anyone know any such query predicate in commerce-tools ? Thanks in advance :)
Ashish Sharma
  • 669
  • 6
  • 13
1
vote
1 answer

How to filter for localized fields in the Commercetools ProductProjectionsSearch API?

I tried to filter for the brand but never got any results back. Brand was a localized text attribute on my products. I used the following…
Philip Claren
  • 2,705
  • 3
  • 24
  • 33
1
vote
1 answer

commercetools - multiple catalogs

Doing some discovery with commercetools. I notice that in the Rest JSON message when fetching a product, there is an element : catalog. It looks to be an array. But I have not found anything in the documentation that indicates if there is an…
boyd4715
  • 551
  • 1
  • 3
  • 9
1
vote
2 answers

Which Messages are supported for subscriptions in commercetools

I'm currently playing with and validating commercetools api. I want to subscribe to a certain SQS queue, in order to push messages to this queue. However if im trying to add a subscription for a certain message type, the api…
lunatikz
  • 716
  • 1
  • 11
  • 27
1
vote
1 answer

Commercetools: How to get the type of product discount in a product?

I use the commercetools JVM SDK and query ProductProjections, how do I get the information if an absolute product discount is applied?
Dalek
  • 148
  • 8
1
vote
1 answer

"isSearchable" field limit constraint is per localized value or per attribute definition?

Current documentation states: "The max size of a searchable field is restricted to 10922 characters. This constraint is enforced at both product creation and product update. If the length of the input exceeds the maximum size an InvalidField error…
roman
  • 13
  • 3
1
vote
1 answer

commercetools: How to use getDiscountedPricePerQuantity()?

In the commercetools JVM SDK we were using the, now deprecated method, LineItem#getDiscountedPrice(), but now the LineItem#getDiscountedPricePerQuantity() method is written in the Javadoc that it should be used instead. It, however, returns a list…
Hesham Massoud
  • 1,550
  • 1
  • 11
  • 17
1
vote
1 answer

Sphere.IO : How can we set a custom attribute during product creation?

After we have created a productType and have its type id, how can we set custom attributes during product create API calling. Until now what I've been doing is 1st, create the product, then update the custom attribute. But, I am unable to do so with…
Praveen
  • 419
  • 3
  • 14
1
vote
2 answers

Commercetools Sphereio SphereClient is null

I am trying to run a simple sample of getting product details in android. I am using java sample as guide. https://github.com/sphereio/sphere-hello-api/tree/master/java SphereClient sphere = SphereClient.create( new…
mrYogi
  • 992
  • 2
  • 9
  • 29
0
votes
0 answers

How to escape this string in a graphql query

I am using CommerceTools GraphQL custom fields, which need to be escaped strings, the graphql tooling I am using is gql and URQL's Mutation component the following query works in CT's playground. mutation AddCustomerName { updateCustomer( …
user254694
  • 1,461
  • 2
  • 23
  • 46