Contact Centre

People

Contact Centre People API documentation

Account Summary

All members are stored on the platform as an account. This API call will return summary data

Path
/workflow/people/details

Request (POST)

Any of the following fields can be sent

Field nameData typeDescription
id_numberstringID number, this can also be other countries
member_numberstringMembership number
iduuidDatabase record id, in the workflow
recordbooleanIf true show record section
subscriptionsbooleanIf true show subscriptions section
bank_accountsbooleanIf true show bank_accounts section
transactionsbooleanIf true show transactions section

Response (JSON)

Data is returned as a JSON object in the following format with multiple sections:

{
  "record": {
    "member_number": 12345678,
    ......
  },  
  "subscriptions": [{
    "date_start": "2020-03-12",
    ......
  }, ...],
  "bank_accounts": [{
    "accounts_holder": "J Smith",
    ......
  }, ...],
  "transactions": [{
    "transaction_number": "2865fca2-db87-4e37-8dd3-c350cd639a5c",
    ......
  }, ...],
}

Record section

Field name

Data type

Description

member_number

number

Membership number

name

string

First name

surname

string

Last name

email

string

Email

id_number

string

Local or foreign ID number

id_number_type

String

Type of ID number e.g. ‘SA ID Number’ or ‘Passport’

contact_cell

string

Contact number (10 digits)

contact_home

string

Home number (10 digits)

contact_work

string

Work number (10 digits)

contact_fax

string

Fax number (10 digits)

tax_reference

string

Tax reference number

country

string

Country the person resides in

region

string

province/state associated with above country

municipality

String

Municipality associated with the region

title

string

Title

language

string

Language

marital_status

string

Marital Status

branch

string

Branch account was recruited at

agent

string

Agent who recruited account

day_salary

number

Day of debit order run (0 - 31)

physical_line_1

string

Physical address line 1

physical_line_2

string

Physical address line 2

physical_line_3

string

Physical address line 3

physical_line_4

string

Physical address line 4

physical_code

number

Physical postal code

postal_line_1

string

Postal address line 1

postal_line_2

string

Postal address line 2

postal_line_3

string

Postal address line 3

postal_line_4

string

Postal address line 4

postal_code

string

Postal code

is_marketing_sms

boolean

Can send sms marketing

is_marketing_whatsapp

boolean

Can send WhatsApp marketing

is_marketing_email

boolean

Can send email marketing

is_marketing_phone

boolean

Can send phone marketing

is_active

boolean

Is user an active member

created_at

timestamp

When record was created

updated_at

timestamp

When record was updated

balance_open

number

Journal opening balance

date_balance_open

date

Date associated with opening balance

custom_fields

object

Optional custom fields associated with the record

branches_regions_title

string

Region associated with the branch

owner_admins

array

List of admin owners related to this record

visible_to_title

string

Visibility group of the record

deal_value

number

How much the deal is worth

deal_accounts_currencies_title

string

Currency associated with the deal value

deal_expected_close_date

date

When the deal is expected to close

companies_name

string

Name of the company associated with the person

companies_trading_as

string

Trading name of the company associated with the person

is_blacklisted

boolean

Has this person been flagged as blacklisted

middle_names

string

Middle name(s) of the person

job_title

string

Job the person does

total_successful_transactions

number

Total number of successful transactions for this record

total_failed_transactions

number

Total number of failed transactions for this record

total_subscriptions

number

Total number of subscriptions associated with the record

total_subscriptions_products

number

Total number of subscription products associated with the record

total_active_subscriptions_products

number

Total number of active subscription products associated with the record

call_last_contacted_by_agents_title

string

Agent that last contacted the person by call

call_last_contacted

date

Date when last the person was contacted via call

date_phone_invalid

date

Date when the phone number was deemed invalid

date_lead_conversion

date

Date when the person was converted from a lead to an account

date_paid_up

date

Date until when the person is deemed to be paid up

address_details_changed_at

date

Date when the address details of the person was changed

contact_details_changed_at

date

Date when the contact details of the person was changed

last_engagement_at

date

Date when the person was last engaged with

status_changed_at

date

Date when the status of the person was last changed at

source_of_record_title

string

Source of the record e.g. API

date_id_number_verify

date

Date when the ID number was verified

credit_score_cpa

number

CPA credit score of the person

credit_score_nlr

number

NLR credit score of the person

referred_by

string

Who this person was referred by

Subscription section

Field name

Data type

Description

id

uuid

Unique ID

date_start

date

Date when subscription should start

date_end

date

Date when subscription should end. Blank will run forever.

bank_accounts_id

uuid

Bank account ID

products

array

List of products under this subscription

status

string

Active, Disputed, Disabled

Products (array of objects)

name

string

Name of product

amount

decimal

Amount ZAR of product

