Skip to content

Disable Employee

Request URL

POST /customer/disable-employee

Description

This endpoint can be used to disable an employee for a business customer. The term "employee" refers to an individual entity who is employed by the business customer. The term "business representative" refers to an entity that is specifically designated as a principal owner or authorized signer for the business. Business representatives cannot be disabled.

To check a business's employees, a request to /customer/status/:customerId may be made using the business customer ID as a path parameter. Any employees associated with a business customer are included in the "employees" array.

The individual customerId of the employee will be included as the "employeeId" in the /customer/disable-employee request. The business customerId will be included as the "companyId" in the /customer/disable-employee request.

New business cards and/or business accounts cannot be created for disabled employees. However, a disabled employee can still open new individual cards and/or accounts that are not associated with the business in which they have been disabled.

Schema

Property table for customer/disable-employee

Property Description Required Schema
companyId Business customer ID in connectFi Yes {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}
employeeId Individual customer ID in connectFi Yes {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}

Request Body

{
    "companyId": "cstab_7BX5DO49J48VeWKsJ6gWNb",
    "employeeId": "cstap_5XVGshc9neQlcWlslzN8H0"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "companyId": "cstab_7BX5DO49J48VeWKsJ6gWNb",
    "employeeId": "cstap_5XVGshc9neQlcWlslzN8H0"
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/customer/disable-employee',
  headers: {
    'Content-Type': "application/json",
    'x-connectfi-token': "A long random string token received from /auth/get-token request"
  },
  data
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "CONNECTFI_BASE_URL/customer/disable-employee" --data "{    \"companyId\":\"cstab_7BX5DO49J48VeWKsJ6gWNb\",   \"employeeId\":\"cstap_5XVGshc9neQlcWlslzN8H0\"}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request" 

Successful Response Examples

200 SUCCESSFUL RESPONSE

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "companyId": "cstab_7BX5DO49J48VeWKsJ6gWNb",
    "employeeId": "cstap_5XVGshc9neQlcWlslzN8H0"
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "reference": "ExtRefBCust100",
        "customerId": "cstab_7BX5DO49J48VeWKsJ6gWNb",
        "customerType": "business",
        "employees": [
            {
                "id": "cstap_6reGTr3k8vpAu8uFV7EdiN",
                "position": "Engineer 1"
            },
            {
                "id": "cstap_5XVGshc9neQlcWlslzN8H0",
                "position": "Engineer 1",
                "isDisabled": true
            }
        ]
    },
    "requestId": "375360b07fea11ee9b7427220cc6c212"
}