Company
Overview
A company
entity represents a business set up by a group of people. It can be the holder of a policy.
Example:
For a employees compensation product, the policy holder is a company entity and the insured could be an array of individual entities
Fields usually used
Fields | Description |
---|---|
acceptsMarketing | whether or not the company is willing to receive marketing notification |
associatedLogin | the login details of the company for authentication purpose |
caseHolderOf | list of cases which the company associated with, if any |
createdAt | the timestamp when the company was created |
events | a list of change events happened to the company |
fields | dynamic fields associated with the company (usually in form of json) |
holderOf | list of policies which the company holds, if any |
id | the id which was automatically generated when the company was created |
notes | additional notes on the company with tile and content |
name | the name of the company |
notifications | list of notifications (email, sms) sent to the individual, if any |
notificationList | similar to notifications, but with totalCount available |
stakeHolders | list of entities which the company is a stakeHolder (eg. an company can be a stakeHolder of another company) |
subscriptions | list of topics that the company subscribed to |
tags | tags added to describe the company |
relationshipList | list of links between entities added by mutation.addLink |
To see a full list of fields please visit our Playground
Creating a Company
Query Examples
mutation createCompany(
$input: createCompanyInput!
) {
createCompany(
createCompanyInput:$input
) {
createdStatus { id ids }
errors
status
}
}
Input:
{
"input":{
"registrationNumber": "BR123",
"natureOfBusiness": "Medical",
"email": "[email protected]",
"nameFormat": "Test Company",
"fields": "{\"address\":\"Unit 603, 6\/F, Tower 1, Admiralty Centre 18 Harcourt Road, Admiralty, Hong Kong\",\"phone\":\"+852 12345678\",\"companySize\":200}"
}
}
Example Result:
{
"data": {
"createCompany": {
"createdStatus": {
"id": "661e3924-b2e2-4d07-887e-a35fbe73255d",
"ids": null
},
"errors": null,
"status": "success"
}
}
}
Querying Companies
Query Examples
query companies {
companies {
list {
id
acceptsMarketing
associatedLogin { id username email isEmailConfirmed }
caseHolderOf { id name }
createdAt
events { type }
fields
holderOf { id }
id
name
notes { title content }
notifications { id }
notificationList { list {id} }
stakeholders { entity { id name }}
subscriptions { id startDate endDate }
tags
relationshipList { list { type values { key value }} }
}
}
}
Example Results:
{
"data": {
"companies": {
"list": [
{
"id": "661e3924-b2e2-4d07-887e-a35fbe73255d",
"acceptsMarketing": null,
"associatedLogin": null,
"caseHolderOf": [],
"createdAt": "2021-04-30T04:56:41.477Z",
"events": [
{
"type": "creation"
},
{
"type": "addContact"
}
],
"fields": "{\"address\":\"Unit 603, 6/F, Tower 1, Admiralty Centre 18 Harcourt Road, Admiralty, Hong Kong\",\"phone\":\"+852 12345678\",\"companySize\":200}",
"holderOf": [],
"name": "Test Company",
"notes": [],
"notifications": [],
"notificationList": {
"list": []
},
"stakeholders": null,
"subscriptions": [],
"tags": null,
"relationshipList": {
"list": null
}
}
]
}
}
}
For more details on how to create login for company, please refer to Login.