quantity

number

How many products where added

total

decimal

Total amount (amount * quantity)

branch

string

Branch product was recruited at

project

string

Project product was recruited under

agent

string

Agent who commissions should be paid out to

is_active

boolean

Is product under subscription active

created_at

timestamp

When product was created

updated_at

timestamp

When product was updated

reference_number

string

Reference provided when the API call was made

Bank accounts section

Field name

Data type

Description

id

uuid

Unique ID

account_holder

string

Name of bank account holder

account_number

string

Bank account number

account_type

string

Bank account type

bank

string

Bank name

branch_code

string

Bank branch code

Transactions section

Field name

Data type

Description

transaction_number

string

Unique number

amount

decimal

Amount collected

status

string

Paid, Transaction Accepted, Disputed, Unpaid

transaction_date

timestamp

When the transaction was processed.

Items (array of objects)

name

string

Name of the product paid for.

unique_id

string

Unique ID associated with the product.

unit_name

string

Unit name of the product.

unit_label

string

Unit label of the product.

accounting_code

string

Accounting code associated with the product.

amount

decimal

Amount paid for.

reference_number

string

Reference number submitted on the initial workflow API call.

Add New Person

This API call will provide for loading new members onto the platform.

Path
/workflow/people/create

Request (POST) JSON Array

Field nameData typeRequiredDescription
account_bankstringC[6], LBank name
account_branch_codestringC[2], LBank branch code
account_namestringC[3]Bank account holder name
account_numberstringC[4]Bank account number
account_typestringC[5], LBank account type
agentstringN, LAgent who recruited account
balance_opennumberNJournal opening balance in Rands
billing_daynumberNBilling day subscription is to run on (used when adding a product)
branchstringN, LBranch account was recruited at
companies_idstringNID of the company associated with this person
contact_cellstringYContact number (10 digits)
contact_faxstringNFax number (10 digits)
contact_homestringNHome number (10 digits)
contact_workstringNWork number (10 digits)
countrystringN, LCountry the person lives in. Defaults to South Africa
custom_fieldsObjectNObject containing all optional custom fields returned by /lookups/custom_fields/people. E.g. { "spouse name": "Jane" }
date_balance_opendateNDate associated with opening balance
date_birthdateNDate of birth
day_salarynumberC[11]Day of debit order run for product (0 - 31). Only applicable if product details above have been provided.
deal_accounts_currencies_idstringN, LCurrency associated with the deal value
deal_expected_close_datedateNExpected closing date for the deal
deal_valuenumberNAmount expected to be gained from the deal e.g. 12500.0 ZAR
default_billing_daynumberNDefault billing day for the person
default_day_salarystringC[1]Default debit order day for the person
emailstringNEmail
genderstringY, LPerson gender
id_number_typestringN, LDefaults to ‘SA ID Number’
id_numberstringYID number, this can also be other countries
initialsstringNPerson initials
is_activebooleanNPerson record is to be active. Defaults to true.
is_blacklistedbooleanNIf this person has been flagged as blacklisted
is_marketing_emailbooleanNCan send email marketing
is_marketing_phonebooleanNCan send phone marketing
is_marketing_smsbooleanNCan send sms marketing
is_marketing_whatsappbooleanNCan send WhatsApp marketing
job_lookups_idstringN, LThe type of job the person does
languagestringY, LLanguage
middle_namesstringNMiddle names of the person
marital_statusstringN, LMarital status
municipalityStringN, LMunicipality associated with the region
namestringYFirst name
owner_admins_idsarrayN, LArray of admin IDs to whom the record belongs
physical_codenumberYPhysical postal code
physical_line_1stringYPhysical address line 1
physical_line_2stringYPhysical address line 2
physical_line_3stringYPhysical address line 3
physical_line_4stringYPhysical address line 4
postal_codestringYPostal code
postal_line_1stringYPostal address line 1
postal_line_2stringYPostal address line 2
postal_line_3stringYPostal address line 3
postal_line_4stringYPostal address line 4
product_amountNumberC[8]Amount person is paying for the product in Cents e.g. 150 for R1.50
product_namestringC[7], LName of the product person is subscribed to
product_subscription_start_datedateC[10]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_namestringC[9], LHow frequently the product is billed
projectstringN, LProject account was recruited under
reference_numberstringNCustom reference number to tag the product with and display on workflow reporting.
regionstringN, LProvince/State the person lives in. Defaults to none/unknown
surnamestringYLast name
tax_referencestringNTax reference number associated with the person
titlestringN, LTitle
visible_to_lookups_idstringN, LVisibility group associated with the record

Response (JSON)

Data is returned as a JSON object in the following format with multiple sections:

