BePrepared
  • 🚀Getting Started
  • 👨‍💼Clients
  • 🗒️Task List
  • 📂Files
Powered by GitBook
On this page
  • The Client Object
  • Creating a New Client
  • Create a client and loads a vault
  • Confirming Client Creation
  • Transfers a client from draft status to active
  • Suspending Client Access
  • Suspends a clients access to their vault.
  • Restoring Client Access
  • Removes client’s suspended, thereby granting them access to their vault.

Clients

Create clients, confirm their vaults, and suspend or permit access.

Using the BePrepared API, you are able to create secure digital legacy vaults quickly and easily.

A new vault is automatically generated for you each time you create a client, and connected with that client record.

The Client Object

The client object has the following attributes

Client Object

Example

{
	"id" : "client_kjslkdjs8947wkjhw4hjhJKH",
	"firstName" : "Jane",
	"lastName" : "Doe",
	"email" : "janedoe@test.com",
	"dateOfBirth" : {
			"day" : 10,
			"month" : 3,
			"year" : 1993
	},
	"connected" : false,
	"accessToVault" : true,
	"mainProvider" : false,
	"userRevokedAccess" : false,
	"status" : "draft",
	"statusReason" : "Secondary Rep",
	"inviteUrl" : null, 
	"inviteClientEndpoint" : "client/id/invite",
	"confirmCreationEndpoint" : "v1/clients/client_kjslkdjs8947wkjhw4hjhJKH/confirm",
	"releaseTracker" : null,
	"createdAt" : "2022-05-16T11:36:26.584+00:00",
	"updatedAt" : "2022-05-16T11:36:26.584+00:00"

id string

Unique identifier of the object.

firstName string

The first name of the client.

lastName string

The last name of the client.

email string

The email of the client. It must be a valid email.

mobileNumber string

The mobile number of the client is in international format. i.e it begins with '+XX'

dateOfBirth object DateOfBirth

On object representing the birth date of the client.

dateOfBirth.day number

The day of the month.

dateOfBirth.month number

The month of the year.

dateOfBirth.year number

The year of the birth.

connected boolean

Represents whether or not the user associated with the client has signed up.

accessToVault boolean

Represents whether or not the client has access to the vault. Main providers have the capability to suspend and grant their client’s access to their vault.

mainProvider boolean

Represents wether or not a business is the main provider of a Prepared Vault to someone with the same email address.

userRevokedAccess boolean

Represents whether or not a user has revoked the business access to their vault. A user can not revoke the access of their main provider.

status enum

Indicates whether or not the client object’s creation is completed or whether something needs to be confirmed before proceeding.

Possible enum values include:

  • draft - This client creation has not been completed.

  • active - This client creation has completed.

statusReason enum

Explains the reason the client object was created as a draft.

Possible enum values include:

  • Secondary_Rep - This client has the same email as an existing user in the the prepared system. Confirmation is needed due to the reduced functionality as continuing as a Secondary Representative.

inviteUrl string

The url that a client can use to create and account and sign up. This will only be populated if the client status is active and the client has not signed up yet.

inviteClientEndpoint string

The url endpoint to call to initiate the sending of an invite url to the client using The Prepared Company’s default email templates. This will only be populated if the client status is active and the client has not signed up yet.

confirmCreationEndpoint string

The url endpoint to call if you would like to confirm the creation of a client. This will only be populated if the client status is draft.

releaseTracker object

An object containing details of the release tracker. This will only contain data if the client has been reported deceased.

releaseTracker.active boolean

Wether or not the release tracker is valid and running.

releaseTracker.reporter boolean

Unique identifier of the representative or confidant that reported the death.

releaseTracker.currentStage enum

Identifies the stage the release tracker is in.

createdAt timestamp

A timestamp of when the client was created as UTC time.

updatedAt timestamp

A timestamp of when this client object was last updated as UTC time.

Creating a New Client

Creating a new client is the most fundamental function you will perform with our API.

Depending on your business case, the most important question you must answer is if you'll be automatically approving each new vault request (for example, if you create the vault after a checkout flow), or if some condition needs to be met before approval (for example, if you're running a waitlist).

Code Example

import axios from 'axios'

