Product API
The Product API allows you to programmatically manage products in your EverShop store. This RESTful interface provides endpoints for creating, updating, retrieving, and deleting products.
Endpoints
Create a Product
Creates a new product in your EverShop store with the specified attributes.
| Field Name | Field Type | Required | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | No | ||||||||||||||||||||||||||||||
| description | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| short_description | string | No | ||||||||||||||||||||||||||||||
| url_key | string (^\S+$) | No | ||||||||||||||||||||||||||||||
| meta_title | string | No | ||||||||||||||||||||||||||||||
| meta_description | string | No | ||||||||||||||||||||||||||||||
| meta_keywords | string | No | ||||||||||||||||||||||||||||||
| status | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| sku | string | No | ||||||||||||||||||||||||||||||
| price | string or number | No | ||||||||||||||||||||||||||||||
| weight | string or number | No | ||||||||||||||||||||||||||||||
| qty | string or number | No | ||||||||||||||||||||||||||||||
| tax_class | string or number or null | No | ||||||||||||||||||||||||||||||
| manage_stock | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| stock_availability | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| group_id | string or integer | No | ||||||||||||||||||||||||||||||
| visibility | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| images | array of string | No | ||||||||||||||||||||||||||||||
| attributes | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| category_id | string or number or null | No | ||||||||||||||||||||||||||||||
| options | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| metafields | object | No | ||||||||||||||||||||||||||||||
| duplicate_of | string | No | ||||||||||||||||||||||||||||||
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/products
fetch('https://<your domain>/api/products', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"product_id": 281,
"uuid": "99a7b39ca63211edb46b60d819134f39",
"variant_group_id": null,
"visibility": 1,
"group_id": 4,
"image": null,
"sku": "Q7Oq0kxZIMQ5isUyJRbg",
"price": 43,
"qty": 123,
"weight": 17,
"manage_stock": 1,
"stock_availability": 1,
"tax_class": null,
"status": 0,
"created_at": "2023-02-07 00:01:46",
"updated_at": "2023-02-07 00:01:46",
"product_description_id": 351,
"product_description_product_id": 281,
"name": "Q7Oq0kxZIMQ5isUyJRbg",
"description": null,
"short_description": null,
"url_key": "Q7Oq0kxZIMQ5isUyJRbg",
"meta_title": "Q7Oq0kxZIMQ5isUyJRbg",
"meta_description": null,
"meta_keywords": null,
"links": [
{
"rel": "productGrid",
"href": "/admin/products",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/product/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/products/edit/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}
Update a Product
Updates an existing product with new attribute values.
| Field Name | Field Type | Required | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | No | ||||||||||||||||||||||||||||||
| description | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| short_description | string | No | ||||||||||||||||||||||||||||||
| url_key | string (^\S+$) | No | ||||||||||||||||||||||||||||||
| meta_title | string | No | ||||||||||||||||||||||||||||||
| meta_description | string | No | ||||||||||||||||||||||||||||||
| meta_keywords | string | No | ||||||||||||||||||||||||||||||
| status | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| sku | string | No | ||||||||||||||||||||||||||||||
| price | string or number | No | ||||||||||||||||||||||||||||||
| weight | string or number | No | ||||||||||||||||||||||||||||||
| qty | string or number | No | ||||||||||||||||||||||||||||||
| tax_class | string or number or null | No | ||||||||||||||||||||||||||||||
| manage_stock | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| stock_availability | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| group_id | string or integer | No | ||||||||||||||||||||||||||||||
| visibility | integer or string or boolean (0, 1, '0', '1', true, false) | No | ||||||||||||||||||||||||||||||
| images | array of string | No | ||||||||||||||||||||||||||||||
| attributes | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| category_id | string or number or null | No | ||||||||||||||||||||||||||||||
| options | array of object | No | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| metafields | object | No | ||||||||||||||||||||||||||||||
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"product_id": 281,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"variant_group_id": null,
"visibility": 1,
"group_id": 4,
"image": null,
"sku": "Q7Oq0kxZIMQ5isUyJRbg",
"price": 43,
"qty": 123,
"weight": 17,
"manage_stock": 1,
"stock_availability": 1,
"tax_class": null,
"status": 0,
"created_at": "2023-02-07 00:01:46",
"updated_at": "2023-02-07 00:01:46",
"product_description_id": 351,
"product_description_product_id": 281,
"name": "Q7Oq0kxZIMQ5isUyJRbg",
"description": null,
"short_description": null,
"url_key": "Q7Oq0kxZIMQ5isUyJRbg",
"meta_title": "Q7Oq0kxZIMQ5isUyJRbg",
"meta_description": null,
"meta_keywords": null,
"links": [
{
"rel": "productGrid",
"href": "/admin/products",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/product/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/products/edit/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| id | string | The UUID of the product to update | Yes |
Update Parameters
All parameters are optional for updates. Only include the parameters you want to modify. See the Create a Product section for detailed parameter descriptions.
duplicate_of is accepted only on create — it has no meaning on update.
Metafields
Both create and update accept a metafields object. It is keyed namespace → key → value: the outer key is the definition's namespace (custom unless you set another), the inner key is the definition's key. Values are validated against each definition's type and validations, then folded into the product's meta_data column.
{
"name": "Lite racer adapt 3.0 shoes",
"sku": "NJC90842",
"metafields": {
"custom": {
"care_instructions": "Machine wash cold",
"warranty_months": 24
}
}
}
Validation reads each value at input[definition.namespace][definition.key]. Passing
{ "care_instructions": "..." } without the namespace level means nothing is found, so
optional fields are written as empty and any required definition fails the request
with "custom.care_instructions" is required.
Omitting metafields leaves meta_data untouched — the fold runs only when the key is explicitly present, so a partial update never wipes existing values. Sending a value that fails its definition's validation fails the whole request.
The same field is available on POST/PATCH for categories and collections, scoped to the category and collection owner types respectively.
Delete a Product
Removes a product from your EverShop store.
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"product_id": 281,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"variant_group_id": null,
"visibility": 1,
"group_id": 4,
"image": null,
"sku": "skuUpdated",
"price": 45,
"qty": 123,
"weight": 17,
"manage_stock": 1,
"stock_availability": 1,
"tax_class": null,
"status": 1,
"created_at": "2023-02-07 00:01:46",
"updated_at": "2023-02-07 00:01:46",
"product_description_id": null,
"product_description_product_id": null,
"name": null,
"description": null,
"short_description": null,
"url_key": null,
"meta_title": null,
"meta_description": null,
"meta_keywords": null
}
}
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| id | string | The UUID of the product to delete | Yes |
Get Product Data with GraphQL
EverShop uses GraphQL for querying product data. For detailed information on how to query products, refer to the GraphQL API documentation.