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
| Name | Type | Sample | Explanation |
|---|---|---|---|
namepost | string | Acme Supply | Supplier name. Aliases: supplier_name, title. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
phonepost | string | 0500000000 | Phone. Alias: mobile. |
emailpost | string | [email protected] | Email. |
company_idpost | string | 123456789 | Company / VAT id. Alias: company. |
contact_namepost | string | Dana | Contact person name. Alias: contact. |
languagepost | string | en | Language 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.AddSample 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"
}