Get All Products
This API endpoint retrieves a list of products from the server.
HTTP Request
- URL:
/products - Method:
GET - Headers:
accessToken: Required. This is your access token for authenticating the request.
Query Parameters
To effectively use pagination in your API requests, you can include the following query parameters:
| Parameter | Type | Description |
|---|---|---|
page | Integer | The page number to retrieve. Default is 1. |
limit | Integer | The number of items to retrieve per page. Default is 10 |
entityId | String | Comma-separated list of entity IDs to include. |
status | String | Comma-separated list of product statuses to include, such as "active" or "inactive". |
name | String | Filter products where the name matches the provided case-insensitive substring. |
sku | String | Filter products where the SKU matches the provided case-insensitive substring. |
isFeatured | Boolean | Filter products based on whether they are featured. |
isFreeShipping | Boolean | Filter products based on whether they offer free shipping. |
minPrice | Number | Include products with a price greater than or equal to this value. |
maxPrice | Number | Include products with a price less than or equal to this value. |
date_created:min | String | Include products created on or after this date (ISO format). |
date_created:max | String | Include products created on or before this date (ISO format). |
date_modified:min | String | Include products modified on or after this date (ISO format). |
date_modified:max | String | Include products modified on or before this date (ISO format). |
categories | String | Comma-separated list of category IDs to include. |
excludeFields | String | Comma-separated list of fields to exclude from the response. |
sku:in | String | Comma-separated list of SKUs to include. |
outOfStock | Boolean | Filter products based on stock status; true for out of stock items, false for items in stock. |
cURL Example
Below is a sample cURL command that demonstrates how to make a request to the API endpoint:
curl --location '<BASE_URL>/products' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The request was successful, and the server returned a list of products.
- 4XX: Client errors indicating issues such as an invalid access token.
- 5XX: Server errors indicating that something went wrong on the server's end.
Sample JSON Response
Below is an example of the JSON response you might receive from making a request to this endpoint:
{
"success": true,
"data": [
{
"entityId": 1,
"name": "Marcal 1-Ply Lunch Napkin",
"sku": "MAR 270",
"description": {
"value": "<ul>\r\n\t<li>Conveniently packaged in Draw and Store Reclosable Bag—remove napkins as needed, others stay clean and ready for use.</li>\r\n\t<li>One-ply.</li>\r\n\t<li>Strong and absorbent.</li>\r\n\t<li>Whitened without chemicals containing chlorine.</li>\r\n\t<li>No dye or fragrance added.</li>\r\n</ul>"
},
"shortDescription": "",
"specifications": [
{
"name": "Supplier Part Number",
"value": "MRC6506",
"_id": "67bb23803b6220fb83f2a1c3"
},
{
"name": "Manufacturer Name",
"value": "R3 Metro",
"_id": "67bb23803b6220fb83f2a1c4"
},
{
"name": "Material",
"value": "Paper",
"_id": "67bb23803b6220fb83f2a1c5"
},
{
"name": "Colour",
"value": "White",
"_id": "67bb23803b6220fb83f2a1c6"
},
{
"name": "P21 Product Group",
"value": "FOODSVR",
"_id": "67bb23803b6220fb83f2a1c7"
},
{
"name": "Dimensions",
"value": "12.50 x 11.25",
"_id": "67bb23803b6220fb83f2a1c8"
},
{
"name": "Per Case",
"value": "6 packs",
"_id": "67bb23803b6220fb83f2a1c9"
},
{
"name": "Ply",
"value": "1",
"_id": "67bb23803b6220fb83f2a1ca"
},
{
"name": "Unfolded Width",
"value": "12.5 in",
"_id": "67bb23803b6220fb83f2a1cb"
},
{
"name": "Folded Width",
"value": "5.4 in",
"_id": "67bb23803b6220fb83f2a1cc"
},
{
"name": "Standards Certifications",
"value": "Meets or exceeds all EPA Procurement Guidelines for post-consumer recycled content",
"_id": "67bb23803b6220fb83f2a1cd"
},
{
"name": "Per Pack",
"value": "400 sheets",
"_id": "67bb23803b6220fb83f2a1ce"
},
{
"name": "Weight",
"value": "27 Pound",
"_id": "67bb23803b6220fb83f2a1cf"
},
{
"name": "Serialized",
"value": "No",
"_id": "67bb23803b6220fb83f2a1d0"
},
{
"name": "Post Recycling",
"value": "60",
"_id": "67bb23803b6220fb83f2a1d1"
},
{
"name": "Total Recycle",
"value": "100",
"_id": "67bb23803b6220fb83f2a1d2"
}
],
"customUrl": "marcal-1-ply-lunch-napkin.html",
"status": "active",
"visibility": true,
"weight": 27,
"productType": "simple",
"hasOptions": false,
"manufacturer": "R3 Metro",
"quantity": {
"minQuantity": 1,
"quantityIncrement": 1
},
"trackInventory": true,
"inventoryType": "product",
"isFeatured": false,
"price": 73.67,
"priceRange": {
"minPrice": 0,
"maxPrice": 0
},
"options": [
{
"optionName": "Unit",
"optionType": "radio",
"optionValues": [
{
"label": "Case",
"value": "CS",
"isDefault": true,
"_id": "67bb23803b6220fb83f2a1da"
}
],
"_id": "67bb23803b6220fb83f2a1d9"
}
],
"variants": [
{
"sku": "MAR 270-CS",
"name": "Case",
"price": 73.67,
"options": [
{
"optionName": "Unit",
"optionValueLabel": "Case",
"optionValue": "CS",
"_id": "67bb23803b6220fb83f2a1dc"
}
],
"isActive": true,
"_id": "6467310ca958a8afea2a510a",
"mediaGallery": [],
"tierPrice": []
}
],
"isFreeShipping": false,
"manageCustoms": false,
"customs": {
"hsCodes": []
},
"metaFields": [
{
"customMetaField": true,
"metaFieldId": "6464ea3163ef8fa8543a5123",
"code": "pim_id",
"label": "PIM Id",
"displayStorefront": true,
"value": "8",
"valueType": "text",
"_id": "67bb23803b6220fb83f2a1d3",
"createdAt": "2025-02-23T13:32:48.609Z",
"updatedAt": "2025-02-23T13:32:48.609Z"
},
{
"customMetaField": true,
"metaFieldId": "6464ea4102e928e393250b16",
"code": "p21_product_group",
"label": "P21_product_group",
"displayStorefront": true,
"value": "FOODSVR",
"valueType": "text",
"_id": "67bb23803b6220fb83f2a1d4",
"createdAt": "2025-02-23T13:32:48.609Z",
"updatedAt": "2025-02-23T13:32:48.609Z"
},
{
"customMetaField": true,
"metaFieldId": "6464ea570c85ddcad86386cd",
"code": "inv_mast_uid",
"label": "Inv_mast_uid",
"displayStorefront": true,
"value": "2800",
"valueType": "text",
"_id": "67bb23803b6220fb83f2a1d5",
"createdAt": "2025-02-23T13:32:48.609Z",
"updatedAt": "2025-02-23T13:32:48.609Z"
},
{
"customMetaField": true,
"metaFieldId": "6464ea3163ef8fa8543a5123",
"code": "pim_id",
"label": "PIM Id",
"displayStorefront": true,
"value": "8",
"valueType": "text",
"_id": "67bb23803b6220fb83f2a1d6",
"createdAt": "2025-02-23T13:32:48.609Z",
"updatedAt": "2025-02-23T13:32:48.609Z"
},
{
"customMetaField": true,
"metaFieldId": "6464ea4102e928e393250b16",
"code": "p21_product_group",
"label": "P21_product_group",
"displayStorefront": true,
"value": "FOODSVR",
"valueType": "text",
"_id": "67bb23803b6220fb83f2a1d7",
"createdAt": "2025-02-23T13:32:48.609Z",
"updatedAt": "2025-02-23T13:32:48.609Z"
},
{
"customMetaField": true,
"metaFieldId": "6464ea570c85ddcad86386cd",
"code": "inv_mast_uid",
"label": "Inv_mast_uid",
"displayStorefront": true,
"value": "2800",
"valueType": "text",
"_id": "67bb23803b6220fb83f2a1d8",
"createdAt": "2025-02-23T13:32:48.609Z",
"updatedAt": "2025-02-23T13:32:48.609Z"
}
],
"searchKeyWords": [],
"categories": ["6467308fa958a8afea2a4841"],
"mediaGallery": [
{
"url": "https://cdn.flexipim.com/spruceindustries/product_assets/media/1617637011_243327.JPG",
"type": "image",
"label": "1617637011_243327.JPG",
"isDefault": true,
"assetId": null,
"id": "67cfc833a1265850a220f752"
}
],
"files": [],
"modifiers": [],
"filters": [],
"relatedProducts": [],
"createdAt": "2023-05-19T08:19:25.659Z",
"updatedAt": "2025-03-11T05:20:51.967Z",
"inventory": {
"stock": 0
},
"id": "6467310ca958a8afea2a50f7"
}
],
"pagination": {
"page": 1,
"total": 924,
"count": 1
}
}
Response Details
| Key | Type | Description |
|---|---|---|
success | Boolean | Indicates if the request was successful. |
data | Array of Objects | List of products. |
pagination | Object | Provides pagination details given below. |
Products Data
| Field | Type | Description |
|---|---|---|
id | String | The ID of the product. |
entityId | Number | Unique identifier for the product. mostly in sequence |
name | String | Name of the product. [Required] |
sku | String | Stock Keeping Unit, a unique identifier for each product. |
shortDescription | String | A brief description of the product. |
description | Object | A brief description of the product. |
customUrl | String | SEO-friendly URL for the product. |
status | String | Status of the product, can be "active" or "inactive". Default is "active". [Required] |
specifications | Array of Objects | Specifications of the product with name and value. |
mediaGallery | Array of Objects | An array of media items. |
files | Array of Objects | An array of documents or videos. |
dimensions | Object | The dimensions of the product, includes width, height, and depth. |
inventory | Object | Object contain stock and minStock. |
visibility | Boolean | Indicates if the product is visible. Default is true. |
quantity | Object | Object contain minQuantity and quantityIncrement |
priceRange | Object | Object contain minPrice and minStock |
options | Array of Objects | An array of options for products eg: size ,color etc., |
variants | Array of Objects | Array of variant objects related to the product. |
weight | Number | Weight of the product. Default is 0. |
productType | String | Type of product, can be "simple" or "configurable" or "grouped" or "bundle". |
hasOptions | Boolean | Indicates if the product has options. Default is false. |
taxcode | String | Tax code associated with the product. |
manufacturer | String | Manufacturer's name. |
mpn | String | Manufacturer Part Number. |
trackInventory | Boolean | Indicates if inventory tracking is enabled. Default is false. |
inventoryType | String | Inventory management type, either "product" or "variant". Default is "product". |
isFeatured | Boolean | Indicates if the product is featured. Default is false. |
ratings | Number | Rating of the product. Default is 0. |
price | Number | Price of the product. |
cost | Number | Cost of the product. |
sale | Number | Sale price of the product. |
isFreeShipping | Boolean | Indicates if the product is eligible for free shipping. Default is false. |
manageCustoms | Boolean | Indicates if customs management is enabled. Default is false. |
metaFields | array | Array of meta field objects associated with the product. |
sortOrder | Number | The order in which products are sorted. |
Description Object
| Field | Type | Description |
|---|---|---|
dataType | String | Format of the description, either "JSON" or "HTML". Default is "HTML". |
value | String | The actual product description in specified format. |
Specifications
| Field | Type | Description |
|---|---|---|
name | String | Name of the specification. |
value | String | Value of the specification. |
Dimensions
| Field | Type | Description |
|---|---|---|
width | Number | Width of the product. Default is 1. |
height | Number | Height of the product. Default is 1. |
depth | Number | Depth of the product. Default is 1. |
Variants Array
| Field | Type | Description |
|---|---|---|
sku | string | SKU for the variant. |
name | string | Name of the variant. |
price | number | Price of the variant. |
options | array | Array of variant-specific options. |
isActive | boolean | Indicates if the variant is active. |
_id | string | Unique identifier for the variant. |
Quantity
| Field | Type | Description |
|---|---|---|
minQuantity | Number | Minimum quantity required. Default is 1. |
quantityIncrement | Number | Increment in quantity. Default is 1. |
Media Gallery
| Field | Type | Description |
|---|---|---|
type | String | Type of media, such as image or video. |
format | String | Format of the media file. |
name | String | Name of the media file. |
url | String | URL where the media file is located. |
Files
| Field | Type | Description |
|---|---|---|
type | String | Type of file, e.g., document, image, video. Default is "document". |
format | String | Format of the file, identifying the file type. |
name | String | File name for reference. |
url | String | Access URL for the file. |
Inventory
| Field | Type | Description |
|---|---|---|
stock | Number | Current stock level. |
minStock | Number | Minimum stock level to maintain. |
Price Range
| Field | Type | Description |
|---|---|---|
minPrice | Number | Minimum price within the range. |
maxPrice | Number | Maximum price within the range. |
Options
| Field | Type | Description |
|---|---|---|
optionName | String | Name of the option. |
optionType | String | Type of option, e.g., color, dropdown, radio, etc. |
optionValues | Array of Objects | Values associated with this option. |
Option Values Structure
| Field | Type | Description |
|---|---|---|
label | string | Label for the option value. |
value | string | Value corresponding to the option. |
isDefault | boolean | Indicates if this is the default option value. |
_id | string | Unique identifier for the option value. |
Customs
| Field | Type | Description |
|---|---|---|
countryCode | String | Code representing the country for customs. |
commodityDescription | String | Description of the commodity for customs purposes. |
hsCodes | Array of Objects | HsCode details with country and code. |
Filters
| Field | Type | Description |
|---|---|---|
code | String | Code for filter criteria. [Required] |
label | String | Label for the filter. [Required] |
options | Array of Objects | Options available under filter criteria. |
SEO
| Field | Type | Description |
|---|---|---|
pageTitle | String | Title to be optimized for SEO purposes. |
metaKeywords | String | Keywords to enhance searchability. |
metaDescription | String | Description meta-tag for SEO. |
MetaFields Array
| Field | Type | Description |
|---|---|---|
customMetaField | boolean | Indicates if it's a custom-defined meta field. |
metaFieldId | string | Unique identifier for the meta field. |
code | string | Code representing the meta field. |
label | string | Human-readable label of the meta field. |
displayStorefront | boolean | Determines if the meta field is displayed on the storefront. |
value | string | Actual value of the meta field. |
valueType | string | Data type of the value (e.g., "text", "number"). |
_id | string | Unique identifier for the meta field instance. |
createdAt | string | ISO 8601 formatted timestamp indicating when the meta field was created. |
updatedAt | string | ISO 8601 formatted timestamp indicating when the meta field was last updated. |
Related Products
| Field | Type | Description |
|---|---|---|
code | String | Code associated with related product. |
label | String | Label describing the relation. |
products | Array of Objects | Related products referencing the "Product" schema. |
Grouped Products
| Field | Type | Description |
|---|---|---|
productId | String | Identifier of the grouped product. |
quantity | Number | Quantity of the product within the group. |
dynamicQuantity | Boolean | Whether the quantity can dynamically change. |
Bundled Products
| Field | Type | Description |
|---|---|---|
optionTitle | String | Title of the bundled option. |
inputType | String | Input type for the bundled option. |
isRequired | Boolean | Indicates if the bundled product option is mandatory. Default is false. |
bundledItems | Array of Objects | Items included within the bundle configuration. |
Pagination Details
| Key | Type | Description |
|---|---|---|
page | Integer | Current page number. |
total | Integer | Total number of items available. |
count | Integer | Number of items returned in this response. |
Notes
- Ensure that the
accessTokenprovided is valid and has not expired. - For production use, ensure URL is accessible and has appropriate security measures in place.