General

Lookups

General Lookups API Calls

General Lookups

This API returns all lookup values to be used in all other API calls including the Contact Centre API.

Path
GET /lookups

Request (GET)

Any of the following query parameters can be provided for filtering results.

Query ParameterData typeDescription
typestringFilter by lookup type
categorystringFilter by lookup category

Response (JSON)

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

JSON response
{
  "lookups": [{
  "id": "56926d84-6039-4f32-b46a-73d2d5d7f7c5",
  ...
  }, ...]
}

Lookups section

Field name

Data type

Description

id

uuid

ID number associated with lookup, can be used as an input to other API call values. Null if it can not be used as an input e.g. for product unit names.

type

string

Type associated with the lookup e.g. ‘Bank’

title

string

Descriptive lookup string e.g. ‘NEDBANK’, can be used as an input to other API call values

category

string

Category associated with the lookup e.g. ’BankAccounts’

value

string

Optional value associated with the lookup e.g. ‘198765’

parent_lookups_id

uuid

Used by ‘Regions’ (provinces) and ‘ID’ number type categories, links to ‘Country’ IDs. When set to null this field is applicable to all countries.

To filter general lookups pass the type and/or category query parameters, e.g. /lookups?type=Bank&category=BankAccounts.

Bank Names

This API returns all the banks along with their default branch codes.

Path
GET /lookups/bank/names

Success Response:

{
    "status": true,
    "records": [{
        "id": "{bank lookups id}",
        "name": "ABSA",
        "branch": "632005"
    }, ...]
}
FieldTypeDescriptionExample
idstringLookup ID of the bank, used in other API calls"{bank lookups id}"
namestringName of the bank"ABSA"
branchstringDefault branch code of the bank"632005"

Bank Account Types

This API returns all the bank account types.

Path
GET /lookups/bank/accounts

Success Response:

{
    "status": true,
    "records": [{
        "id": "{bank account type lookups id}",
        "title": "Cheque/Current",
        "code": "1"
    }, ...]
}
FieldTypeDescriptionExample
idstringLookup ID of the bank account type, used in other API calls"{bank account type lookups id}"
titlestringName of the bank account type"Cheque/Current"
codestringCode associated with the bank account type"1"

Agents

This API returns the ID and name of all active agents. For full agent details see the Contacts API.

Path
GET /lookups/agents

Success Response:

{
    "status": true,
    "records": [{
        "id": "{agents record_id}",
        "name": "John Doe"
    }, ...]
}

Custom Field Lookups

This API returns lookup values to be used in all other API calls.

Path
GET /lookups/custom_fields/{people|companies}

Request (GET)

Response (JSON)

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

{
  "status": true,
  "records": {
    "Farm Type": {
      "type": "enum",
      "name": "Farm Type",
      "description": "Main produce",
      "options": ["Pork", "Veggies"]
    },
    ...
  }
}

Records section

Field name

Data type

Description

type

string

String, enum, number, decimal, boolean, date, array or enum_array. Enum is used to select a single value and enum_array is a multi select scenario. Both array and enum_array values should be passed as comma separated strings e.g. ‘potatoes,grapes,pumpkins’

name

string

Key name to be used for the custom field

description

string

Optional description about the custom field.

options

array

String array of options available for enum and enum_array types.


Copyright © 2024 SwitchTransact