Milk Pouring Insights — Aavin

Created by Rajatha B M, Modified on Fri, 27 Mar at 2:33 PM by Rajatha B M

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 aadharNumber header. 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

EnvironmentURL
Sandboxhttps://extgw.nonprod.rbihub.io/aavin/farmerdata/1.0/en
Productionhttps://extgw.api.rbihub.io/aavin/farmerdata/1.0/en

HTTP method: GET
URL parameters: {ver} = 1.0, {lang} = en

Request headers

HeaderDescriptionRequiredExample
AuthorizationJWT Bearer token generated via the Authentication and Authorization APIYesEkN-DOsn...
tsRequest timestamp in ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ)Yes2025-04-17T15:59:46+0530
txncodeUnique alphanumeric transaction code provided by the lenderYes14f42cf5-6e0a-47b5-9e35-5df06b2c14ce
client-idBase64-encoded Client ID issued during onboardingYesR3NHRGFzVmJvNmJWRnNuQnRfbDZuOGgxOW13YQ==
providerService provider codeYes129
aadharNumberRSA-encrypted Aadhaar number of the milk farmer (RSA/ECB/OAEPWithSHA-256AndMGF1Padding)Yesv1qOK7rxzgkp...
api-key24-character alphanumeric API key (optional, reserved for future use)No434950ee34353tty33463399
x-env-routeRequired only for Sandbox accessSandbox 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.

FieldDescription
result.errcodeError code. E000 indicates success.
result.statussuccess or fail
meta.txncodeLender-supplied transaction code
meta.verResponse template version
meta.tsTimestamp of the request in ISO-8601 format
farmerInfo
farmerName / l_farmerNameFarmer's name and translated name
farmeridDairy-assigned farmer ID/code
aadharNumberAadhaar number (last 4 digits shown)
mobileNumberFarmer's mobile number
genderFarmer's gender
fatherName / spouseNameFather's and spouse's names (with translated variants)
address, village, subDistrict, district, pincodeFull address details
dairyFedInfo
dairyFederationNameState-level federation name
dairyUnionName / l_dairyUnionNameDistrict-level union name and translated name
dairySocietyName / l_dairySocietyNameVillage-level society name and translated name
onboardingDateDate the farmer became a member
collectionCentreNameVillage-level collection centre name
chillingCentreNameChilling centre name (if applicable)
cattleInfo
animalCountTotal animals owned (milking + non-milking)
milkingCountNumber of milking cattle
nonmilkingCountNumber of non-milking cattle (including calves)
breedCattle breed name
shedAvailabilityWhether a shed is available (Yes/No)
cattleInsuredWhether cattle are insured (Yes/No)
periodFrom / periodToOwnership date range
milkPouringInfo
totalMilkPouredTillDateCumulative milk poured to date (litres)
totalMilkPouredCurrentMonth / CurrentYearMilk poured in current month / year (litres)
minMilkPouredCurrentYear / maxMilkPouredCurrentYear / avgMilkPouredCurrentYearMin, max, and average monthly milk poured in current year (litres)
monthOfMaxMilkPouredCurrentYear / monthOfMinMilkPouredCurrentYearMonths 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
milkPouringGapWhether a milk-pouring gap exists (True/False)
gapDaysinCurrentMonth / CurrentYear / PreviousYearGap day counts for current month, current year, and previous year
incomeInfo
totalAmountForMilkPouredTillDateCumulative income from milk poured to date (INR)
totalAmountForMilkPouredCurrentYearIncome from milk poured in current year (INR)
totalIncentivesTillDate / CurrentYear / CurrentMonthIncentive amounts (INR)
deductionAmountForloansTillDate / CurrentYear / CurrentMonthLoan deduction amounts (INR)
netMonthlyIncome / grossmonthlyIncomeNet and gross monthly income (INR)
minIncomeMonthly / maxIncomeMonthly / avgIncomeMonthlyMin, max, and average monthly income (INR)
aggregateIncome12months / 24months / 36monthsAggregate income for 12, 24, and 36 months (INR)
registeredBankInfo
registeredBankNameName of the bank where dairy credits are deposited
branchNameBank branch name
registeredAccountNumberBank account number (partially masked)
ifscIFSC code of the branch
Envelope fields
signatureDigital signature (SHA256withECDSA) of the data object
hmacSHA-256 hash of the data object
publickeyPlatform public key for source verification
sig-algoSigning algorithm — SHA256withECDSA

Error codes

Error CodeDescription
E400Invalid 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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article