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.
  • 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.
  • 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
string[email protected]Email.
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.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Suppliers.Add",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "name": "Acme Supply",
        "phone": "0500000000",
        "email": "[email protected]",
        "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: '[email protected]'
});
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"
}