POST

Suppliers.Add

Create a supplier in the suppliers table (same fields as dashboard product-report add supplier / Mysite::add_supplier1). Requires owner or member-admin. Emits realtime suppliers.created.

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 Suppliers record or sends the requested data after validation.

Push Service

Pushes event suppliers.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

NameTypeSampleExplanation
name
post
stringAcme SupplySupplier name. Aliases: supplier_name, title.

Optional Parameters

NameTypeSampleWhat it gives
phone
post
string0500000000Phone. Alias: mobile.
email
post
stringsupply@example.comEmail.
company_id
post
string123456789Company / VAT id. Alias: company.
contact_name
post
stringDanaContact person name. Alias: contact.
language
post
stringenLanguage code. Alias: lang.

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\/Suppliers.Add",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "name": "Acme Supply",
        "phone": "0500000000",
        "email": "supply@example.com",
        "company_id": "123456789",
        "contact_name": "Dana",
        "language": "en"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Suppliers.Add",
    "url_domain": "https:\/\/{domain}\/app\/Suppliers.Add"
}

Endpoint

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

Sample Output

{
    "success": 1,
    "id": 88,
    "supplier_id": 88,
    "suppliers_id": 88,
    "message": "Supplier added successfully.",
    "automation_event": null,
    "socket_event": "suppliers.created"
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({
  name: 'Acme Supply',
  phone: '0500000000',
  email: 'supply@example.com'
});
const res = await fetch('/app/Suppliers.Add', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

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