Create an individual customer, send them to Gravv's hosted ID and liveness check, and wait for basic KYC to complete.
7 min read
This recipe creates an individual customer, sends the customer to Gravv's hosted ID and liveness check, and waits for basic KYC to complete.
Who it is for. A Lagos savings app that signs up Amara, a salaried nurse, and wants Gravv's hosted page to check her ID and take a liveness selfie.
Status. Available. In sandbox, every finished review completes (see Testing in sandbox).
Money example
No money moves in this recipe, but it prepares Amara to move money:
1.
You create Amara. Her KYC is not_started, so on the standard limits she can move 500.00 USD a day.
2.
She passes the hosted check. Her KYC is completed, and her limit becomes 50,000.00 USD a day.
3.
You can now open her a USD account and receive her 1,200.00 USD salary into it.
Before you start
•
You have an API key. A scoped key needs customer:create, and customer:update or customer:kyc_override.
•
You have registered a webhook URL in the Dashboard, under Manage, then Configure, then Webhooks, to receive customer.kyc.status.*. Without one, read the customer instead.
•
You have Amara's legal name as on her ID, her email, her phone with country code, her date of birth, her gender, and her home address with city, postal code, ISO state and country.
Find out what is required
•
No call lists the create fields. The rules are fixed, and Onboard your first customer lists them. A wrong field returns a 400 that names the field.
•
You send no documents. The hosted page asks the person for one ID (passport, national ID card or driver's license) and a selfie.
•
To find out whether she already exists, call GET /v1/customers?keyword=<email>. Each email can belong to only one customer in your business.
Open web_url for Amara, as a redirect or in an in-app browser. The link is valid for 1 hour. Her basic row is now pending and carries the same link as kyc_url. Gravv bills your business once for the check. If the link expires, call start again with a new key. You get a new link, with no second fee.
4. Wait for the result
Wait for customer.kyc.status.completed or customer.kyc.status.failed, or read the customer:
Find the row by type, not by position, because the order is not fixed.
•
The basic row moves from not_started to pending, then to completed or failed. A failed row carries a remark. See Resubmit KYC after a rejection.
•
Gravv sets verified_at on every row, not_started included. It holds the row's creation time and does not mean "verified". Use status.
•
GET /v1/customers/{customer_id}/kyc/status shows the live review, for display. The decision that counts is the row and the webhook. On the live review, reviewStatuscompleted with reviewAnswerrejected means failed.
What can go wrong
Response
Why
Fix
400 failed to add customer: email already exists
The email belongs to another customer in your business
Find it with ?keyword=<email> and reuse it
400 failed to add customer: external_id already exists
Another customer already has that external_id
Send another one, or leave it out
400 phone number is not valid
The number is not a real, dialable number
Send E.164 with the country code
400 invalid state "LA": expected ISO 3166-2 code (e.g. "NG-LA")
You sent a bare state code
Send NG-LA
400 first name cannot contain special characters
The name has an accent, digit or dot
Send Adaeze, not Ádaeze
400 with the same text after you fixed the body
Gravv replayed the old response under the same key
Use a new key
400 INVALID_REQUEST: this tenant uses document-based auto verification; upload required documents instead
The id is wrong, or comes from the other environment
Check the id and the key's environment
503 verification provider not configured
A temporary fault
Retry later with the same key
Webhooks you will receive
1.
customer.created. Its event_data holds id, type, status, email, address, created_at and the two not_started KYC rows. It carries no names and no phone.
2.
customer.kyc.status.pending, after the start.
3.
customer.kyc.status.completed (with completed_at) or customer.kyc.status.failed (with failure_reason).
Deduplicate webhooks on the body's event_id, never on X-Event-ID. See Customer and KYC events.
Testing in sandbox
Creating the customer, starting KYC and opening the hosted link work with a grvSec_sandbox_ key. The link opens the verification service's own test page. A finished review completes a few minutes later, whatever images you send, and Gravv sends customer.kyc.status.completed. Sandbox never produces a failed review, so you cannot test a rejection. See Verify a customer in sandbox.