POST
Storage.Add
Create a warehouse in the storage table (same fields as dashboard product-report Storage List add / storage_add). Requires owner or member-admin. First warehouse for the account is marked default_storage=1. Emits realtime storage.created. Use returned id as default_storage_id / item_storageid.
Permissions
- User must be logged in with a valid bearer token.
- The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Creates a Storage record or sends the requested data after validation.
Push Service
Pushes event storage.created to users who should see this change.
Automation
No automation is run for this function.
Special Instructions
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- Send parameters as POST body fields exactly as documented.
- Send date/time values in UTC Y-m-d H:i:s format when a date or datetime field is used.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
namepost | string | Main warehouse | Warehouse name. Aliases: storage_name, title. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
team_memberpost | array | ["14","47"] | Team member ids shared with this warehouse (stored as JSON string ids like dashboard). Aliases: team_members, team_member[], team_member_id, team_member_ids, organizations_user. |
father_storage_idpost | int | 0 | Parent warehouse id (father). Default 0. Aliases: father, parent, parent_id. |
notepost | string | Front stock | Notes. Alias: notes. |
Authentication
Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Storage.Add",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"name": "Main warehouse",
"team_member": "[\"14\",\"47\"]",
"father_storage_id": "0",
"note": "Front stock"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Storage.Add",
"url_domain": "https:\/\/{domain}\/app\/Storage.Add"
}Endpoint
POST /app/Storage.Add
POST https://{user}.bull36.com/app/Storage.Add
POST https://{domain}/app/Storage.AddSample Output
{
"success": 1,
"id": 3,
"storage_id": 3,
"message": "Storage added successfully.",
"automation_event": null,
"socket_event": "storage.created"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({
name: 'Main warehouse',
team_member: JSON.stringify(['14', '47']),
note: 'Front stock'
});
const res = await fetch('/app/Storage.Add', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());Error Example
{
"success": 0,
"message": "Missing required parameter: name"
}