axios.post('/YOUR_API_URLv1/clients', {
      headers: { 'Authorization': 'Bearer API_KEY'},
      {
        firstName: 'John',
        lastName: 'Smith',
        email: 'example@domain.com',
        dateOfBirth: {
          day: 30,
          month: 12,
          year: 1992
        }
      }).then(res => {
      console.log(res);
    }).catch( err => {
      console.log(err);
    });
import requests

url = '/YOUR_API_URLv1/clients'
headers = {'Authorization': 'Bearer API_KEY'}
data = {
    'firstName': 'John',
    'lastName': 'Smith',
    'email': 'example@domain.com',
    'dateOfBirth': {
        'day': 30,
        'month': 12,
        'year': 1992
    }
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print(response.json())
else:
    print(response.status_code)
curl -X POST -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" -d '{
    "firstName": "John",
    "lastName": "Smith",
    "email": "example@domain.com",
    "dateOfBirth": {
        "day": 30,
        "month": 12,
        "year": 1992
    }
}' 'YOUR_API_URLv1/clients'

Request Details

Create a client and loads a vault

POST YOUR_API_URLv1/clients

Query Parameters

Name
Type
Description

autoApprove

Boolean

Determines if you want to accept this new vault creation request or not. Either true or false. Defaults to false

Headers

Name
Type
Description

Authorization*

String

Bearer <API_KEY>

Request Body

Name
Type
Description

firstName*

String

First name of client.

lastName*

String

Last name of client

email*

Email address of client

dateOfBirth

Object

Object containing date of birth of client

dateOfBirth.day

Number

Day of the month client was born

dateOfBirth.month

Number

Month of the year client was born

dateOfBirth.Year

Number

Year that the client was born

{
		"client" : {
		"id" : "client_kjslkdjs8947wkjhw4hjhJKH",
		"firstName" : "Jane",
		"lastName" : "Doe",
		"email" : "janedoe@test.com",
		"mobileNumber" : null,
		"dateOfBirth" : {
				"day" : 10,
				"month" : 3,
				"year" : 1993
		},
		"connected" : false,
		"accessToVault" : true,
		"mainProvider" : false,
		"userRevokedAccess" : false,
		"status" : "draft",
		"statusReason" : "Secondary Rep",
		"inviteUrl" : null, 
		"inviteClientEndpoint" : null,
		"confirmCreationEndpoint" : "v1/clients/client_kjslkdjs8947wkjhw4hjhJKH/confirm",
		"releaseTracker" : null,
		"createdAt" : "2022-05-16T11:36:26.584+00:00",
		"updatedAt" : "2022-05-16T11:36:26.584+00:00"
	}
}

Confirming Client Creation

Depending on your implimentation, you'll either be automatically confirming all clients, or approving clients before their vaults are created. This route is to be used if autoApprove param is false in the client creation route.

Code Example

import axios from 'axios'

axios.post('YOUR_API_URL/v1/clients/:clientId/confirm', {
      headers: { 'Authorization': 'Bearer API_KEY'},
      {}).then(res => {
      console.log(res);
    }).catch( err => {
      console.log(err);
    });
import requests

headers = {'Authorization': 'Bearer API_KEY'}

response = requests.post('YOUR_API_URL/v1/clients/:clientId/confirm', headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(response.text)
curl -X POST 'YOUR_API_URL/v1/clients/:clientId/confirm' \
-H 'Authorization: Bearer API_KEY'

Request Details

Transfers a client from draft status to active

POST YOUR_API_URL/v1/clients/:clientId/confirm

Path Parameters

Name
Type
Description

clientId*

String

ID associated with the client record

Headers

Name
Type
Description

Authorization

String

Bearer <API_KEY>

{
	"client" : {
		"id" : "client_kjslkdjs8947wkjhw4hjhJKH",
		"firstName" : "Jane",
		"lastName" : "Doe",
		"email" : "janedoe@test.com",
		"mobileNumber" : "+61485493282",
		"dateOfBirth" : {
				"day" : 10,
				"month" : 3,
				"year" : 1993
		},
		"connected" : false,
		"accessToVault" : true,
		"mainProvider" : false,
		"userRevokedAccess" : false,
		"status" : "active",
		"statusReason" : null,
		"inviteUrl" : "dummy/inviteurl/ksjfdslfje",
		"inviteClientEndpoint" : "client/id/invite", 
		"confirmCreationEndpoint" : null,
		"releaseTracker" : null,
		"createdAt" : "2022-05-16T11:36:26.584+00:00",
		"updatedAt" : "2022-05-16T11:36:26.584+00:00"
	}
}

Suspending Client Access

Sometimes you might wish to suspend client access, such as in the case of the ending of a free trial, or due to non-payment.

You can use the suspend route to temporarily prevent client access to the vault in these circumstances.

Code Example

import axios from 'axios'

axios.patch('YOUR_API_URL/v1/clients/:clientId/access/suspended', {
      headers: {
        'Authorization': 'Bearer API_KEY'
      },
      {}).then(res => {
      console.log(res);
    }).catch(err => {
      console.log(err);
    });
import requests

headers = {'Authorization': 'Bearer API_KEY'}

response = requests.patch('YOUR_API_URL/v1/clients/:clientId/access/suspended', headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(response.text)
curl -X PATCH 'YOUR_API_URL/v1/clients/:clientId/access/suspended' \
-H 'Authorization: Bearer API_KEY'

Request Details

Suspends a clients access to their vault.

PATCH YOUR_API_URL/v1/clients/:clientId/access/suspended

This can only be completed by the client’s main provider.

Path Parameters

Name
Type
Description

clientId*

String

ID associated with the client record.

Headers

Name
Type
Description

Authorization*

String

Bearer <API_KEY>

{
	"suspended": true
}

Restoring Client Access

The purpose of this route is to restore access to a clients vault if they proceed to a paid plan post free trial, or account invoices are no longer overdue.

Code Example

import axios from 'axios'

axios.patch('YOUR_API_URL/v1/clients/:clientId/access/granted', {
      headers: {
        'Authorization': 'Bearer API_KEY'
      },
      {}).then(res => {
      console.log(res);
    }).catch(err => {
      console.log(err);
    });
import requests

headers = {'Authorization': 'Bearer API_KEY'}

response = requests.patch('YOUR_API_URL/v1/clients/:clientId/access/granted', headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(response.text)
curl -X PATCH 'YOUR_API_URL/v1/clients/:clientId/access/granted' \
-H 'Authorization: Bearer API_KEY'

Request Details

Removes client’s suspended, thereby granting them access to their vault.

PATCH YOUR_API_IRL/v1/clients/:clientId/access/granted

This can only be completed by a client’s main provider.

Path Parameters

Name
Type
Description

clientId*

String

ID associated with the client record

Headers

Name
Type
Description

Authorization*

String

Bearer <API_KEY>

{
	"suspended": false
}
PreviousGetting StartedNextTask List

Last updated 2 years ago

👨‍💼