Includes
You can easily include resource relationships on most top-level resources. Multiple includes are defined using comma delimited values.
Each supported resource includes its own documentation on the available resources that can be included.
If there you request a resource to be includes, but no related entities of that resource type exist for your store, the response will not have any "included" section present.
Similarly, if you request to include a resource that is not supported as an include by the endpoint you are requesting from, there will be no "included" section in the response.
It is highly recommend to not include a resource if there will be more than 100 entities returned by that included resource.
There is a soft limit of five included resources per request, where one included resource could be "main_image", and another could be "categories" etc.
Below are some common include examples.
Include Category products
GET
https://api.moltin.com/v2/categories/:id?include=products
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the product |
Query Parameters
Name | Type | Description |
---|---|---|
include | string |
|
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Include product main_image
GET
https://api.moltin.com/v2/products?include=main_image
Path Parameters
Name | Type | Description |
---|---|---|
include | string |
|
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token used to access the API |
Multiple includes
GET
https://api.moltin.com/v2/products?include=main_images,category
Path Parameters
Name | Type | Description |
---|---|---|
include | string |
|
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token used to access the API |
Last updated