createLoginPersonAndAccount
Overview
This mutation takes the required inputs and creates a login with borderless. In that process the users Account is created, the users Person is created or updated, and their login session is set.
Special Considerations
- Business accounts must supply a startUpSecret
- Email used must be unique to borderless
- Password must be at least 8 characters in length. With at least one uppercase letter (A-Z), lowercase letter (a-z) and number (0-9).
Inputs
CreateLoginPersonAndAccountArgs
Required Data
(these should eventually link to the types, AccountType, Country, etc)
accountType (required): AccountType
country (required): Country
currency: Currency
acceptedTermsTimestamp: DateTime
email (required): string
password (required): string
signUpSecret (required for business accounts only): string
Returns
Promise<AuthPayload>
A promise containing the following object / data:
user: {
person: createdOrUpdatePerson,
loginId: loginId,
account: createdAccount,
}
Example
Running this mutation:
mutation {
createLoginPersonAndAccount(data: {
accountType: BUSINESS
country: US
currency: USD
email: "docexample@getborderless.com"
password: "stRONgPassW0Rdh3r3"
signUpSecret: "SECRET-GOES-HERE"
}) {
user {
person {
email
}
loginId
account {
accountType
country
currency
status
}
}
}
}
Gives us:
{
"data": {
"createLoginPersonAndAccount": {
"user": {
"person": {
"email": "docexample@getborderless.com"
},
"loginId": "5ed7bf8b89399t0c555de8a3",
"account": {
"accountType": "BUSINESS",
"country": "US",
"currency": "USD",
"status": "NOT_SETUP"
}
}
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
Invalid sign-up code provided. (I-4201)
- Please provide a valid sign up code in all capital letters
This email already has an account. Sign in to add another. (I-4202)
- This email has already been registered with borderless