What does this API do?
The Farmer Milk Insights API for Kamdhenu (service: kamdhenu/farmerdata, service provider code: 128) retrieves comprehensive farmer milk data from the Kamdhenu dairy cooperative network. The response provides a month-by-month breakdown covering total milk quantity poured, total payment amount, average fat content, average SNF (Solids-Not-Fat) content, and associated collection centre details for up to the most recent five months.
This data enables lenders to objectively assess a dairy farmer's income pattern and repayment capability based on actual milk production records.
Who can use it?
Lenders (banks and financial institutions) onboarded to the ULI Platform who need to assess the income of dairy farmers registered with the Kamdhenu cooperative network 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 Kamdhenu service in the Platform Dev Portal (separately for Sandbox and Production).
- Complete the consent flow first by calling the Consent for Milk Insights — Kamdhenu API (
kamdhenu/consent). TheaccessTokenreturned in the consent response must be supplied as thex-sp-auth-tokenheader. This token is valid for 15 minutes in UAT and 60 minutes in Production. - Obtain the farmer OTP from the consent step. The OTP is valid for 10 minutes. Supply it as the
consentotpheader. - In Sandbox, the static OTP
123456may be used for testing.
API endpoint
| Environment | URL |
|---|---|
| Sandbox | https://extgw.nonprod.rbihub.io/kamdhenu/farmerdata/1.0/en |
| Production | https://extgw.api.rbihub.io/kamdhenu/farmerdata/1.0/en |
HTTP method: GET
URL parameters: {ver} = 1.0, {lang} = en
Request headers
| Header | Description | Required | Example |
|---|---|---|---|
Authentication | 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 | 2023-01-03T21:10:23+05:30 |
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 | 128 |
x-sp-auth-token | Access token returned by the Kamdhenu Consent API. Valid for 15 minutes (UAT) / 60 minutes (Production). | Yes | eyJhbGciOiJIUzI1Ni... |
consentotp | OTP provided by the farmer for consent verification (valid for 10 minutes) | Yes | 123456 |
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
| 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 |
data.dairyName | Name of the dairy cooperative |
data.farmers[].farmerCode | Unique farmer code assigned by the dairy |
data.farmers[].farmerName | Name of the farmer |
data.farmers[].mobile | Mobile number of the farmer |
data.farmers[].period | Month and year the record pertains to (e.g., 2024-08) |
data.farmers[].totalAmount | Total payment amount for the period (INR) |
data.farmers[].totalQty | Total milk quantity poured in the period (litres) |
data.farmers[].averageFat | Average fat content percentage |
data.farmers[].averageSnf | Average Solids-Not-Fat (SNF) percentage |
data.farmers[].collectionCentreId | ID of the milk collection centre |
data.farmers[].collectionCentreName | Name of the milk collection centre |
data.farmers[].chillingCentreId | ID of the chilling centre (if applicable) |
data.farmers[].chillingCentreName | Name of the chilling centre (if applicable) |
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
Refer to the latest Platform Error Code document available in the Platform API Spec folder for the full list of platform-level error codes.
Who to contact?
For integration support, email support@rbihub.in with the following details:
- Platform Service Name: Kamdhenu
- Platform Environment: Sandbox / Production
- Service Provider Code: 128
- 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