Skip to main content

Purchase First Insurance Product

Now that you have an API key and Postman set up, we can now make our first interaction with the API. We have provided a Sandbox environment as a playground for testing and development purposes. When you are fully ready to make real-time implementation, proceed to use the Live URL instead.

Firstly, you will create a new customer on the server, then with the new customer you created, you will make your first insurance purchase!

Create a New Customer

To create a new customer, send a POST request to the Create a New Customer endpoint. The request body for creating a new customer includes the following:

curl --location --request POST 'https://api.playbox.grow.curacel.co/api/v1/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data-raw '{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"ref": "189jwsp1",
"middle_name": "Smith",
"sex": "M",
"birth_date": "1990-10-10",
"bvn": "93201832987",
"occupation": "Accountant",
"city": "Ikeja",
"residential_address": "6, city street, Lagos, Nigeria",
"state": "Lagos",
"nationality": "Nigerian",
"country": "Nigeria",
"next_of_kin_name": "Jane Doe",
"next_of_kin_phone": "pariatur velit nulla anim",
"proof_of_address": {
"type": "Electricity bill",
"url": "https://example.com/proof_of_address.jpg"
}
}'

The following parameters may be omitted

  • bvn
  • proof_of_address
  • ref (will be automatically generated)

In a real-time production environment, if the above parameters are absent, the customer will get an email notification with instructions to provide them.

A successful request returns a 201 response with a new customer created, identified by their unique ref.

{
"id": 7906,
"ref": "189jwsf7",
"first_name": "John",
"last_name": "Doe",
"birth_date": "1990-10-10T00:00:00.000000Z",
"email": "john.doe@example.com",
"phone": null
}
One Customer Cannot be Created Twice!

Ensure you type different details when trying to create a new customer, else a 422 error will be displayed!

First Insurance

Purchase First Insurance Product

Awesome! At this point, let's make your first insurance order purchase using the customer you created earlier. Therefore, the customer's unique ref and the insurance policy's product code must be provided.

Head on to the Purchase an Insurance Product for a Customer endpoint on your Postman.

For this example, we will purchase the AXA Classic 1 insurance product we displayed earlier using the customer we created. Consequently, let's copy the code for AXA Classic 1 which is 6857ryh and our customer ref of 189jwsf7 (in this case).

Grow Orders

📘 Time To Go Deeper!

For full documentation and description of every endpoint and parameter, feel free to consult the Curacel Grow Reference Docs