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.
Create a Product
Creates a new product in your EverShop store with the specified attributes.
Request Schema (application/json)
| Field Name | Field Type | Required | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | Yes | |||||||||||||||||||||||||||
| description | string | No | |||||||||||||||||||||||||||
| short_description | string | No | |||||||||||||||||||||||||||
| url_key | string (^\S+$) | Yes | |||||||||||||||||||||||||||
| meta_title | string | Yes | |||||||||||||||||||||||||||
| meta_description | string | No | |||||||||||||||||||||||||||
| meta_keywords | string | No | |||||||||||||||||||||||||||
| status | integer or string (0, 1, '0', '1') | Yes | |||||||||||||||||||||||||||
| sku | string | Yes | |||||||||||||||||||||||||||
| price | string or number | Yes | |||||||||||||||||||||||||||
| weight | string or number | Yes | |||||||||||||||||||||||||||
| qty | string or number | Yes | |||||||||||||||||||||||||||
| manage_stock | string or number (0, 1, '0', '1') | No | |||||||||||||||||||||||||||
| stock_availability | string or number (0, 1, '0', '1') | No | |||||||||||||||||||||||||||
| group_id | string or integer | Yes | |||||||||||||||||||||||||||
| visibility | integer or string (0, 1, '0', '1') | Yes | |||||||||||||||||||||||||||
| images | array of string | No | |||||||||||||||||||||||||||
| attributes | array of object | No | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| category_id | string or integer or null | No | |||||||||||||||||||||||||||
| options | array of object | No | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
POST/api/products
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/products
fetch('https://<your domain>/api/products', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"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/Q7Oq0kxZIMQ5isUyJRbg",
"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.
Request Schema (application/json)
| Field Name | Field Type | Required | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | No | |||||||||||||||||||||||||||||||||
| description | string | 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 (0, 1, '0', '1') | No | |||||||||||||||||||||||||||||||||
| sku | string | No | |||||||||||||||||||||||||||||||||
| price | string or number | No | |||||||||||||||||||||||||||||||||
| weight | string or number | No | |||||||||||||||||||||||||||||||||
| qty | string or number | No | |||||||||||||||||||||||||||||||||
| manage_stock | string or number (0, 1, '0', '1') | No | |||||||||||||||||||||||||||||||||
| stock_availability | string or number (0, 1, '0', '1') | No | |||||||||||||||||||||||||||||||||
| group_id | string or integer | No | |||||||||||||||||||||||||||||||||
| visibility | integer or string (0, 1, '0', '1') | No | |||||||||||||||||||||||||||||||||
| images | array of string | No | |||||||||||||||||||||||||||||||||
| attributes | array of object | No | |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| categories | array of string,integer | No | |||||||||||||||||||||||||||||||||
| options | array of object | No | |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
PATCH/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
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',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"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/Q7Oq0kxZIMQ5isUyJRbg",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/products/edit/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The UUID of the product to update |
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.
Delete a Product
Removes a product from your EverShop store.
Request Schema (application/json)
No request body requiredDELETE/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
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',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"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 | Required | Description |
|---|---|---|---|
| id | string | Yes | The UUID of the product to delete |
Get a Product
Retrieves detailed information about a specific product.
Request Schema (application/json)
No request body requiredGET/api/products/433ba97f-8be7-4be9-be3f-a9f341f2b89f
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
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',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"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,
"images": [],
"attributes": [],
"options": [],
"categories": [],
"links": [
{
"rel": "productGrid",
"href": "/admin/products",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/product/Q7Oq0kxZIMQ5isUyJRbg",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/products/edit/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The UUID of the product to retrieve |
List Products
Retrieves a paginated list of products from your EverShop store.
Request Schema (application/json)
No request body requiredGET/api/products
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/products
fetch('https://<your domain>/api/products', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"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",
"name": "Q7Oq0kxZIMQ5isUyJRbg",
"url_key": "Q7Oq0kxZIMQ5isUyJRbg",
"links": [
{
"rel": "view",
"href": "/product/Q7Oq0kxZIMQ5isUyJRbg",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/products/edit/99a7b39ca63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
},
// More products...
],
"total": 42,
"currentPage": 1,
"limit": 20,
"links": [
{
"rel": "first",
"href": "/api/products?page=1",
"action": "GET"
},
{
"rel": "last",
"href": "/api/products?page=3",
"action": "GET"
},
{
"rel": "next",
"href": "/api/products?page=2",
"action": "GET"
}
]
}
Best Practices
- Rate Limiting: Be mindful of API rate limits to avoid being throttled.
- Batch Processing: For bulk operations, consider creating products in batches.
- Error Handling: Always implement proper error handling for API responses.
- Unique SKUs: Ensure all products have unique SKUs to avoid conflicts.
- Image URLs: For product images, provide publicly accessible URLs.
Troubleshooting
Common Error Codes
| Status Code | Description | Solution |
|---|---|---|
| 400 | Bad Request | Check your request payload for invalid data |
| 401 | Unauthorized | Ensure your API credentials are correct |
| 404 | Not Found | Verify the product ID exists |
| 409 | Conflict | The SKU or URL key may already be in use |
| 429 | Too Many Requests | Reduce your API call frequency |
| 500 | Server Error | Contact support if the issue persists |