addAccountToPerson
Overview
This mutation takes the required inputs and creates another account for the Person in the current login session.
Special Considerations
- The input AccountType can either be PERSONAL or BUSINESS
- Each login is only able to have one PERSONAL and one BUSINESS account
Inputs
addAccountToPersonArgs
Required Data
accountType: AccountType
Returns
Promise<AuthPayload>
A promise containing the following object / data:
user: {
loginId: ID,
person: privatePerson
account: privateAccount,
numAccounts: int
}
Example
Running this mutation:
mutation {
addAccountToPerson(accountType:PERSONAL) {
user {
loginId
person {
id
firstName
lastName
email
}
account {
id
slug
status
name
displayName
}
numAccounts
}
}
}
Gives us:
{
"data": {
"addAccountToPerson": {
"user": {
"loginId": "5ed7bf8b89399t0c555de8a3",
"person": {
"id": "ckb8bx8iw00r30772r4sq1ns5"
"firstName": "Jane",
"lastName": "Smith",
"email": "docexample@getborderless.com"
},
"account": {
"id": "ckb9j25bp00680a72yy2kjz8h"
"slug": null,
"status": "NOT_SETUP"
"name": null,
"displayName": null
}
}
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
You have reached your limit for accounts with this email. (I-4402)
- The Person in the current login session has already created both a business and personal account
You have already created an account of this account type. (I-4403)
- You already have a business or personal account.