Customer Queries
Customer
The customer
query allows you to query customer data based on various parameters and retrieve specific fields.
Input Fields for customer
Query
The input field takes an object of type <span style="color: #0969DA;">CustomerByParamsInput
</span> containing the following fields:
name String
<span style="color: brown;">Required</span>
The name of the customer.
clientId ID
<span style="color: brown;">Required</span>
The client ID for the client associated with the customer.
Response Fields for customer
Query
The response field is an object of type <span style="color: #0969DA;">Account</span>
Code Sample & Sample Responses:
query customer($input: CustomerByParamsInput!){
customer(input: $input){
id
name
}
}
{
"input": {
"clientId": "cjyk6z6h12edv0842nrmdhrlt",
"name": "Baines"
}
}
{
"data": {
"customer": {
"id": "cju8fz9j5hdfq0751n2p2x5ns",
"name": "Baines"
}
}
}
🚧 Note!!!
Please ensure that you replace placeholder values with actual values when making API requests. If you encounter any issues or need further assistance, please refer to this documentation or contact our support team.
CustomerById
This query allows you to retrieve a customer by their ID.
Input Fields for customerById
Query
The query just takes an ID as the input field.
Id. ID
<span style="color: brown;">Required</span>
This is the ID of the customer.
Response Fields for customerById
Query
The response field is an object of type <span style="color: #0969DA;">Account</span>
Code Sample & Sample Responses:
CustomerBvnStatus
This query allows you to retrieve the BVN (Bank Verification Number) status of a customer based on their BVN and client ID.
Input Fields for CustomerBvnStatus
Query
The input field takes an object of type <span style="color: #0969DA;">CustomerBvnStatusInput
</span> containing the following fields:
bvn String
<span style="color: brown;">Required</span>
The BVN number of the customer.
clientId. ID
<span style="color: brown;">Required</span>
The client ID for the client associated with the customer.
bvnDOB DateTime
The date of birth associated with the BVN provided.
bvnPhoneDigits String
The phone number associated with the BVN provided.
Response Fields for CustomerBvnStatus
Query
The response field is an object of type <span style="color: #0969DA;">CustomerBvnStatus
</span>containing the following fields:
dateOfbirth DateTime
The date of birth associated with that customer.
firstName String
The first name associated with the BVN provided.
hasCustomerAccount Boolean
If the customer has an associated customer account.
isVerified Boolean
If the account is the user details are verified.
lastName String
The last name associated with the BVN provided.
name String
The name associated with the BVN provided.
number String
The bank verification number.
phone String
The phone number associated with the customer.
Code Sample & Sample Responses:
In the sample response, the name
field represents the name of the customer whose BVN status is being queried. The sample error demonstrates a scenario where the provided client ID is invalid.
Please note that in the Sample Response
section, you should replace # Add more fields with sample data here
with the actual fields and data that you want to return for the customer. This could include attributes like name
, email
, address
, etc., depending on your schema and the information you want to expose.
📘 Understand your Error!!!
In the sample error response, the
message
field provides a description of the error, thelocations
field indicates where the error occurred in the query, and thepath
field specifies the path to the field where the error occurred (customerById
in this case).
CustomerRemitaStatus
Retrieve the Remita status for a customer.
Input Fields for CustomerRemitaStatus
Query
The input field takes an object of type <span style="color: #0969DA;">CustomerRemitaStatusInput
</span> containing the following fields:
**customerPhoneNumber ** String
The phone number of the customer.
clientId ID
The client ID associated with the customer.
Response Fields for CustomerRemitaStatus
Query
The response field is an object of type <span style="color: #0969DA;">CustomerRemitaStatus
</span> containing the following fields:
hasRemitaData Boolean
If the customer has any remita data.
accountNumber String
The account number of the associated customer.
bankId String
The ID of the bank associated to the customer.
companyName String
The name of the company associated to the customer.
countSalaryCredits String
The
customerId String
The ID of the customer.
customerName String
The name of the customer.
salaryPaymentDetails SalaryPaymentDetails
loanHistoryDetails [LoanHistoryDetails]
Code Samples && Sample Responses
In the sample response above, the query retrieves the Remita status for a customer using the provided client ID and customer phone number. The hasRemitaData
field in the response indicates whether Remita data is available for the provided customer. If successful, the query returns a JSON object containing the status. In case of an error, the response includes an error message along with location information.
customerSummary
This document outlines the GraphQL API for retrieving a summary of customer age groups using the CustomerSummary
query. It provides information about the number of customers falling into different age ranges.
In the sample response, the customerSummary
field contains the count of customers in different age groups:
youngAdults
: Count of customers categorized as young adults. middleAged
: Count of customers categorized as middle-aged. aged
: Count of customers categorized as aged.
views
This query allows you to retrieve a list view of customers with pagination.
Input Variables
first
: The number of customers to retrieve per page. (Type: Int)page
: The page number of the results to retrieve. (Type: Int)
Response Explanation
nodes
: An array of customer objects, each containing the following information:fullName
: The full name of the customer.phoneNumber
: The phone number of the customer.
pageInfo
: Information about the pagination:hasNextPage
: Indicates whether there are more pages of results available.
customerAmountEligibility
This API provides a query customerAmountEligibility
to retrieve the eligible amount and paid amount for a customer. It takes an input variable of type CustomerAmountEligibilityInput
.
Query Variables:
input
: An object containing the following fields:categoryId
(required): A string representing the unique identifier of the category for which you want to determine the customer's eligibility amount.
Sample Response:
The response will include the following fields:
amount
: A numeric value representing the eligible amount for the customer in the specified category.paid
: A boolean value indicating whether the customer has already paid the eligible amount.