Skip to main content

Widget API

Widgets are configurable UI components that can be placed on storefront pages through the admin panel.

Endpoints

Create a Widget

Creates a new widget instance with type, area placement, and settings.

Request Schema (application/json)
Field NameField TypeRequired
typestringNo
namestringNo
statusstring or integer (0, 1, '0', '1')No
areaarray of stringNo
routearray of stringNo
sort_orderstring or integerNo
settingsobjectNo
POST/api/widgets
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/widgets
Sample Of Response
{
"data": {
"widget_id": 5,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "collection_products",
"name": "Featured Products",
"status": 1,
"setting": {
"collection": "summer-sale",
"count": 4
},
"sort_order": 10
}
}

Update a Widget

Updates an existing widget's settings, placement, or status.

Request Schema (application/json)
Field NameField TypeRequired
namestringNo
statusstring or integer (0, 1, '0', '1')No
areaarray of stringNo
routearray of stringNo
sort_orderstring or integerNo
settingsobjectNo
PATCH/api/widgets/{id}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/widgets/{id}
Sample Of Response
{
"data": {
"widget_id": 5,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Featured Products Updated",
"status": 1
}
}

Delete a Widget

Permanently removes a widget instance.

Request Schema (application/json)
No request body required
DELETE/api/widgets/{id}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/widgets/{id}
Sample Of Response
{
"data": {
"widget_id": 5,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}