Customer Mutations

CreateCustomer

The createCustomer mutation allows you to create a new customer in the system.

Input Fields for createCustomer Mutation
The input field takes an object of type CustomerCreateInput containing the following fields:


bvn String <span style="color: brown;">Required</span>

The Bank Verification Number of the customer.


clientId ID <span style="color: brown;">Required</span>

A unique identifier for the client associated with the customer.


customIdentifier

When the customIdentifier parameter is provided, it generates a custom ID for the customer. By default, the system uses the format ACC-XXXX-XXXX, but with customIdentifier, it can be set to desired ID for instance CUSTOM-XXXX-XXXX.


email String <span style="color: brown;">Required</span>

The email address of the customer.


phone String <span style="color: brown;">Required</span>

address String

The customer's address


password String

The password the customer would like to set up for their account.


businessInformation JSON

The business data of the customer.


city String

The city where the customer is located


dateOfBirth DateTime

The birth date of the customer.


employerName String

The name of the customer's employer.


employmentStatus String

The employment status of the customer from these options Unemployed, Self Employed, Employed Full Time, Employed Part Time


facebookProfileUrl String

The URL of the customer's facebook profile.


facilityInformation JSON

The facilityInformation of the customer.


firstName String

The first name of the customer.


gender Gender

The gender of the customer.


geoLocation GeoLocation

The geolocation co-ordinates of the customer.


grossIncome String

The gross income of the customer.


hasExternalLoan Booelan


image Upload

The profile image of the customer


jobRole String

The job title of the customer.


lastName String

The last name of the customer.


**localGovernment ** String

The local government of the customer.


maritalStatus MaritalStatus

The marital status of the customer.

The MaritalStatus is an enum type object that takes the following options as strings:

  • Single

  • Married

  • Divorced


middleName String

The middle name of the customer.


monthlySalaryDueDay Int

The monthly salary due date of the customer.


netIncome String

The net income of the customer.


nextOfKinAddress String

The address of the customer's next of kin.


nextOfKinName String

The name of the customer's next of kin.


nextOfKinPhone String

The phone number of the customer's next of kin.


refereeEmail String

The email of the customer's referee.


refereeName String

The email of the customer's name.


refereePhone String

The phone number of the customer's referee.


refereeWorkPlace String

The workplace address and details of the customer's referee.


rentalInformation JSON

The rental information of the customer.


socialMediaInformation [SocialMediaInput]

The social media information of the customer.

The [socialMediaInput]is an array of objects that takes the following fields:

  • provider String <span style="color: brown;">Required</span>. This is the social media platform field.

  • profileId String . The profile id of the customer.

  • email String. The email of the customer associated to the social media platform.

  • name String. The social media name of the customer.

  • profileUrl String<span style="color: brown;">Required</span>. This is the profile URL of the customer.


state String

The state from which the customer belongs to.


title UserTitle

The official title of the customer.

The userTitle is an enum type object that takes the following options as strings:

  • Mr

  • Mrs

  • Miss

  • Chief


workAddress String

The work address of the customer.


workEmail String

The work email of the customer.


workStartDate DateTime

The start date of the customer at their workplace.


Response Fields for createCustomerMutation

The response field is an object of type <span style="color: #0969DA;">AuthPayload</span>


Code Sample & Sample Response:

mutation createCustomer($input: CustomerCreateInput!) { createCustomer(input: $input){ token } }
{ "input": { "clientId": "cjyk6z6h12edv0842nrmdhrlt", "bvn": "201789394414", "email": "test_customer@test.com", "customIdentifier": "CUSTOM-XXXX-XXXX_XXXX", // optional --incase you want a custom ID-- "password": "password", "phone": "8188555922" } } // Sample Input with all the data { "input": { "address": "9101 Leo Street", "businessInformation": "Owner of ABC Store", "facebookProfileUrl": "<https://www.facebook.com/john.doe>", "facilityInformation": "Large warehouse", "image": "<https://example.com/profile.jpg>", "socialMediaInformation": [ { "email": "john.doe@gmail.com", "name": "John Doe", "profileId": "johndoe123", "profileUrl": "<https://www.instagram.com/johndoe>", "provider": "Instagram" } ], "bvn": "201789394414", "city": "Lagos", "clientId": "cjyk6z6h12edv0842nrmdhrlt", "dateMovedIn": "2022-03-15", "dateOfBirth": "1985-08-10", "email": "john.doe@example.com", "employerName": "ABC Corporation", "employmentStatus": "Full-Time", "firstName": "John", "gender": "Male", "geoLocation": { "lat": 40.7128, "lon": -74.0060 }, "grossIncome": 60000, "hasExternalLoan": false, "jobRole": "Software Engineer", "lastName": "Doe", "localGovernment": "Abuja", "maritalStatus": "Single", "middleName": "Henry", "monthlySalaryDueDay": 15, "netIncome": 45000, "nextOfKinAddress": "1234 Elm Avenue", "nextOfKinName": "Jane Doe", "nextOfKinPhone": "8188555921", "password": "securePassword123", "phone": "8188555922", "refereeEmail": "referee@example.com", "refereeName": "Alice Smith", "refereePhone": "8188555927", "refereeWorkPlace": "XYZ Corporation", "rentalInformation": { "rentAmount": 1200, "leaseStartDate": "2021-05-01", "leaseEndDate": "2023-04-30" }, "state": "New York", "title": "Mr.", "workAddress": "456 Tech Lane", "workEmail": "john.doe@abc-corp.com", "workStartDate": "2020-01-15" } }
{ "data": { "createCustomer": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjdXN0b21lcklkIiwiaWF0IjoxNjMwNzIzMjM1LCJleHAiOjE2MzA3MjY4MzV9.qoSIQ8XvQ4DvbBGGm4uqgIWiP3_aY5Ahb2v6M0XtTCU" } } }

Upon successful creation of the customer, the mutation will return a token field in the response. This token can be used for authentication and authorization purposes.


BVN Phone Number Confirmation

This mutation triggers a BVN (Bank Verification Number) phone confirmation process for a user.

Input Variables

  • input: A required object containing the following fields:

    • userId (String): The unique identifier of the user for whom the BVN phone confirmation is being triggered.

    • bvnPhoneDigits (String): The last 10 digits of the phone number associated with the user's BVN. This information is required to initiate the confirmation process.


Work Email Verification

If requiresWorkEmail is true and the system does not blacklist the email domain, the mutation triggerWorkEmailConfirmation is called, and a six-digit OTP is sent to the customer’s work email.

This mutation is used to send an OTP to the registered work email of the customer.

This mutation is used to confirm the verification