Companies
Contact Centre Companies API documentation
Account Summary
This API call will return summary data related to companies loaded.
Path |
---|
/workflow/company/details |
Request (POST)
Any of the following fields can be sent
Field name | Data type | Description |
---|---|---|
company_name | string | Company name. Does an approximate match e.g. you can search for ‘my co’ and it would return ‘my company’ for example. |
registration_number | string | Company registration number |
id | uuid | Database record id, in the workflow |
record | boolean | If true show record section |
subscriptions | boolean | If true show subscriptions section |
bank_accounts | boolean | If true show bank_accounts section |
transactions | boolean | If true show transactions section |
Response (JSON)
Data is returned as a JSON object in the following format with multiple sections:
{
"record": {
"registration_number": 12345678,
......
},
"subscriptions": [{
"date_start": "2020-03-12",
......
}, ...],
"bank_accounts": [{
"accounts_holder": "J Smith",
......
}, ...],
"transactions": [{
"transaction_number": "2865fca2-db87-4e37-8dd3-c350cd639a5c",
......
}, ...],
}
Add New Company
This API call provides for loading new companies onto the platform.
Path |
---|
/workflow/company/create |
Request (POST) JSON Array
Field name | Data type | Required | Description |
---|---|---|---|
account_bank | string | C[16], L | Bank name |
account_branch_code | string | C[12], L | Bank branch code |
account_name | string | C[13] | Bank account holder name |
account_number | string | C[14] | Bank account number |
account_type | string | C[15], L | Bank account type |
agent | string | N, L | Agent who recruited account |
balance_open | number | N | Journal opening balance in Rands |
billing_day | number | C[21] | Day of debit order run for product (0 - 31). Only applicable if product details above have been provided. |
branch | string | N, L | Branch account was recruited at |
company_type | string | Y, L | Company type |
contact_name | string | N | Name of Person to contact |
contact_surname | string | N | Surname of Person to contact |
contact_title | string | N, L | Title of Person to contact |
contact | string | N | Contact number |
country | string | N, L | Country the company is located in. Defaults to South Africa |
custom_fields | Object | N | Object containing all optional custom fields returned by /lookups/custom_fields/people. E.g. { "spouse name": "Jane" } |
date_balance_open | date | N | Date journal balance was opened |
date_closed | date | N | Date company closed down |
date_expire | date | N | Date company record became invalid |
deal_accounts_currencies_id | string | N, L | Currency associated with the deal value |
deal_expected_close_date | date | N | Expected closing date for the deal |
deal_value | number | N | Amount expected to be gained from the deal e.g. 12500.0 ZAR |
default_accounts_tax_id | string | N | Default account tax id |
default_billing_day | string | C[22] | Default debit order day for the company |
description | string | N | Company description |
string | Y | ||
fax | string | N | Fax number |
is_active | boolean | N | Company record is to be active. Defaults to true. |
is_blacklisted | boolean | N | If this company has been flagged as blacklisted |
is_marketing_email | boolean | N | Can send email marketing |
is_marketing_phone | boolean | N | Can send phone marketing |
is_marketing_sms | boolean | N | Can send sms marketing |
is_marketing_whatsapp | boolean | N | Can send WhatsApp marketing |
is_taxable | boolean | N | Company is taxable |
language | string | N, L | Language (Same lookup as people) |
mobile | string | N | Mobile number |
municipality | String | N, L | Municipality associated with the region |
name | string | Y | Company Name, must be unique |
owner_admins_ids | array | N, L | Array of admin IDs to whom the record belongs |
physical_code | number | N | Physical postal code |
physical_line_1 | string | N | Physical address line 1 |
physical_line_2 | string | N | Physical address line 2 |
physical_line_3 | string | N | Physical address line 3 |
physical_line_4 | string | N | Physical address line 4 |
postal_code | string | N | Postal code |
postal_line_1 | string | N | Postal address line 1 |
postal_line_2 | string | N | Postal address line 2 |
postal_line_3 | string | N | Postal address line 3 |
postal_line_4 | string | N | Postal address line 4 |
product_amount | Number | C[18] | Amount company is paying for the product in Cents e.g. 150 for R1.50 |
product_name | string | C[17], L | Name of the product company is subscribed to |
product_subscription_start_date | date | C[20] | When the subscription to the product is to start. If the product interval is greater than 1 month e.g. yearly, you may not pick a date that was already submitted in a batch. A good rule is that the starting date should be at least 12 days from now. |
product_unit_name | string | C[19], L | How frequently the product is billed |
project | string | N, L | Project account was recruited under |
reference_number | string | N | Custom reference number to tag the product with and display on workflow reporting. |
region | string | N, L | Province/State the company is located in. Defaults to none/unknown |
registration_number | string | N | Registration number |
social_blog | string | N | Blog URL |
social_facebook | string | N | Facebook URL |
social_instagram | string | N | Instagram URL |
social_linkedin | string | N | LinkedIn URL |
social_pinterest | string | N | Pinterest URL |
social_telegram | string | N | Telegram number |
social_twitter | string | N | Twitter URL |
social_whatsapp | string | N | WhatsApp number |
tax_reference | string | N | Company tax reference |
trading_as | string | Y | Registered trading name |
utm_campaign | string | N | UTM campaign parameter |
utm_content | string | N | UTM content parameter |
utm_medium | string | N | UTM medium parameter |
utm_source | string | N | UTM source parameter |
utm_term | string | N | UTM term parameter |
web_referrer | string | N | Web referrer URL |
website | string | N | Website address |
visible_to_lookups_id | string | N, L | Visibility group associated with the record |
Response (JSON)
Data is returned as a JSON object in the following format with multiple sections:
{
"Info": {
"companies": {
"accepted": 12345,
"rejected": 678
}
},
"accepted": [{...}],
"rejected": [{
"reasons": {
"account_number": {
"message": "CDV check failed",
"rule": "CDV"
}
},
"name": "xxxxxxxxxxxx",
...
}, ...]
}
| |||
---|---|---|---|
Sub-section | Field name | Data type | Description |
companies | accepted | number | Number of records accepted |
companies | rejected | number | Number of records rejected (See rejected section for more details) |
Update Company
This API call provides for updating the details of existing companies on the platform.
Same conditions follow for bank account and product details as in creation i.e. if one bank account detail is to be updated all bank account details have to be provided.
Product details can only be provided when the company is currently inactive, in which case all their previously active subscriptions will be disabled before creating a new subscription (automatically reactivating them as well) or adding subscriptions to companies that currently have no active subscriptions. To add products to an existing subscription use the ‘add product’ API call.
Path |
---|
/workflow/company/update |
Request (POST) JSON Array
Field name | Data type | Required | Description |
---|---|---|---|
account_bank | string | N, L | Bank name |
account_branch_code | string | N, L | Bank branch code |
account_name | string | N | Bank account holder name |
account_number | string | N | Bank account number |
account_type | string | N, L | Bank account type |
agent | string | N, L | Agent who recruited account |
balance_open | number | N | Journal opening balance in rands |
billing_day | number | N | Day of debit order run for product (0 - 31). Only applicable if product details above have been provided. |
branch | string | N, L | Branch account was recruited at |
company_type | string | N, L | Company type |
contact_name | string | N | Name of Person to contact |
contact_surname | string | N | Surname of Person to contact |
contact_title | string | N, L | Title of Person to contact |
contact | string | N | Contact number |
country | string | N, L | Country the company is located in. Defaults to South Africa |
custom_fields | Object | N | Object containing all optional custom fields returned by /lookups/custom_fields/people. E.g. { "spouse name": "Jane" } |
date_balance_open | date | N | Date journal balance was opened |
date_closed | date | N | Date company closed down |
date_expire | date | N | Date company record became invalid |
deal_accounts_currencies_id | string | N, L | Currency associated with the deal value |
deal_expected_close_date | date | N | Expected closing date for the deal |
deal_value | number | N | Amount expected to be gained from the deal e.g. 12500.0 ZAR |
default_accounts_tax_id | string | N | Default account tax id |
default_billing_day | string | N | Default debit order day for the company |
description | string | N | Company description |
string | N | ||
fax | string | N | Fax number |
is_active | boolean | N | Company record is to be active |
is_blacklisted | boolean | N | If this company has been flagged as blacklisted |
is_marketing_email | boolean | N | Can send email marketing |
is_marketing_phone | boolean | N | Can send phone marketing |
is_marketing_sms | boolean | N | Can send sms marketing |
is_marketing_whatsapp | boolean | N | Can send WhatsApp marketing |
is_taxable | boolean | N | Company is taxable |
language | string | N, L | Language (Same lookup as people) |
mobile | string | N | Mobile number |
municipality | String | N, L | Municipality associated with the region |
name | string | Y | Company Name. Must be unique and exist in the DB. Name is case insensitive but additional characters would affect the result. ‘MY COMPANY’ is the same as ‘My Company’ but ‘My Company LTD’ would not be found for example. Use the ‘Account Summary’ API call to find the correct names. |
owner_admins_ids | array | N, L | Array of admin IDs to whom the record belongs |
physical_code | number | N | Physical postal code |
physical_line_1 | string | N | Physical address line 1 |
physical_line_2 | string | N | Physical address line 2 |
physical_line_3 | string | N | Physical address line 3 |
physical_line_4 | string | N | Physical address line 4 |
postal_code | string | N | Postal code |
postal_line_1 | string | N | Postal address line 1 |
postal_line_2 | string | N | Postal address line 2 |
postal_line_3 | string | N | Postal address line 3 |
postal_line_4 | string | N | Postal address line 4 |
product_amount | Number | N | Amount company is paying for the product in Cents e.g. 150 for R1.50 |
product_name | string | N, L | Name of the product company is subscribed to. See description above for when to use product inputs. |
product_subscription_start_date | date | N | When the subscription to the product is to start. If the product interval is greater than 1 month e.g. yearly, you may not pick a date that was already submitted in a batch. A good rule is that the starting date should be at least 12 days from now. |
product_unit_name | string | N, L | How frequently the product is billed |
project | string | N, L | Project account was recruited under |
reference_number | string | N | Custom reference number to tag the product with and display on workflow reporting. |
region | string | N, L | Province/State the company is located in. Defaults to none/unknown |
registration_number | string | N | Registration number |
social_blog | string | N | Blog URL |
social_facebook | string | N | Facebook URL |
social_instagram | string | N | Instagram URL |
social_linkedin | string | N | LinkedIn URL |
social_pinterest | string | N | Pinterest URL |
social_telegram | string | N | Telegram number |
social_twitter | string | N | Twitter URL |
social_whatsapp | string | N | WhatsApp number |
tax_reference | string | N | Company tax reference |
trading_as | string | N | Registered trading name |
utm_campaign | string | N | UTM campaign parameter |
utm_content | string | N | UTM content parameter |
utm_medium | string | N | UTM medium parameter |
utm_source | string | N | UTM source parameter |
utm_term | string | N | UTM term parameter |
web_referrer | string | N | Web referrer URL |
website | string | N | Website address |
visible_to_lookups_id | string | N, L | Visibility group associated with the record |
Response (JSON)
Data is returned as a JSON object in the following format with multiple sections:
{
"Info": {
"companies": {
"updated": 12,
"rejected": 3
}
},
"accepted": [{...}],
"rejected": [{
"reasons": {
"account_number": {
"message": "CDV check failed",
"rule": "CDV"
}
},
"name": "xxxxxxxxxxxx",
...
}, ...]
}
| |||
---|---|---|---|
Sub-section | Field name | Data type | Description |
companies | updated | number | Number of records updated |
companies | rejected | number | Number of records rejected (See rejected section for more details) |
Add Product
Add a product to the subscription (or the latest active subscription) for a specified company. Subscription product agents will be based on the agent that is associated with the API token used. Body input must be an object and not an array.
Path |
---|
/workflow/company/product/add |
Request (POST)
Field name | Data type | Required | Description |
---|---|---|---|
product_name | string | Y, L | Name of the product to be added for the person. |
company_name | string | Y | Name of the company paying for the product. Must be unique and exist in the DB. Name is case insensitive but additional characters would affect the result. ‘MY COMPANY’ is the same as ‘My Company’ but ‘My Company LTD’ would not be found for example. Use the ‘Account Summary’ API call to find the correct names. |
account_id_number | string | N | Used when paying for a specific person. ID number of the person the product is for. |
subscription_id | string | N | ID of the subscription to add the product to. Obtained from ‘Account Summary’. Defaults to the latest active subscription of the company; with active banking details. |
amount | Number | Y | Amount to be paid for the product; in cents. |
branch | string | N, L | Branch product was recruited at |
project | string | N, L | Project product was recruited under |
agent | string | N, L | Agent selling the product |
reference_number | string | N | Custom reference number to tag the product with and display on workflow reporting. |
Response (JSON)
Data is returned as a JSON object in the following format:
{
"billing_day": 1,
"amount": 20000,
"payer_name": "xxxxxxxxxxxxx",
"account_id_number": "xxxxxxxxxxxxx",
"product_name": "Product 123",
"unique_workflow_id": "xxxxxxxxx",
"errors": [{
"message": "abc",
"rule": "uuid"
}]
}
Field name | Data type | Description |
---|---|---|
billing_day | Number | Day on which the next payment will be made |
amount | Number | Amount in cents to be deducted from the person |
payer_name | String | Name of the company paying for the product |
account_id_number | String | ID number of the person receiving the product (if applicable). |
product_name | String | Name of the product being paid for |
unique_workflow_id | String | Unique ID associated with this workflow submission. Can be used to cancel a pending workflow item. |
Errors Section | ||
message | String | Reason why the submission was rejected:
|
rule | String | Rule associated with the message e.g. ‘uuid’ |
Add Subscription
Add a new subscription for the specified company. Subscription product agents will be based on the agent that is associated with the API token used. Body input must be an object.
Path |
---|
/workflow/company/subscription/add |
Request (POST)
Field name | Data type | Required | Description |
---|---|---|---|
product_name | string | Y, L | Name of the product to be added for the person. |
company_name | string | Y | Name of the company paying for the product. Must be unique and exist in the DB. Name is case insensitive but additional characters would affect the result. ‘MY COMPANY’ is the same as ‘My Company’ but ‘My Company LTD’ would not be found for example. Use the ‘Account Summary’ API call to find the correct names. |
account_id_number | string | N | Used when paying for someone else e.g. a spouse. ID number of the person the product is for; defaults to the person specified with ‘id_number’. |
amount | number | Y | Amount to be paid for the product; in cents. |
agent | string | N, L | Name of the related agent, if not same as that specified by the API token |
branch | string | N, L | Branch product was recruited at |
project | string | N, L | Project product was recruited under |
start_date | date | N | Date when subscription is to start, defaults to next billing day |
end_date | date | N | Date when subscription is to end, leave empty for no end date |
billing_day | number | Y | Calendar day to make deductions on, 1 to 31 |
default_payment_methods_id | string | Y, L | Payment method to be used with the subscription See ‘/api/1.0/lookups?category=Payment Methods’ |
bank_account_name | string | C | Bank account holder name. Required when the payment method used is a debit order. |
bank_account_number | string | C | Bank account number. Required when the payment method used is a debit order. |
bank_account_bank | string | C, L | Name of the bank that the bank account number belongs to e.g. "ABSA’. See ‘/api/1.0/lookups/bank/names’. Required when the payment method used is a debit order. |
bank_account_type_lookups_id | string | C, L | Type of bank account used e.g. ‘Cheque/Current". See ‘/api/1.0/lookups/bank/accounts’. Required when the payment method used is a debit order. |
bank_account_branch_code | string | C | Branch code associated with the bank account number. Required when the payment method used is a debit order. |
Response (JSON)
Data is returned as a JSON object in the following format:
{
"status": true,
"errors": null,
"billing_day": 1,
"amount": 20000,
...
}
Field name | Data type | Description |
---|---|---|
status | boolean | True if the call succeeded, false if there is an error |
errors | object | Object specifying the problem with inputs e.g. |
{
"product_name" {
"message": "Product not found",
"rule": "Lookup"
}
}
Field name | Data type | Description |
---|---|---|
billing_day | number | Date of month payment is to be deducted on, 1 to 31 |
amount | number | Amount to be paid for the product; in cents. |
subscription_start_date | date | When the subscription will start running, the first payment will be on the first billing day after this date and then repeat every interval from that date (based on the product interval) |
subscription_end_date | date | When the subscription is to stop running |
account_id_number | string | ID Number of the person being paid for |
product_name | string | Name of the product being paid for |
unique_workflow_id | string | Unique ID associated with this workflow submission. Can be used to cancel a pending workflow item. |
payer_name | string | Name of the company paying for the product |
Blacklist
Get a list of blacklisted phone numbers where the user requested not to be contacted.
Path |
---|
/companies/blacklist/{sms|phone} |
Request (POST)
Field name | Data type | Required | Description |
---|---|---|---|
start | date | N | Start date filter on when record was flagged not to contact |
end | date | N | End date filter on when record was flagged not to contact |
Response (JSON)
Data is returned as a JSON object in the following format:
{
"status": true,
"data": [{
"cellphone": "081234567",
"contact": "081234567",
}]
"error": "String message"
}
| |
Field name | Data type | Description |
---|---|---|
cellphone | String | Contact number |
contact | String | Contact number |
Errors Section | ||
message | String | Reason why the API call failed:
|
rule | Type | Type in URL needs to be either "sms" or "phone" |
rule | Date | Start and end date needs to be in format YYYY-MM-DD or 2021-01-01 |
- Required if day_salary is not provided. ↑
- Either none or all of the account related information must be provided. ↑
- Either none or all of the account related information must be provided. ↑
- See note 1 ↑
- See note 1 ↑
- See note 1 ↑
- Either none or all of the product related information must be provided. ↑
- See note 6 ↑
- See note 6 ↑
- If provided requires all account and product related information to be provided. ↑
- Required if default_day_salary is not provided. In which case it is used as the profile default debit order day as well as the product debit order day. ↑
- Either none or all of the account related information must be provided. ↑
- See note 12 ↑
- See note 12 ↑
- See note 12 ↑
- See note 12 ↑
- Either none or all of the product related information must be provided. ↑
- See note 17 ↑
- See note 17 ↑
- If provided requires all account and product related information to be provided. ↑
- Required if default_day_salary is not provided. In which case it is used as the company default debit order day as well as the product debit order day. ↑
- Required if day_salary is not provided. ↑