Upload a cardholder's ID and selfie from your own app, submit them for review, then finish the one liveness step cards need.
8 min read
This recipe uploads a cardholder's ID and selfie from your own app, submits them for review, and then finishes the one liveness step that cards need.
Who it is for. A neobank that already photographs the customer's ID card and selfie in its own app, and does not want to send people to a hosted page for documents.
Status. Available.
Money example
1.
You upload Chidi's ID front, ID back and selfie, and submit them. No money moves.
2.
Verification completes. The activation response asks for a liveness check, and Chidi finishes it on his phone.
3.
You activate again, and Chidi gets a virtual card with a 200 USD daily limit. You top it up with 50 USD.
Files are JPEG, PNG or PDF, and the selfie must be an image. Each file is under 5 MB before base64, or under 500 KB in sandbox. File names end in .jpg, .jpeg, .png or .pdf.
•
Gravv does not deduplicate a request body over 1 MiB under its Idempotency-Key. A retried upload of a file over about 770 KB runs again instead of returning the first response. The repeated upload replaces the earlier file of the same type and side.
•
Send countries as 3-letter codes (NGA), including on the selfie.
•
Use one upload flow per person. Documents uploaded through /v1/customers/kyc/* use other type names.
Find out what is required
A person needs a selfie plus one of passport, id_card or drivers_license. The submit call names anything missing. It returns HTTP 200 with data.codeMISSING_DOCUMENTS and details.missing_documents.
Steps
1. Upload each document
Send one call per image, each with a new Idempotency-Key. content is plain standard base64 of the file.
"message": "Document saved. Use /initiate-kyc to submit for verification."
},
"error": null
}
Check that data.status is success. A bad file returns HTTP 200 with data.statuserror. Repeat the upload for the back ("idDocSubType": "BACK_SIDE", chidi-id-back.jpg) and the selfie:
200 with data.statuserror, error_codeINVALID_REQUEST
A 2-letter country, a wrong file extension, content that is not JPEG, PNG or PDF, a PDF selfie, an unknown idDocType, a date not YYYY-MM-DD, or a missing field
Check each rule, then resend with a new key
200 with data.statuserror, error_codeDOCUMENT_ERROR
Gravv could not store the file
Retry with a new key
400 grpc: received message larger than max (…) or 413 request_body_too_large
The file is too large
Compress the image under 5 MB
413 the uploaded file is too large — the maximum is 5MB
In sandbox, any request of about 600 KB or more, whatever the message says
Compress the image under 500 KB
400 INTERNAL_ERROR: Failed to get KYC information
The customer has no verification record
Check that the customer id is yours
200 with codeMISSING_DOCUMENTS
You did not upload a required file
Upload it, then submit again with a new key
200 with statuspartial_success
Gravv refused one or more files
Send Chidi to web_url, or upload again and resubmit
pending_liveness again after Chidi finished
You reused the first key, or the review is not back yet
Wait for the KYC webhook, then activate again with a new key
400 failed to check liveness requirement: customer applicant_id is required for liveness verification
You receive customer.kyc.status.completed, or customer.kyc.status.failed with failure_reason. This route sends no customer.kyc.status.pending event. After activation, you receive the card events listed in the hosted-check recipe.
Testing in sandbox
Upload small valid images, under 500 KB each. A 1×1 PNG passes the content check. Sandbox completes the review a few minutes after the start, whatever you upload. Activation for a verified customer with no liveness returns pending_liveness, as in live.