Public API
Acrium exposes a small external API so a project owner can pull their own store data programmatically. It's separate from the browser-facing dashboard routes and is authenticated by API key rather than session cookie.
Getting an API key
- In the dashboard, go to Settings → API. This requires the
manage_api_keyscapability on the project. - Click Generate (
POST /settings/api/generate-api-key, rate-limited to 5/minute). The plaintext key is shown once — copy it now. Only its bcrypt hash is stored server-side (on theprojectsrow), so it can't be recovered later. GET /settings/api/api-key-statusreturns{api_id, has_key}for the active project, so the dashboard can show whether a key currently exists.- Revoke (
POST /settings/api/revoke-api-key, rate-limited 5/minute) invalidates the current key immediately. Generating a new key also replaces the old one.
api_id is the project's project_id. You'll need both api_id and
api_key for every call below.
Making a request
POST /api/v1/
Content-Type: application/json
{
"api_id": "<project_id>",
"api_key": "<plaintext key from generation>",
"request_type": "grab_products",
"requested_data": ["sku", "name"]
}
- The route is CSRF-exempt (key-authenticated, not cookie-authenticated) and rate-limited to 10/minute.
requested_datais always a list of strings; what it means depends onrequest_type(see below).- On success, the response body is whatever the underlying
request_typereturns (a list or object). There is no separate envelope/wrapper.
Errors
| Status | Cause |
|---|---|
| 400 | requested_data missing, request_type not recognized, or requested_data doesn't match what that request_type expects (e.g. wrong number of items). |
| 401 | api_id/api_key don't match an active key. |
| 500 | Unexpected server-side failure while handling the request. |
Note: requesting a column name that doesn't exist on the underlying table
returns 200 with {"error": "..."} in the body rather than a 4xx — check
the response body, not just the status code, for that case.
Request types
There is no separate products table — a project's items live entirely in
inventory, and category is the grouping mechanism (there is no
product_id anymore). All three request types below read from inventory;
grab_products/grab_single_product are kept as names for compatibility but
now behave the same as grab_single_inventory.
Available columns on every request type: sku_id, project_id,
user_email, sku, name, description, quantity, unit, price,
cost, category, low_stock_threshold, location, created_at,
updated_at, images.
images and location are stored as JSON text, and come back as a
JSON-encoded string, not an array — e.g. "images": "[\"...\"]"
and "location": "[]". Decode them yourself (JSON.parse / json.loads)
before use.
grab_products
Returns every inventory item for the project.
requested_data: column names to include (see list above).- Response: a list of objects (one per item), each containing only the
requested columns, e.g.
[{"name": "Widget", "category": "Tools"}, ...].
grab_single_product
Returns one inventory item by SKU.
requested_data:[sku, ...columns]— the item's SKU, followed by the columns you want back.- Response: an object with the requested columns, e.g.
{"name": "Widget", "category": "Tools"}, or{"error": "Product not found."}if no matching item exists for the project.
grab_single_inventory
Returns one inventory item by SKU. Identical behavior to
grab_single_product above — both are kept as separate request types for
compatibility with existing integrations.
requested_data:[sku, ...columns]— the item's SKU, followed by the columns you want back.- Response: an object with the requested columns, e.g.
{"sku": "WIDGET-1", "quantity": 42}, or{"error": "Inventory item not found."}if none exists for the project.
Breaking change: these request types previously took a product_id
integer as the first requested_data element and products didn't have a
sku column. They now take the item's sku (string) instead, and
product_id is no longer a valid column name — update any existing calls
accordingly.
Example
curl -X POST https://acriumautomated.com/api/v1/ \
-H "Content-Type: application/json" \
-d '{
"api_id": "123",
"api_key": "acrm-...",
"request_type": "grab_single_inventory",
"requested_data": ["WIDGET-1", "sku", "quantity", "price"]
}'
Response:
{
"sku": "WIDGET-1",
"quantity": 42,
"price": 19.99
}