Quickstart
- Ask for sandbox access on the contact page. You get a test key, the reference for the APIs you picked and a Postman collection.
- Make a first call from the terminal (below) or Postman.
- Build your flow against sandbox responses, including the failure cases. They matter more than the happy path.
- Finish a short business KYC with us, swap in the production key, and you are live. Nothing else changes.
curl -X POST https://api.ampletrails.com/v1/pan/verify \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id_number": "ABCDE1234F", "name": "Ravi Kumar", "dob": "1990-04-12", "consent": "Y"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/pan/verify",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"id_number": "ABCDE1234F",
"name": "Ravi Kumar",
"dob": "1990-04-12",
"consent": "Y"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/pan/verify", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"id_number": "ABCDE1234F",
"name": "Ravi Kumar",
"dob": "1990-04-12",
"consent": "Y"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/pan/verify");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["id_number" => "ABCDE1234F", "name" => "Ravi Kumar", "dob" => "1990-04-12", "consent" => "Y"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"pan_status": "VALID",
"name_match": true,
"name_match_score": 96,
"dob_match": true,
"category": "Individual",
"aadhaar_linked": true,
"pan_operative": true
}
}Authentication
Send your secret key as a bearer token: Authorization: Bearer <key>. Sandbox and production keys are separate. Keep keys on your server; never put them in a mobile app or in browser JavaScript.
For flows the user completes on their own device (DigiLocker, Video KYC, eSign, WhatsApp KYC) your server creates a short-lived session and hands its token or link to the client. Production accounts can also restrict calls to a list of server IPs.
Response format
Every API answers in the same envelope, so one parser handles all of them:
{
"status": "success",
"request_id": "req_7f3a9c21e4",
"message": null,
"data": {
"...": "API-specific fields"
}
}Quote the request_id whenever you write to support. It lets us find the call in seconds.
Errors
| HTTP | Code | What it means |
|---|---|---|
200 | success | The check ran. Read data for the result. A record the source could not find is still a 200, with a clear flag in data. |
400 | bad_request | A required field is missing or badly formatted, for example a PAN that fails the 10-character format. |
401 | unauthorized | The key is missing, wrong, or from the other environment (sandbox vs production). |
402 | insufficient_balance | Your prepaid wallet is too low for this call. Top up and retry. |
403 | forbidden | This API is not enabled on your account, or the call came from an IP that is not on your allow-list. |
422 | verification_failed | The source rejected the input: a wrong OTP, an expired session, a consent that was declined. |
429 | rate_limited | Too many requests too quickly. Back off and retry. |
503 | source_unavailable | The government or bureau source is down or timing out. Retry later; these are usually short. |
Consent
Identity, financial and bureau checks need the person's informed consent, collected before the call and kept with a timestamp. Requests carry "consent": "Y" and, where the source asks for it, a short purpose string. OTP-based APIs (Aadhaar eKYC, GST with OTP, DigiLocker, eSign) collect consent from the user inside the flow. See our DPDP checklist.
Webhooks and long-running checks
Video KYC, eSign, bank statement analysis, filed-document pulls and bulk jobs return a session_id straight away and post the final result to your webhook. Webhooks carry an HMAC-SHA256 signature header so you can confirm they came from us. Reply with HTTP 200; failed deliveries are retried with backoff, and you can always fetch the result by ID.
Timeouts and retries
Government sources slow down at month-end and around filing deadlines. Set a client timeout of at least 30 seconds, retry 503 and 429 with exponential backoff, and do not retry other 4xx errors, which will fail the same way again. Default rate limits are set per account and raised on request before a big launch.
Sandbox
The sandbox returns fixed, realistic responses for documented test inputs, including success, not-found, mismatch and source-down cases, so you can build every branch before going live. Sandbox calls never reach a government system and are not billed.
Going live
- Business KYC with us: company documents and an authorised signatory.
- Agree pricing and billing: prepaid wallet or monthly invoice.
- Production keys, plus an IP allow-list if you want one.
- A named contact on our side for the first few weeks, reachable on WhatsApp and phone.