Integrate our AI-driven payment verification logic directly into your own website, dashboard, or mobile app using our REST API.
This endpoint accepts a multipart/form-data payload. The server extracts the text using Tesseract.js and securely passes it to Gemini 2.5 for complex error-correcting UTR verification.
| Field | Type | Description |
|---|---|---|
| utr | string | The User-provided 12-digit UTR or Reference Number. |
| image | file | The screenshot file uploaded by the user (PNG, JPG). |
curl -X POST https://YOUR_APP_URL.run.app/api/verify \ -F "utr=312345678901" \ -F "image=@/path/to/your/screenshot.jpg"
// Example Integration using JavaScript Fetch API
const verifyPayment = async (utr, imageFile) => {
// 1. Create FormData containing the UTR and the Image File
const formData = new FormData();
formData.append('utr', utr);
formData.append('image', imageFile);
try {
// 2. Add your full applet domain/url here
const response = await fetch('/api/verify', {
method: 'POST',
body: formData,
});
const result = await response.json();
// 3. Handle the structured verification response
if (response.ok && result.success) {
console.log('Verification Data:', result.data);
if (result.data.is_verified) {
alert('Payment is legit and successful!');
} else {
alert('Payment verification failed: ' + result.data.remarks);
}
} else {
console.error('API Error:', result.error);
}
} catch (error) {
console.error('Network or server error:', error);
}
};The API will always return a structured JSON response identifying if the screenshot actually proved payment. If is_verified is true, you can safely automatically approve their order/deposit.
{
"success": true,
"data": {
"user_entered_utr": "312345678901",
"extracted_utr": "312345678901",
"amount_paid": 500,
"is_verified": true,
"transaction_status": "SUCCESS",
"remarks": "UTR matched and payment successful"
},
"raw_ocr_text": "..." // Messy extracted text included for debug
}