What does this API do?
The Milk Pouring Insights API for Aavin (service: aavin/farmerdata, service provider code: 129) retrieves comprehensive farmer data from Aavin — the Tamil Nadu Co-operative Milk Producers' Federation. A single API call returns a rich dataset organised into five categories:
- Farmer information — personal details including name, Aadhaar (last 4 digits), mobile, address, and family member names
- Dairy federation information — cooperative society, union, and federation hierarchy with onboarding date
- Cattle information — animal count, milking vs. non-milking split, breed, shed availability, and insurance status
- Milk pouring information — total, monthly, and yearly volumes poured; min/max/avg fat% and SNF%; milk-pouring gap indicators
- Income information — total, monthly, yearly, and aggregate (12/24/36 month) income from milk pouring, incentives, and loan deductions
Additionally, the response includes the farmer's registered bank account details (bank name, branch, account number, IFSC) to which the dairy credits payments.
Who can use it?
Lenders (banks and financial institutions) onboarded to the ULI Platform who need to assess the income and agricultural profile of dairy farmers registered with Aavin for credit appraisal purposes.
Prerequisites
Complete all common platform prerequisites as described in Getting Started with ULI Platform APIs.
Additionally, for this API:
- Subscribe to the Aavin service in the Platform Dev Portal (separately for Sandbox and Production).
- The farmer's Aadhaar number must be RSA-encrypted before passing it in the
aadharNumberheader. Use the following encryption parameters:- Algorithm: RSA/ECB/OAEPWithSHA-256AndMGF1Padding
- Hash Function: SHA-256 | MGF1 with SHA-256
- Key format: PEM (asymmetric public/private key pair)
- There is no separate consent/OTP step for this API. Aadhaar-based authentication is used directly.
API endpoint
| Environment | URL |
|---|---|
| Sandbox | https://extgw.nonprod.rbihub.io/aavin/farmerdata/1.0/en |
| Production | https://extgw.api.rbihub.io/aavin/farmerdata/1.0/en |
HTTP method: GET
URL parameters: {ver} = 1.0, {lang} = en
Request headers
| Header | Description | Required | Example |
|---|---|---|---|
Authorization | JWT Bearer token generated via the Authentication and Authorization API | Yes | EkN-DOsn... |
ts | Request timestamp in ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ) | Yes | 2025-04-17T15:59:46+0530 |
txncode | Unique alphanumeric transaction code provided by the lender | Yes | 14f42cf5-6e0a-47b5-9e35-5df06b2c14ce |
client-id | Base64-encoded Client ID issued during onboarding | Yes | R3NHRGFzVmJvNmJWRnNuQnRfbDZuOGgxOW13YQ== |
provider | Service provider code | Yes | 129 |
aadharNumber | RSA-encrypted Aadhaar number of the milk farmer (RSA/ECB/OAEPWithSHA-256AndMGF1Padding) | Yes | v1qOK7rxzgkp... |
api-key | 24-character alphanumeric API key (optional, reserved for future use) | No | 434950ee34353tty33463399 |
x-env-route | Required only for Sandbox access | Sandbox only | /sb |
Request body
This is a GET request. No request body is required.
Response fields
All response fields are returned under the data object.
| Field | Description |
|---|---|
result.errcode | Error code. E000 indicates success. |
result.status | success or fail |
meta.txncode | Lender-supplied transaction code |
meta.ver | Response template version |
meta.ts | Timestamp of the request in ISO-8601 format |
| farmerInfo | |
farmerName / l_farmerName | Farmer's name and translated name |
farmerid | Dairy-assigned farmer ID/code |
aadharNumber | Aadhaar number (last 4 digits shown) |
mobileNumber | Farmer's mobile number |
gender | Farmer's gender |
fatherName / spouseName | Father's and spouse's names (with translated variants) |
address, village, subDistrict, district, pincode | Full address details |
| dairyFedInfo | |
dairyFederationName | State-level federation name |
dairyUnionName / l_dairyUnionName | District-level union name and translated name |
dairySocietyName / l_dairySocietyName | Village-level society name and translated name |
onboardingDate | Date the farmer became a member |
collectionCentreName | Village-level collection centre name |
chillingCentreName | Chilling centre name (if applicable) |
| cattleInfo | |
animalCount | Total animals owned (milking + non-milking) |
milkingCount | Number of milking cattle |
nonmilkingCount | Number of non-milking cattle (including calves) |
breed | Cattle breed name |
shedAvailability | Whether a shed is available (Yes/No) |
cattleInsured | Whether cattle are insured (Yes/No) |
periodFrom / periodTo | Ownership date range |
| milkPouringInfo | |
totalMilkPouredTillDate | Cumulative milk poured to date (litres) |
totalMilkPouredCurrentMonth / CurrentYear | Milk poured in current month / year (litres) |
minMilkPouredCurrentYear / maxMilkPouredCurrentYear / avgMilkPouredCurrentYear | Min, max, and average monthly milk poured in current year (litres) |
monthOfMaxMilkPouredCurrentYear / monthOfMinMilkPouredCurrentYear | Months corresponding to max and min pouring in current year |
maxFat% / minFat% / avgFat% | Fat percentage — max, min, and average |
maxSnf% / minSnf% / avgSnf% | SNF percentage — max, min, and average |
milkPouringGap | Whether a milk-pouring gap exists (True/False) |
gapDaysinCurrentMonth / CurrentYear / PreviousYear | Gap day counts for current month, current year, and previous year |
| incomeInfo | |
totalAmountForMilkPouredTillDate | Cumulative income from milk poured to date (INR) |
totalAmountForMilkPouredCurrentYear | Income from milk poured in current year (INR) |
totalIncentivesTillDate / CurrentYear / CurrentMonth | Incentive amounts (INR) |
deductionAmountForloansTillDate / CurrentYear / CurrentMonth | Loan deduction amounts (INR) |
netMonthlyIncome / grossmonthlyIncome | Net and gross monthly income (INR) |
minIncomeMonthly / maxIncomeMonthly / avgIncomeMonthly | Min, max, and average monthly income (INR) |
aggregateIncome12months / 24months / 36months | Aggregate income for 12, 24, and 36 months (INR) |
| registeredBankInfo | |
registeredBankName | Name of the bank where dairy credits are deposited |
branchName | Bank branch name |
registeredAccountNumber | Bank account number (partially masked) |
ifsc | IFSC code of the branch |
| Envelope fields | |
signature | Digital signature (SHA256withECDSA) of the data object |
hmac | SHA-256 hash of the data object |
publickey | Platform public key for source verification |
sig-algo | Signing algorithm — SHA256withECDSA |
Error codes
| Error Code | Description |
|---|---|
E400 | Invalid aadharNumber |
Refer to the latest Platform Error Code document available in the Platform API Spec folder for all platform-level error codes.
Who to contact?
For integration support, email support@rbihub.in with the following details:
- Platform Service Name: Aavin
- Platform Environment: Sandbox / Production
- Service Provider Code: 129
- Request Payload (headers + body) sent to the platform
- Error Code and Error Message received
- Screenshot or log of the error
- Status of prerequisites: IP Whitelisting, URL Whitelisting, Service Subscription, Token Generation
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article