{
  "Info": {
    "people": {
      "accepted": 12345,
      "rejected": 678
    }
  },
  "accepted": [{...}],
  "rejected": [{
    "reasons": {
      "account_number": {
        "message": "CDV check failed", "rule": "CDV"
      }
    },
    "id_number": "xxxxxxxxxxxx",
    ...
  }, ...]
}

Info section

Sub-section

Field name

Data type

Description

people

accepted

number

Number of records accepted

people

rejected

number

Number of records rejected (See rejected section for more details)

Rejected section

Field name

Data type

Description

reasons

object

The reason why the record was rejected; some examples include:

  • Person already exists
  • Branch code format incorrect
  • Account number format incorrect
  • Account name format incorrect
  • CDV check failed

The reasons are given per input key that failed the validation e.g. "account_number".

id_number

string

ID number associated with the rejected record

name

string

First name

surname

string

Last name

Accepted section

Field name

Data type

Description

unique_workflow_id

string

Unique ID associated with the submission. Can be used to cancel the item if it is still pending.

id_number

string

ID number associated with the rejected record

name

string

First name

surname

string

Last name

Update Person

This API call will provide for updating the details of existing members 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 person 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 people that currently have no active subscriptions. To add products to an existing subscription use the ‘add product’ API call.

Path
/workflow/people/update

Request (POST) JSON Array

Field nameData typeRequiredDescription
account_bankstringN, LBank name
account_branch_codestringN, LBank branch code
account_namestringNBank account holder name
account_numberstringNBank account number
account_typestringN, LBank account type
agentstringN, LAgent who recruited account
balance_opennumberNJournal opening balance in Rands
billing_daynumberNBilling day subscription is to run on (used when adding a product)
branchstringN, LBranch account was recruited at
companies_idstringNID of the company associated with this person
contact_cellstringNContact number (10 digits)
contact_faxstringNFax number (10 digits)
contact_homestringNHome number (10 digits)
contact_workstringNWork number (10 digits)
countrystringN, LCountry the person lives in. Defaults to South Africa
custom_fieldsObjectNObject containing all optional custom fields returned by /lookups/custom_fields/people. E.g. { "spouse name": "Jane" }
date_balance_opendateNDate associated with opening balance
date_birthdateNDate of birth
day_salarynumberNDay of debit order run for the product (0 - 31). Only applicable to product details above.
deal_accounts_currencies_idstringN, LCurrency associated with the deal value
deal_expected_close_datedateNExpected closing date for the deal
deal_valuenumberNAmount expected to be gained from the deal e.g. 12500.0 ZAR
default_billing_daynumberNDefault billing day for the person
default_day_salarystringNDefault debit order day for the person
emailstringNEmail
genderstringN, LPerson gender
id_number_typestringN, LDefaults to ‘SA ID Number’
id_numberstringYID number of the person to be updated
initialsstringNPerson initials
is_activebooleanNPerson record is to be active. Defaults to true.
is_blacklistedbooleanNIf this person has been flagged as blacklisted
is_marketing_emailbooleanNCan send email marketing
is_marketing_phonebooleanNCan send phone marketing
is_marketing_smsbooleanNCan send sms marketing
is_marketing_whatsappbooleanNCan send WhatsApp marketing
job_lookups_idstringN, LThe type of job the person does
languagestringN, LLanguage
marital_statusstringN, LMarital status
middle_namesstringNMiddle names of the person
municipalityStringN, LMunicipality associated with the region
namestringNFirst name
owner_admins_idsarrayN, LArray of admin IDs to whom the record belongs
physical_codenumberNPhysical postal code
physical_line_1stringNPhysical address line 1
physical_line_2stringNPhysical address line 2
physical_line_3stringNPhysical address line 3
physical_line_4stringNPhysical address line 4
postal_codestringNPostal code
postal_line_1stringNPostal address line 1
postal_line_2stringNPostal address line 2
postal_line_3stringNPostal address line 3
postal_line_4stringNPostal address line 4
product_amountstringNAmount person is paying for the product in Cents e.g. 150 for R1.50
product_namestringN, LName of the product person is subscribed to. See description above for when to use the product related inputs.
product_subscription_start_datedateNWhen 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_namestringN, LHow frequently the product is billed
projectstringN, LProject account was recruited under
reference_numberstringNCustom reference number to tag the product with and display on workflow reporting.
regionstringN, LProvince/State the person lives in. Defaults to none/unknown
surnamestringNLast name
tax_referencestringNTax reference number associated with the person
titlestringN, LTitle
visible_to_lookups_idstringN, LVisibility group associated with the record

Response (JSON)

Data is returned as a JSON object in the following format with multiple sections:

{
  "Info": {
    "people": {
      "updated": 12,
      "rejected": 3
    }
  },
  "accepted": [{...}],
  "rejected": [{
    "reasons": {  
      "account_number": {
        "message": "CDV check failed", "rule": "CDV"
      }
    },
    "id_number": "xxxxxxxxxxxx",
    ...
  }, ...]
}

