Zoey REST API reference ยท Interactive version: apidocs.zoey.com
Allows you to manage existing stock items. Inventory management is available only for Admin.
GET https://container-url.zoeysite.com/api/rest/inventory/location?id=1
Query parameters:
| Name | Example | Notes |
|---|---|---|
id | 1 |
Example response (Get Inventory Location):
{
"addresses": [
{
"address_id": "1",
"location_id": "1",
"firstname": "Zoey",
"lastname": "Developer",
"email": null,
"street": "123 Main St.\r\nFloor 10",
"city": "New York",
"postcode": "10019",
"region_id": "43",
"region": "New York",
"country_id": "US",
"telephone": "555-555-5555",
"fax": null,
"created_at": "2022-09-29 00:00:00",
"updated_at": "2022-09-29 00:00:00",
"full_address": "Zoey Developer, 123 Main St. Floor 10, New York, New York 10019, United States"
}
],
"created_at": "2022-09-20 22:27:26",
"customer_groups": [
"1",
"2",
"3"
],
"is_enabled": 1,
"location_id": 1,
"location_name": "Zoey Inventory Location",
"products": {
"41286": {
"qty": 11
},
"41287": {
"qty": 812
}
},
"show_qty": 1,
"updated_at": "2022-10-20 23:38:48"
}
GET https://container-url.zoeysite.com/api/rest/inventory/locations?product_id=68711
Query parameters:
| Name | Example | Notes |
|---|---|---|
product_id | 68711 | (Optional) Filter by Product |
Example response (List Inventory Locations):
[
{
"addresses": [
{
"address_id": "1",
"location_id": "1",
"firstname": "Zoey",
"lastname": "Developer",
"email": null,
"street": "123 Main St.\r\nFloor 10",
"city": "New York",
"postcode": "10019",
"region_id": "43",
"region": "New York",
"country_id": "US",
"telephone": "555-555-5555",
"fax": null,
"created_at": "2022-09-29 00:00:00",
"updated_at": "2022-09-29 00:00:00",
"full_address": "Zoey Developer, 123 Main St. Floor 10, New York, New York 10019, United States"
}
],
"created_at": "2022-09-20 22:27:26",
"customer_groups": [
"1",
"2",
"3"
],
"is_enabled": 1,
"location_id": 1,
"location_name": "Zoey Inventory Location",
"products": {
"41286": {
"qty": 11
},
"41287": {
"qty": 812
}
},
"show_qty": 1,
"updated_at": "2022-10-20 23:38:48"
},
{
"addresses": [
{
"address_id": "4",
"location_id": "2",
"firstname": "Zoey",
"lastname": "Developer",
"email": null,
"street": "111 Main St",
"city": "New York",
"postcode": "10019",
"region_id": "43",
"region": "New York",
"country_id": "US",
"telephone": "555-555-5555",
"fax": null,
"created_at": "2022-09-29 00:00:00",
"updated_at": "2022-09-29 00:00:00",
"full_address": "Zoey Developer, 111 Main St, New York, New York 10019, United States"
}
],
"created_at": "2022-10-20 23:41:14",
"customer_groups": [
"0"
],
"is_enabled": 1,
"location_id": 2,
"location_name": "Zoey Secondary Location",
"products": {
"41277": {
"qty": 1
}
},
"show_qty": 1,
"updated_at": "2022-10-20 23:41:14"
}
]
POST https://container-url.zoeysite.com/api/rest/inventory/location
Example request body:
[
{
"location_name": "Inventory Location Name",
"is_enabled": 1,
"show_qty": 1,
"customer_groups": [
1,
2
],
"products": {
"1": {
"qty": 1
},
"2": {
"qty": 20
},
"3": {
"qty": 300
}
}
}
]
Example response (Create Inventory Location):
{
"addresses": [],
"created_at": "2022-10-20 23:53:33",
"customer_groups": [
"1",
"2"
],
"is_enabled": 1,
"location_id": 1,
"location_name": "Inventory Location Name",
"products": {
"1": {
"qty": 1
},
"2": {
"qty": 20
},
"3": {
"qty": 300
}
},
"show_qty": 1,
"updated_at": "2022-10-20 23:53:33"
}
PUT https://container-url.zoeysite.com/api/rest/inventory/location
Example request body:
{
"id": 1,
"data": {
"location_name": "Inventory Location Name",
"is_enabled": 1,
"show_qty": 0,
"customer_groups": [
1,
2,
3
],
"products": {
"1": {
"qty": 1
},
"2": {
"qty": 2
},
"3": {
"qty": 321
}
}
}
}
GET https://container-url.zoeysite.com/api/rest/stockitems?page=1&limit=10
Allows you to retrieve the list of existing stock items.
The attributes that will be returned for stock items is configured in the Zoey Admin
Query parameters:
| Name | Example | Notes |
|---|---|---|
page | 1 | Used to set page for pagination. (optional) |
limit | 10 | Used to set limit for pagination. (optional) |
Example response (GetAll), HTTP 200:
[
{
"item_id": "249",
"product_id": "105",
"qty": "0.0000"
},
{
"item_id": "250",
"product_id": "106",
"qty": "998.0000"
},
{
"item_id": "251",
"product_id": "107",
"qty": "100.0000"
},
{
"item_id": "252",
"product_id": "108",
"qty": "99.0000"
},
{
"item_id": "255",
"product_id": "111",
"qty": "4.0000"
},
{
"item_id": "256",
"product_id": "112",
"qty": "97.0000"
},
{
"item_id": "257",
"product_id": "113",
"qty": "96.0000"
},
{
"item_id": "258",
"product_id": "114",
"qty": "70.0000"
},
{
"item_id": "259",
"product_id": "115",
"qty": "982.0000"
},
{
"item_id": "260",
"product_id": "116",
"qty": "0.0000"
}
]
PUT https://container-url.zoeysite.com/api/rest/stockitems
Allows you to update multiple existing stock items at once.
Example request body:
[
{
"item_id": "252",
"qty": "98"
},
{
"item_id": "472",
"qty": "98"
}
]
Example response (Update All), HTTP 207:
{
"success": [
{
"item_id": "252",
"message": "Resource updated successful.",
"code": 200
}
],
"error": [
{
"item_id": "472",
"message": "There is no Inventory on a Configurable Product, you need to update its variations.",
"code": 400
}
]
}
GET https://container-url.zoeysite.com/api/rest/stockitems/:stockItem
Allows you to retrieve the stock item information.
The list of attributes that will be returned for stock items is configured in the Zoey Admin Panel.
Example response (Get), HTTP 200:
{
"backorders": "0",
"enable_qty_increments": "0",
"is_decimal_divided": "1",
"is_in_stock": "1",
"is_qty_decimal": "1",
"item_id": "252",
"low_stock_date": null,
"manage_stock": "0",
"max_sale_qty": "0.0000",
"min_qty": "0.0000",
"min_sale_qty": "1.0000",
"notify_stock_qty": "10.0000",
"product_id": "1",
"qty": "200.0000",
"qty_increments": "0.0000",
"stock_id": "1",
"stock_status_changed_auto": "0",
"use_config_backorders": "1",
"use_config_enable_qty_inc": "1",
"use_config_manage_stock": "1",
"use_config_max_sale_qty": "1",
"use_config_min_qty": "1",
"use_config_min_sale_qty": "1",
"use_config_notify_stock_qty": "0",
"use_config_qty_increments": "1"
}
PUT https://container-url.zoeysite.com/api/rest/stockitems/:stockItem
Allows you to update existing stock item data.
Parameters - Enter only those parameters which you want to update.
Example request body:
{
"qty": 6,
"is_in_stock": 1
}
DELETE N/A
NOT ALLOWED
The DELETE method is not allowed because you cannot delete a stock item. The required stock item is deleted together with the product which it is associated to.
Example response (Get), HTTP 200:
{
"backorders": "0",
"enable_qty_increments": "0",
"is_decimal_divided": "1",
"is_in_stock": "1",
"is_qty_decimal": "1",
"item_id": "252",
"low_stock_date": null,
"manage_stock": "0",
"max_sale_qty": "0.0000",
"min_qty": "0.0000",
"min_sale_qty": "1.0000",
"notify_stock_qty": "10.0000",
"product_id": "1",
"qty": "200.0000",
"qty_increments": "0.0000",
"stock_id": "1",
"stock_status_changed_auto": "0",
"use_config_backorders": "1",
"use_config_enable_qty_inc": "1",
"use_config_manage_stock": "1",
"use_config_max_sale_qty": "1",
"use_config_min_qty": "1",
"use_config_min_sale_qty": "1",
"use_config_notify_stock_qty": "0",
"use_config_qty_increments": "1"
}