Hosted and mobile capture
Capturing ID and selfie images in your own app today, and the hosted capture flow that is coming soon.
Your app captures the document and selfie images and your server sends them to the API. This works today on web and mobile.
Web#
Use a file input with the camera hint on phones, read the file and send it to your server. Your server calls the API with your key.
HTML
<input type="file" accept="image/jpeg,image/png" capture="environment" id="doc">
<input type="file" accept="image/jpeg,image/png" capture="user" id="selfie">Browser JavaScript
async function toBase64(file) {
const buf = await file.arrayBuffer();
let s = "";
new Uint8Array(buf).forEach((b) => (s += String.fromCharCode(b)));
return btoa(s);
}
// Send to YOUR server, never straight to the API: the API key stays on the server.
await fetch("/your-server/verify-seller", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
documentImage: await toBase64(doc.files[0]),
selfieImage: await toBase64(selfie.files[0]),
}),
});Mobile apps#
- Use the platform camera (for example AVFoundation on iOS or CameraX on Android) and save a JPEG.
- Base64-encode it and send it to your server, which calls POST /api/v1/kyc/verify.
Image guidance#
- JPEG or PNG. Around 1500 to 2000 pixels on the long edge is plenty.
- The whole document in frame, flat, with no glare over the text or photo.
- The whole request can be up to 10 MB.
Hosted capture: coming soon
A hosted capture page you can send sellers to by link or QR code, and mobile SDKs. Until then, capture in your own app as shown above.