POST

Categories.Add

Create a product category in ec_categories. Matches the product-report Categories tab add form. Use parent=0 for a main category, or a parent category id for a subcategory. Child categories inherit the parent type.

Permissions

  • User must be logged in with a valid bearer token.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Creates a Categories record or sends the requested data after validation.

Push Service

Pushes event categories.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.
  • 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

NameTypeSampleExplanation
category
post
stringMembershipCategory title. Aliases: name, category_name, title.

Optional Parameters

NameTypeSampleWhat it gives
description
post
stringMembership productsCategory description.
parent
post
int0Parent category id. 0 creates a top-level category.
image
post
stringbiz1upload/site/demo.pngStored image path. Upload files with Files.Upload first when needed.
type
post
stringproductsproducts or insurance. Alias: insurance_prod_cate=1 sets insurance.
in_stock
post
int1In-stock flag. Defaults to 1.
team_member
post
json[47,48]JSON array of team member ids.
custom_field_list
post
json[]JSON custom field definitions for this category.
discount
post
int0Max-discount enabled flag. Alias: max_discount_val.
max_discount
post
number10Max discount amount/percent. Alias: discount_val.
discount_type
post
stringpercentageDiscount type when max discount is enabled.
invoice_israel_category
post
string00000Israel invoice category code when localization supports it.
order_cat
post
int1Optional display order. Server sets next order when omitted.

Authentication

Send the bearer token returned by Login in the request header.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Categories.Add",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "category": "Membership",
        "description": "Membership products",
        "parent": "0",
        "type": "products"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Categories.Add",
    "url_domain": "https:\/\/{domain}\/app\/Categories.Add"
}

Endpoint

POST /app/Categories.Add
POST https://{user}.bull36.com/app/Categories.Add
POST https://{domain}/app/Categories.Add

Sample Output

{
    "success": 1,
    "id": "123",
    "category_id": "123",
    "message": "Category added successfully.",
    "automation_event": null,
    "socket_event": "categories.created"
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({
  category: 'Membership',
  description: 'Membership products',
  parent: '0',
  type: 'products'
});
const res = await fetch('/app/Categories.Add', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);

Error Example

{
    "success": "0",
    "message": "Missing required parameter: category"
}