- Help center home
- Getting started
- Content model
- Managing content
- Working with entries
- Working with media
- Working with translations
- Managing users
- Roles
- Account settings
- Administration
- Experiences
- Content orchestration
- Compose
- Launch
- Workflows
- Guides
- Certification and training
- Contentful glossary
- Manage cookie consent
- Apps
- Usage Limit
- Marketplace
- How to get help and support
- Knowledge Base
External references with commercetools
On this page
Overview
You can integrate External references with commercetools. With External references you can retrieve commercetools products and product categories through the Contentful GraphQL API. This way, you can get all the information you need in a single API call to create a great customer experience.
Enable External references for commercetools
To enable External references for commercetools:
Configure your commercetools project.
Log in to the Contentful web app.
Install the commercetools app in the Contentful web app.
Configure the credentials needed inside the Contentful commercetools App configuration screen. For more information on how to set up the credentials, see step 2 of the commercetools page.
Navigate to the “Content model” tab and select the content type you want to retrieve data from with External references.
Click +Add field and add a new field of type “Text”.
In the "Appearance" section, under "Choose how this field should be displayed", select commercetools.
Select the Resolve content on delivery check box.
Click Confirm.
Save your changes.
Query commercetools data in Contentful using the GraphQL API
To query Shopify data in Contentful using the GraphQL API:
Open your preferred GraphQL client or use an online IDE. You can also use our GraphQL Playground app.
Insert the following GraphQL query as an example, replacing "ENTRY_ID" with the ID of the product you want to query:
markdown{ topicProduct(id: "ENTRY_ID") { sys { id spaceId } thirdPartyReferenceFieldName thirdPartyReferenceFieldName_data { title description } } }
Run the query.
For more information on adjusting your GraphQL API queries and possible errors, see the technical External references and GraphQL API documentation.