KYC
How to verify a customer's identity, through a hosted page or the API, and how to read the result.
Know your customer (KYC) verification confirms a customer's identity before you create an account or activate some features. This page shows how to submit documents, start verification and read the result.
You can submit documents for verification in two ways, through a hosted page or through the API. Whichever way you use, Gravv sends the outcome as a customer.kyc.status.completed or customer.kyc.status.failed webhook and records it on the customer. Get a customer returns kyc, and the status of its basic entry becomes completed or failed.
Gravv bills verification to your business, at your pricing. Gravv bills a hosted start once. Starting again after a failure or an expired link gives a new link at no extra fee. Gravv bills every server-to-server start again, so do not call it in a loop. A start that Gravv refuses before submission, because a document or an associated person's KYC is missing or because the review is still running (KYC_IN_PROGRESS), is not billed.
In sandbox, every finished review completes, whatever you upload, about 3 minutes after submission. See Verify a customer in sandbox.
Required documents
Individual customers must provide a selfie and one government-issued identity document, with at least its front side:
Business customers must provide four company documents: a certificate of incorporation, a shareholder registry, a proof of address, and a tax document. Verify the people first. Before you start verification for a business, every associated person linked to it must have basic KYC completed. Verify each person with their own customer id. Otherwise the start returns 400 ASSOCIATED_PERSONS_INCOMPLETE. The message names every person whose KYC is not completed, with their customer_id, the step they need and the call that finishes it, for example Associated person "Tunde Bakare" (customer_id 5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b) is waiting for review: ….
A money example. Adire Logistics wants to pay a 12,000.00 USD freight invoice. You verify its director Tunde first, upload the four company documents, then verify the business. With basic KYC completed, the business can open an account and, on the standard limits, move up to 50,000.00 USD a day.
Businesses with automatic verification
Gravv can set up your business so that KYC completes from the uploaded documents alone. For such a business, the hosted start returns 400 INVALID_REQUEST: this tenant uses document-based auto verification; upload required documents instead. Instead, upload the documents and call the server-to-server start, which returns {"status": "completed", "message": "KYC auto-approved for this tenant."}.
Submit through the hosted page
Use the Start KYC verification endpoint to let a customer upload their identity documents on a hosted page. The endpoint needs only the customer's id:
The response includes the verification status and a web_url link. Share this link with the customer so they can upload their ID documents and complete a liveness check. The link is valid for one hour. If it expires, or the review fails, call the endpoint again with a new Idempotency-Key. You get a fresh link at no extra fee. The same key replays the old link. For a customer whose KYC is already completed, the response has review_status completed and no link.
A pending response looks like this:
Submit through the API
To submit documents through the API, Base64-encode each document, upload it with the Upload document endpoint, then call the Initiate server-to-server verification endpoint.
Upload documents
Upload each required document with the Upload document endpoint. Encode the document in Base64 and send the raw Base64 string, not a data: URI, as the content value. Upload each side of a two-sided document as its own request. The Idempotency-Key header is required.
A successful upload returns a confirmation:
The message lists what is still required before you initiate verification. Once every required document is in, it reads Document saved. All required documents are uploaded; call POST /v1/customers/kyc/start-s2s with customer_id aabe0a33-6716-42e2-bbca-7abf1a8bd91c to submit them for verification. For a business whose associated persons are not all verified, it ends once every associated person's KYC is completed instead. Uploading the same type and sub-type again replaces the earlier document.
The metadata object describes the document. idDocType and idDocSubType values are uppercase, and country is a 2-letter or 3-letter uppercase ISO code.
| Field | Required for | Description |
|---|---|---|
idDocType | All documents | Document type. Individual customers: PASSPORT, ID_CARD, DRIVERS, SELFIE, PROOF_OF_ADDRESS, or TAX_DECLARATION. Business customers: COMPANY_DOC. |
idDocSubType | Identity and company documents | Identity documents: FRONT_SIDE or BACK_SIDE. COMPANY_DOC: INCORPORATION_CERT, SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS, TAX_DOCUMENT, or OTHER. Omit for SELFIE, PROOF_OF_ADDRESS and TAX_DECLARATION. |
country | All documents except SELFIE | Issuing country as a 2-letter or 3-letter uppercase ISO code, such as NG or NGA. |
number | PASSPORT, ID_CARD, DRIVERS | Document identification number. |
validUntil | PASSPORT, ID_CARD, DRIVERS | Expiration date in YYYY-MM-DD format. |
issuedDate | Optional | Issue date in YYYY-MM-DD format. |
firstName | Optional | First name as shown on the document. |
lastName | Optional | Last name as shown on the document. |
middleName | Optional | Middle name as shown on the document. |
dob | Optional | Date of birth in YYYY-MM-DD format. |
placeOfBirth | Optional | Place of birth as shown on the document. |
Uploads follow these rules:
content and does not check the filename extension.Idempotency-Key. A file over about 770 KB makes a body that large, so a retried upload of it runs again instead of returning the first response. After a timeout, read the documents list before you upload again.YYYY-MM-DD.idDocType and idDocSubType before the other fields. An unknown type, or a sub-type that doesn't fit the type, returns 400 INVALID_DOCUMENT_TYPE with the accepted values.DOCUMENT_TYPE_NOT_ALLOWED, which says where it goes. Upload a person's identity documents with the associated person's id, and company documents with the business's id.completed, an upload returns 409 KYC_ALREADY_COMPLETED, and the stored documents stay as they are. A pending or failed KYC still accepts uploads.A business customer uploads four company documents. Each uses idDocType COMPANY_DOC, with one of the sub-types INCORPORATION_CERT, SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS, and TAX_DOCUMENT (or OTHER). Gravv refuses REGISTRATION_CERTIFICATE with 400 INVALID_DOCUMENT_TYPE. This request uploads the certificate of incorporation:
Repeat the request with a new Idempotency-Key for SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS and TAX_DOCUMENT.
Initiate verification
After you upload all required documents, call the Initiate server-to-server verification endpoint with the customer's id:
Gravv starts the review and sends the outcome as a webhook. Gravv bills each call, except one it refuses before submission. Call it once, and again only after you replace what a rejection named.
For a pending verification, the API returns:
Errors on the KYC endpoints are strings that start with a code. If a step is missing, the code names it, and the message names the customer and the call that fixes it. If a required document is missing, the request fails with HTTP 400 DOCUMENTS_MISSING, and the message lists only what is missing:
The other answers that stop a start:
| Response | When | What to do |
|---|---|---|
400 DOCUMENTS_MISSING on a business | Company documents are missing. The message lists them, for example Certificate of Incorporation (idDocType COMPANY_DOC, idDocSubType INCORPORATION_CERT) | Upload them with the business's id |
400 ASSOCIATED_PERSONS_INCOMPLETE | A business has associated persons whose KYC is not completed. The message names each person, with their customer_id and next step, and lists any company documents still missing | Finish each person's step and upload what is named, then start the business |
409 KYC_IN_PROGRESS | You started again while the review of the earlier submission is running. Gravv does not bill this call | Wait for the webhook, or poll the status |
400 SUBMISSION_INCOMPLETE | The review refused the submission. The message gives the reason, and KYC stays unsubmitted | Upload what the message asks for, then start again |
400 DOCUMENT_REJECTED | The review refused one uploaded file. The message names it, with its document_id and the reason | Upload a corrected file with the same idDocType, then start again |
409 KYC_ALREADY_COMPLETED: KYC verification has already been completed for this customer. | The customer's KYC is already completed | No action is needed |
500 failed to upload documents to verification provider | Sending the documents failed. KYC stays unsubmitted | Retry with the same Idempotency-Key |
Outside a running review, a repeat start submits again and is billed again, for example while the review waits for more documents. Gravv replays a 4xx response for 24 hours under its Idempotency-Key, so after you fix the step, start again with a new key.
Verification through the API records no liveness check. A customer verified this way completes a liveness step later if they apply for a card.
Check verification status
The final decision is the customer's basic KYC entry, or the customer.kyc.status.* webhook. To see where the review stands in the meantime, call the Get applicant verification status endpoint.
Before any verification is submitted, the endpoint returns 404 KYC_NOT_INITIATED, and the message names the calls to make. A customer verified by automatic document verification has no review, so the endpoint returns 404 KYC_ALREADY_COMPLETED. Read that customer's basic entry with Get a customer instead.
While the review is in progress, the value of the reviewStatus field is pending and there's no reviewResult field:
Once the review finishes, reviewStatus is completed and reviewResult holds the decision:
A rejected review lists the reason codes in rejectLabels, and reviewRejectType shows whether the customer can resubmit:
The status data object contains:
reviewStatus: pending while the review is in progress, or completed once a decision is returned.reviewResult: the decision, present once the review is completed.reviewAnswer: approved or rejected.rejectLabels: reason codes for a rejection, present only when reviewAnswer is rejected.reviewRejectType: the rejection category, such as RETRY, present only when reviewAnswer is rejected.reviewDate: the decision timestamp, present once the review is completed.priority: the applicant's review priority.Get uploaded documents
To see which documents a customer has uploaded, call the Get KYC document data endpoint. It returns the metadata for each uploaded document, newest first:
IDNumber is the full document number, in plain text. Do not log it, and show it only to people allowed to see identity data.
no KYC document data found for customer, not an empty list. Treat it as "no documents".FRONT_SIDE and one BACK_SIDE.