Farmer Milk Insights — Kamdhenu

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

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). The accessToken returned in the consent response must be supplied as the x-sp-auth-token header. 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 consentotp header.
  • In Sandbox, the static OTP 123456 may be used for testing.

API endpoint

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

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

Request headers

HeaderDescriptionRequiredExample
AuthenticationJWT Bearer token generated via the Authentication and Authorization APIYesEkN-DOsn...
tsRequest timestamp in ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ)Yes2023-01-03T21:10:23+05:30
txncodeUnique alphanumeric transaction code provided by the lenderYes14f42cf5-6e0a-47b5-9e35-5df06b2c14ce
client-idBase64-encoded Client ID issued during onboardingYesR3NHRGFzVmJvNmJWRnNuQnRfbDZuOGgxOW13YQ==
providerService provider codeYes128
x-sp-auth-tokenAccess token returned by the Kamdhenu Consent API. Valid for 15 minutes (UAT) / 60 minutes (Production).YeseyJhbGciOiJIUzI1Ni...
consentotpOTP provided by the farmer for consent verification (valid for 10 minutes)Yes123456
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

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
data.dairyNameName of the dairy cooperative
data.farmers[].farmerCodeUnique farmer code assigned by the dairy
data.farmers[].farmerNameName of the farmer
data.farmers[].mobileMobile number of the farmer
data.farmers[].periodMonth and year the record pertains to (e.g., 2024-08)
data.farmers[].totalAmountTotal payment amount for the period (INR)
data.farmers[].totalQtyTotal milk quantity poured in the period (litres)
data.farmers[].averageFatAverage fat content percentage
data.farmers[].averageSnfAverage Solids-Not-Fat (SNF) percentage
data.farmers[].collectionCentreIdID of the milk collection centre
data.farmers[].collectionCentreNameName of the milk collection centre
data.farmers[].chillingCentreIdID of the chilling centre (if applicable)
data.farmers[].chillingCentreNameName of the chilling centre (if applicable)
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

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

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