RESTQL API
Base URL
Production:
https://storemate.clistech.com/restqlapi
Local:
http://127.0.0.1:8000/restqlapi
All RESTQL endpoints require JWT auth:
Authorization: Bearer <access_token>
Use the access token from POST /api/auth/login/.
RESTQL Query Parameter
Endpoints backed by django-restql accept a query parameter to shape the response fields.
Default:
GET /restqlapi/products/records/
Projected response:
GET /restqlapi/products/records/?query={id,label,model,app}
Nested response projection is supported on serializers that expose nested fields:
GET /restqlapi/products/records-one-shot/?query={id,name,tags{label,values{value}},variants{name,sku,barcode,images,tags{label,value}}}
For nested mutations, Storemate follows django-restql's operation-map pattern:
create: create and attach nested rowsupdate: update nested rows by iddelete: delete nested rows by id
Reference: https://yezyilomo.github.io/django-restql/mutating_data/
Record Discovery Endpoints
These endpoints return lightweight records with:
idlabelmodelapp
| App | Method | URL |
|---|---|---|
| Accounts | GET | /restqlapi/accounts/records/ |
| Curation | GET | /restqlapi/curation/records/ |
| Inventory | GET | /restqlapi/inventory/records/ |
| Payments | GET | /restqlapi/payments/records/ |
| Products | GET | /restqlapi/products/records/ |
| Reports | GET | /restqlapi/reports/records/ |
| Support | GET | /restqlapi/support/records/ |
| Teams | GET | /restqlapi/teams/records/ |
| Transactions | GET | /restqlapi/transactions/records/ |
Example:
curl "https://storemate.clistech.com/restqlapi/products/records/?query={id,label}" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
Product One-Shot Endpoints
These endpoints are also mounted under /restqlapi/products/ for clients that need compact product create, read, update, and delete flows.
| Action | Method | URL |
|---|---|---|
| List products | GET | /restqlapi/products/records-one-shot/ |
| Get product | GET | /restqlapi/products/{product_id}/record-one-shot/ |
| Create product | POST | /restqlapi/products/create-one-shot/ |
| Patch product | PATCH | /restqlapi/products/{product_id}/patch-one-shot/ |
| Delete product | DELETE | /restqlapi/products/{product_id}/record-one-shot/ |
| List product families | GET | /restqlapi/products/families/records-one-shot/ |
| Get product family | GET | /restqlapi/products/families/{family_id}/record-one-shot/ |
| Create product family | POST | /restqlapi/products/families/create-one-shot/ |
| Patch product family | PATCH | /restqlapi/products/families/{family_id}/patch-one-shot/ |
| Delete product family | DELETE | /restqlapi/products/families/{family_id}/record-one-shot/ |
Product Create Payload
{
"product_name": "Industrial Servo Motor",
"supplier": "Acme",
"description": "Compact high torque motor",
"category": "Automation",
"base_unit": "pcs",
"tags": [
{ "label": "Size", "values": ["Small", "Medium"] },
{ "label": "Finish", "values": ["Default"] }
],
"variants": [
{
"name": "Small / Default",
"sku": "SERVO-SM",
"barcode": "SERVO-SM",
"tags": [
{ "label": "Size", "value": "Small" },
{ "label": "Finish", "value": "Default" }
]
}
]
}
Example:
curl -X POST "https://storemate.clistech.com/restqlapi/products/create-one-shot/?query={id,name,variants{name,sku}}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product_name": "Industrial Servo Motor",
"supplier": "Acme",
"category": "Automation",
"tags": [{"label": "Size", "values": ["Small"]}],
"variants": [{"name": "Small", "sku": "SERVO-SM", "barcode": "SERVO-SM", "tags": [{"label": "Size", "value": "Small"}]}]
}'
Multipart Image Upload
For product create or patch with variant images, send multipart/form-data:
payload: JSON string using the product payload shape abovevariants[0][images]: one or more files for variant index0; returned under each variant'simagesfieldvariants[1][images]: one or more files for variant index1
This legacy list shape is stable and still replaces the images for that variant when supplied.
Variant images also accept a RESTQL-style mutation object. On create, only create is supported:
{
"product_name": "Industrial Servo Motor",
"supplier": "Acme",
"variants": [
{
"name": "Small",
"sku": "SERVO-SM",
"images": {
"create": [
{ "image": "<file>", "alt_text": "Front view", "is_primary": true },
{ "image": "<file>", "alt_text": "Side view" }
]
}
}
]
}
For multipart RESTQL image creates, keep the JSON in payload and attach files by operation index:
variants[0][images][create][0][image]
variants[0][images][create][1][image]
On patch, image operations support create, update, and delete:
{
"variants": [
{
"sku": "SERVO-SM",
"images": {
"create": [{ "image": "<file>", "alt_text": "Back view" }],
"update": { "12": { "alt_text": "Primary front view", "is_primary": true } },
"delete": [13]
}
}
]
}
remove and add are intentionally not enabled for variant images because product images are owned by exactly one variant in this schema.
Product Family Payload
{
"name": "Beverage",
"description": "Food and drink products"
}
Create:
curl -X POST "https://storemate.clistech.com/restqlapi/products/families/create-one-shot/" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Beverage","description":"Food and drink products"}'
Profile Scope
The RESTQL product endpoints use the active profile middleware. For team-scoped requests, include the same profile headers used by the main API:
X-Profile-Type: team
X-Team-Id: <team_id>
For personal scope:
X-Profile-Type: self