KYC List KYC documents
List KYC documents
Lists the documents stored for a customer, with their details and which sides have an image. Use a document's `id` to download its image.
Api-Key
Lists the documents stored for a customer, with their details and which sides have an image. Use a document's id to download its image.
The response includes each document number in plain text. Treat it as personal data. A customer with no documents gets a 404, not an empty list.
Path parameters
NameDescription
customer_idUUID of the customer
Response
Returns 200 OK. Stored documents
NameDescription
dataShow 3 child attributesobject
customer_idID of the customer the documents belong to
documentsStored documents. Keys are PascalCase except
id, has_front_image and has_back_image. Empty values are null.Show 10 child attributesobject[]
idDocument ID. Use it to download the image.
IDTypeDocument type, such as
ID_CARD, SELFIE or COMPANY_DOCIDSubTypeDocument subtype
IDNumberDocument number in plain text. Handle it as personal data.
IssuingCountryIssuing country (ISO 3166-1 alpha-3)
IssuedDateIssue date as uploaded
ExpiryDateExpiry date as uploaded
has_front_imageWhether a front image is stored
has_back_imageWhether a back image is stored
OriginalFilenameFile name sent at upload
countNumber of stored documents
errorErrors
| Status | Meaning |
|---|---|
| 200 | Stored documents |
| 400 | Invalid customer ID |
| 404 | Customer not found, or no documents stored |
| 500 | The documents could not be read |
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request GET \
--url 'https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents' \
--header 'Api-Key: <api-key>'
const response = await fetch('https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents', {
method: 'GET',
headers: {
'Api-Key': '<api-key>',
},
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents"
headers = {
"Api-Key": "<api-key>",
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents", nil)
if err != nil {
panic(err)
}
req.Header.Set("Api-Key", "<api-key>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
request["Api-Key"] = "<api-key>"
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Api-Key: <api-key>',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents"))
.header("Api-Key", "<api-key>")
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.gravv.xyz/v1/customers/42ad0adb-e134-4345-b4be-98e5021b0da8/kyc/documents");
request.Headers.TryAddWithoutValidation("Api-Key", "<api-key>");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200400404500OK
{
"data": {
"customer_id": "42ad0adb-e134-4345-b4be-98e5021b0da8",
"documents": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"IDType": "PASSPORT",
"IDSubType": "FRONT_SIDE",
"IDNumber": "A12345678",
"IssuingCountry": "NGA",
"IssuedDate": "2020-01-01",
"ExpiryDate": "2030-01-01",
"has_front_image": true,
"has_back_image": false,
"OriginalFilename": "passport_front.jpg"
}
],
"count": 1
},
"error": null
}
{
"data": null,
"error": "INVALID_REQUEST: The customer ID provided is not valid. Please verify the customer ID format."
}
{
"data": null,
"error": "CUSTOMER_NOT_FOUND: Customer not found. Please verify the customer exists in our system."
}
{
"data": null,
"error": "failed to retrieve KYC document data"
}