Info section

Sub-section

Field name

Data type

Description

people

updated

number

Number of records updated

people

rejected

number

Number of records rejected (See rejected section for more details)

Rejected section

Field name

Data type

Description

reasons

object

The reason why the record was rejected; some examples include:

  • Person already exists
  • Branch code format incorrect
  • Account number format incorrect
  • Account name format incorrect
  • CDV check failed

The reasons are given per input key that failed the validation e.g. "account_number".

id_number

string

ID number associated with the rejected record

name

string

First name

surname

string

Last name

Accepted section

Field name

Data type

Description

unique_workflow_id

string

Unique ID associated with the submission. Can be used to cancel the item if it is still pending.

id_number

string

ID number associated with the rejected record

name

string

First name

surname

string

Last name

Add Product

Add a product to the subscription (or the latest active subscription) for a specified person. Subscription product agents will be based on the agent that is associated with the API token used. Body input can be an array or just an object.

Path
/workflow/people/product/add

Request (POST)

Field nameData typeRequiredDescription
product_namestringY, LName of the product to be added for the person.
id_numberstringYID number of the person paying for the product.
account_id_numberstringNUsed 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’.
subscription_idstringNID of the subscription to add the product to. Obtained from ‘Account Summary’. Defaults to the latest active subscription of the person; with active banking details.
amountNumberYAmount to be paid for the product; in cents.
branchstringN, LBranch product was recruited at
projectstringN, LProject product was recruited under
reference_numberstringNCustom 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_id_number": "xxxxxxxxxxxxx",
  "account_id_number": "xxxxxxxxxxxxx",
  "product_name": "Product 123",
  "unique_workflow_id" "xxxxxxxxxx",
  "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_id_number

String

ID number of the person paying for the product

account_id_number

String

ID number of the person receiving the product

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:

  • Payer ID number does not exist
  • Account ID number does not exist
  • Product not found
  • No active subscription found for the payer
  • Bank details of the payer is not valid
  • Subscription ID not found
  • Branch not found
  • Project not found
  • The subscription id value is malformed
  • The branch value is malformed
  • The project value is malformed
  • etc.

rule

String

Rule associated with the message e.g. ‘uuid’

Add Subscription

Add a new subscription for the specified person. 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/people/subscription/add

Request (POST)

Field nameData typeRequiredDescription
product_namestringY, LName of the product to be added for the person.
id_numberstringYID number of the person paying for the product.
account_id_numberstringNUsed 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’.
amountnumberYAmount to be paid for the product; in cents.
agentstringN, LName of the related agent, if not same as that specified by the API token
branchstringN, LBranch product was recruited at
projectstringN, LProject product was recruited under
start_datedateNDate when subscription is to start, defaults to next billing day
end_datedateNDate when subscription is to end, leave empty for no end date
billing_daynumberYCalendar day to make deductions on, 1 to 31
default_payment_methods_idstringY, LPayment method to be used with the subscription See ‘/api/1.0/lookups?category=Payment Methods’
bank_account_namestringCBank account holder name. Required when the payment method used is a debit order.
bank_account_numberstringCBank account number. Required when the payment method used is a debit order.
bank_account_bankstringC, LName 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_idstringC, LType 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_codestringCBranch 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 nameData typeDescription
statusbooleanTrue if the call succeeded, false if there is an error
errorsobjectObject specifying the problem with inputs e.g.
{ 
  "product_name": {
    "message": "Product not found",
    "rule": "Lookup"
  }
}
Field nameData typeDescription
billing_daynumberDate of month payment is to be deducted on, 1 to 31
amountnumberAmount to be paid for the product; in cents.
subscription_start_datedateWhen 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_datedateWhen the subscription is to stop running
account_id_numberstringID Number of the person being paid for
product_namestringName of the product being paid for
unique_workflow_idstringUnique ID associated with this workflow submission. Can be used to cancel a pending workflow item.
payer_id_numberstringID Number of the person paying for the product

Blacklist

Get a list of blacklisted phone numbers where the user requested not to be contacted.

Path
/people/blacklist/{sms|phone}

Request (POST)

Field nameData typeRequiredDescription
startdateNStart date filter on when record was flagged not to contact
enddateNEnd 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",
    "work": "081234567",
    "home": "081234567",
  }],
  "error": "String message"
}

Field name

Data type

Description

cellphone

String

Contact number

work

String

Contact number

home

String

Contact number

Errors Section

message

String

Reason why the API call failed:

  • Incorrect type passed
  • The start date is not in the correct format
  • The end date is not in the correct format

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


Copyright © 2024 SwitchTransact