openapi: 3.0.3 info: title: Enabling crop loans on SAFAL - API Documentation description: >- API documentation for Safal portal, Beckn protocol server and Bank server communication version: 0.0.1 externalDocs: description: Find out more about Konnect url: 'https://github.com/Konnect-Agri' paths: /search: post: tags: - search summary: Search for the loan catalog description: Search for the loan catalog operationId: search requestBody: description: Search for the loan catalog content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - search message: type: object properties: intent: type: object properties: tags: type: object properties: block: type: string district: type: string bank_name: type: string required: - context - message responses: '200': description: Successful operation content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action message: type: object properties: catalog: $ref: '#/components/schemas/Catalog' required: - catalog required: - context '500': description: Internal server error content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action error: $ref: '#/components/schemas/Error' required: - context /select: post: tags: - select summary: Select a loan product from a catalog description: Select a loan product from a catalog operationId: select requestBody: description: Select a loan product from a catalog content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - select required: - action message: type: object properties: order: $ref: '#/components/schemas/SelectRequestObject' required: - order required: - context - message responses: '200': description: Successful operation content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action message: $ref: '#/components/schemas/SelectResponseObject' required: - context '500': description: Internal server error content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action error: $ref: '#/components/schemas/Error' required: - context /authenticate: post: tags: - authenticate summary: Send membership number entered by the farmer to the bank’s portal for validation operationId: authenticateFarmer requestBody: description: Validate farmer's membership number content: application/json: schema: $ref: '#/components/schemas/FarmerAuthRequest' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/FarmerAuthSuccess' '400': description: Invalid KCC / Aadhaar Number Supplied content: application/json: schema: $ref: '#/components/schemas/FarmerAuthError' /register: post: tags: - register summary: Register farmer operationId: registerFarmer requestBody: description: Register farmer for new membership ID content: application/json: schema: $ref: '#/components/schemas/FarmerRegRequest' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/FarmerRegSuccess' '400': description: Invalid registration request content: application/json: schema: $ref: '#/components/schemas/FarmerRegError' /calculate: post: tags: - calculate summary: Send farmer's land and crop details to bank for NCL calculation operationId: calculateNCL requestBody: description: Calculate farmers NCL content: application/json: schema: $ref: '#/components/schemas/FarmerNCLRequest' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/FarmerNCLSuccess' '400': description: Invalid KCC / Aadhaar Number Supplied content: application/json: schema: $ref: '#/components/schemas/FarmerNCLError' /registerConsent: post: tags: - Consent artifact request from Consumer summary: Consent artifact request from Consumer description: Consent artifact request from Consumer operationId: registerConsent requestBody: description: Consent artifact request from Consumer content: application/json: schema: $ref: '#/components/schemas/ConsentArtifact' responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/RegisterResponse' /init: post: tags: - init summary: Initialize the loan by filling out the application form description: Initialize the loan by filling out the application form requestBody: content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - init required: - action message: type: object properties: order: $ref: '#/components/schemas/SelectResponseObject' required: - order required: - context - message example: context: domain: agriculture action: init version: 1.0.0 bap_id: YASH-local-PS-BAP bap_uri: https://4de3-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io bpp_id: bpp.dsep.samagra.io bpp_uri: https://1a0d-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io transaction_id: a9aaecca-10b7-4d19-b640-b047a7c62196 message_id: $bb579fb8-cb82-4824-be12-fcbc405b6608 timestamp: '2022-12-12T09:55:41.161Z' ttl: PT10M message: order: id: order_123546876 provider: id: BANK 1 descriptor: name: BANK 1 items: - id: '1' descriptor: name: LOAN PRODUCT price: currency: INR value: '121345' provider: id: BANK 1 tags: - block: string district: string loan_tenure: string interest_rate: 0 processing_charges: 0 fulfillmentes: - id: fulfillment_id type: fulfillment_type provider_id: BANK 1 tracking: true agent: name: John Doe customer: person: name: Alex Copper dob: '1980-01-01' gender: MALE creds: - type: education qualification id: 12th marksheet number url: http://drive.google.com/link_to_doc.pdf - type: ror id: ror doc identifaction numnber url: http://drive.google.com/link_to_ror.pdf - type: aadhar card id: aadhar number url: http://drive.google.com/link_to_aadhar.pdf - type: any other ID proof (PAN Card) id: PAN Card number url: http://drive.google.com/link_to_PAN.pdf tags: - descriptor: short_desc: Personal details of the loan applicant list: - father-name: Michael Jordan marital-status: SINGLE spouse_name: NA social_category: OBC religion: HINDU billing: address: 123/45 Some Street, Great City payment: id: payment_id collected_by: farmer_name params: bank_code: ABCD12345 tags: - descriptor: short_desc: Additonal bank details list: - PACS: BANK PACS NAME tags: - descriptor: short_desc: Additonal Order Details list: - crop_type: rabi land_cultivation_area: '1234' permanent_address: 123/45 Some Street, Great City responses: '200': description: Successful operation content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action message: $ref: '#/components/schemas/SelectResponseObject' required: - context '500': description: Internal server error content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action error: $ref: '#/components/schemas/Error' required: - context /confirm: post: tags: - confirm summary: Initialize an order by providing billing and/or shipping details description: Initialize an order by providing billing and/or shipping details requestBody: content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - confirm required: - action message: type: object properties: order: $ref: '#/components/schemas/SelectResponseObject' required: - order required: - context - message example: context: domain: agriculture action: confirm version: 1.0.0 bap_id: YASH-local-PS-BAP bap_uri: https://4de3-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io bpp_id: bpp.dsep.samagra.io bpp_uri: https://1a0d-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io transaction_id: a9aaecca-10b7-4d19-b640-b047a7c62196 message_id: $bb579fb8-cb82-4824-be12-fcbc405b6608 timestamp: '2022-12-12T09:55:41.161Z' ttl: PT10M message: order: id: order_123546876 provider: id: BANK 1 descriptor: name: BANK 1 items: - id: '1' descriptor: name: LOAN PRODUCT price: currency: INR value: '121345' provider: id: BANK 1 tags: - block: string district: string loan_tenure: string interest_rate: 0 processing_charges: 0 fulfillmentes: - id: fulfillment_id type: fulfillment_type provider_id: BANK 1 tracking: true agent: name: John Doe customer: person: name: Alex Copper dob: '1980-01-01' gender: MALE creds: - type: education qualification id: 12th marksheet number url: http://drive.google.com/link_to_doc.pdf - type: ror id: ror doc identifaction numnber url: http://drive.google.com/link_to_ror.pdf - type: aadhar card id: aadhar number url: http://drive.google.com/link_to_aadhar.pdf - type: any other ID proof (PAN Card) id: PAN Card number url: http://drive.google.com/link_to_PAN.pdf tags: - descriptor: short_desc: Personal details of the loan applicant list: - father-name: Michael Jordan marital-status: SINGLE spouse_name: NA social_category: OBC religion: HINDU billing: address: 123/45 Some Street, Great City payment: id: payment_id collected_by: farmer_name params: bank_code: ABCD12345 tags: - descriptor: short_desc: Additonal bank details list: - PACS: BANK PACS NAME tags: - descriptor: short_desc: Additonal Order Details list: - crop_type: rabi land_cultivation_area: '1234' permanent_address: 123/45 Some Street, Great City responses: '200': description: Successful operation content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action message: $ref: '#/components/schemas/SelectResponseObject' required: - context '500': description: Internal server error content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action error: $ref: '#/components/schemas/Error' required: - context /track: post: tags: - track description: Track an active order summary: Track an active order requestBody: content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - track required: - action message: type: object properties: order_id: type: string callback_url: description: An URL where the actual tracking details (in our case loan application with review status) is hosted for fetching and display type: string format: uri required: - order_id required: - context - message example: context: domain: agriculture action: track version: 1.0.0 bap_id: YASH-local-PS-BAP bap_uri: https://4de3-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io bpp_id: bpp.dsep.samagra.io bpp_uri: https://1a0d-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io transaction_id: a9aaecca-10b7-4d19-b640-b047a7c62196 message_id: $bb579fb8-cb82-4824-be12-fcbc405b6608 timestamp: '2022-12-12T09:55:41.161Z' ttl: PT10M message: order_id: order-1681225144247 responses: '200': description: Successful operation content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_track required: - action message: type: object properties: tracking: type: object properties: id: type: string url: type: string status: type: string enum: [ 'active', 'inactive' ] required: - context '500': description: Internal server error content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action error: $ref: '#/components/schemas/Error' required: - context /update: post: tags: - update description: Respond to any queries that the bank has raised summary: Respond to any queries that the bank has raised requestBody: content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - update required: - action message: type: object properties: update_target: description: >- Comma separated values of order objects being updated. For example: ```"update_target":"item,billing,fulfillment"``` type: string order: description: Updated order object allOf: - $ref: '#/components/schemas/SelectResponseObject' required: - update_target - order required: - context - message example: context: domain: dsep:courses action: update version: 1.0.0 bap_id: YASH-local-PS-BAP bap_uri: https://4de3-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io bpp_id: bpp.dsep.samagra.io bpp_uri: https://1a0d-2401-4900-1c6e-578a-4bca-7bf8-cfae-148a.in.ngrok.io transaction_id: a9aaecca-10b7-4d19-b640-b047a7c62196 message_id: $bb579fb8-cb82-4824-be12-fcbc405b6608 timestamp: '2022-12-12T09:55:41.161Z' ttl: PT10M message: update_target: PAN, Aadhar order: id: order_123546876 provider: id: BANK 1 descriptor: name: BANK 1 items: - id: '1' descriptor: name: LOAN PRODUCT price: currency: INR value: '121345' provider: id: BANK 1 tags: - block: string district: string loan_tenure: string interest_rate: 0 processing_charges: 0 fulfillmentes: - id: fulfillment_id type: fulfillment_type provider_id: BANK 1 tracking: true agent: name: John Doe customer: person: name: Alex Copper dob: '1980-01-01' gender: MALE creds: - type: education qualification id: 12th marksheet number url: http://drive.google.com/link_to_doc.pdf - type: ror id: ror doc identifaction numnber url: http://drive.google.com/link_to_ror.pdf - type: aadhar card id: aadhar number url: http://drive.google.com/link_to_aadhar.pdf - type: any other ID proof (PAN Card) id: PAN Card number url: http://drive.google.com/link_to_PAN.pdf tags: - descriptor: short_desc: Personal details of the loan applicant list: - father-name: Michael Jordan marital-status: SINGLE spouse_name: NA social_category: OBC religion: HINDU billing: address: 123/45 Some Street, Great City payment: id: payment_id collected_by: farmer_name params: bank_code: ABCD12345 tags: - descriptor: short_desc: Additonal bank details list: - PACS: BANK PACS NAME tags: - descriptor: short_desc: Additonal Order Details list: - crop_type: rabi land_cultivation_area: '1234' permanent_address: 123/45 Some Street, Great City responses: '200': description: Successful operation content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action message: type: object properties: catalog: $ref: '#/components/schemas/SelectResponseObject' required: - catalog error: $ref: '#/components/schemas/Error' required: - context '500': description: Internal server error content: application/json: schema: type: object properties: context: allOf: - $ref: '#/components/schemas/Context' - properties: action: enum: - on_search required: - action error: $ref: '#/components/schemas/Error' required: - context components: schemas: Catalog: description: >- Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.
This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp
This is used in the following situations.
type: object properties: descriptor: $ref: '#/components/schemas/Descriptor' providers: type: array items: $ref: '#/components/schemas/Provider' Context: description: >- Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer's location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields.
  1. Demographic information about the transaction using fields like `domain`, `country`, and `region`.
  2. Addressing details like the sending and receiving platform's ID and API URL.
  3. Interoperability information like the protocol version that implemented by the sender and,
  4. Transaction details like the method being called at the receiver's endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.
This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions, type: object properties: domain: description: Domain code that is relevant to this transaction context type: string action: description: >- The Beckn protocol method being called by the sender and executed at the receiver. type: string version: type: string description: Version of transaction protocol being used by the sender. bap_id: description: Subscriber ID of the BAP allOf: - description: >- A globally unique identifier of the platform, Typically it is the fully qualified domain name (FQDN) of the platform. type: string bap_uri: description: Subscriber URL of the BAP for accepting callbacks from BPPs. allOf: - description: >- The callback URL of the Subscriber. This should necessarily contain the same domain name as set in `subscriber_id``. type: string format: uri bpp_id: description: Subscriber ID of the BPP allOf: - $ref: '#/components/schemas/Context/properties/bap_id/allOf/0' bpp_uri: description: Subscriber URL of the BPP for accepting calls from BAPs. allOf: - $ref: '#/components/schemas/Context/properties/bap_uri/allOf/0' transaction_id: description: >- This is a unique value which persists across all API calls from `search` through `confirm`. This is done to indicate an active user session across multiple requests. The BPPs can use this value to push personalized recommendations, and dynamic offerings related to an ongoing transaction despite being unaware of the user active on the BAP. type: string format: uuid message_id: description: >- This is a unique value which persists during a request / callback cycle. Since beckn protocol APIs are asynchronous, BAPs need a common value to match an incoming callback from a BPP to an earlier call. This value can also be used to ignore duplicate messages coming from the BPP. It is recommended to generate a fresh message_id for every new interaction. When sending unsolicited callbacks, BPPs must generate a new message_id. type: string format: uuid timestamp: description: Time of request generation in RFC3339 format type: string format: date-time ttl: description: >- The duration in ISO8601 format after timestamp for which this message holds valid type: string Descriptor: description: Physical description of something. type: object properties: name: type: string code: type: string Error: description: >- Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback. type: object properties: code: type: string description: >- Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo" paths: type: string description: >- Path to json schema generating the error. Used only during json schema validation errors message: type: string description: >- Human readable message describing the error. Used mainly for logging. Not recommended to be shown to the user. SelectRequestObject: description: Defines the schema for the order object sent in the `/select` request type: object properties: provider: description: Details of the provider of the ordered item type: object properties: id: description: ID of the provider of the loan product item type: string created_at: description: Timestamp at which the order was initiated and created type: string format: date-time updated_at: description: Timestamp at which the order was updated type: string format: date-time items: type: array items: type: object properties: id: type: string quantity: type: integer SelectResponseObject: description: Defines the schema for the order object sent as a reponse to select call type: object properties: order: type: object properties: id: description: ID of the order generated and added by the provider provider: description: Information about the provider of the loan product type: object properties: id: description: ID of the provider type: string descriptor: type: object properties: name: type: string items: type: array items: $ref: '#/components/schemas/LoanItem' fulfillmentes: type: array items: $ref: '#/components/schemas/LoanFulfillmentObject' billing: type: object properties: address: description: Address of the loan applicant type: string payment: type: object properties: id: description: ID of the payment type: string collected_by: description: Details of who the collector of payment is type: string params: description: Parameters of the payment type: object properties: bank_code: description: >- Bank code of the account where the deposit is to be made type: string tags: description: >- Various information requried for the loan application with no first class mapping in the beckn spec type: array items: type: object properties: descriptor: description: >- Description of the type of data enclosed by the list of items here type: object properties: short_desc: type: string example: Personal details of the loan applicant list: type: array items: type: object properties: descriptor: type: object properties: name: description: Name of the field type: string example: - descriptor: name: PACS value: BANK PACS NAME LoanFulfillmentObject: description: Defines a fulfullment object type: object properties: id: description: ID of the fulfillment type: string type: description: type of the fulfillment type: string provider_id: description: ID of the provider for this particular fulfillment type: string tracking: description: >- Indicator to show if tracking is supported or not for this fulfillment type: boolean agent: description: Details of the agent who will fulfill this fulfillment type: object properties: name: description: Name of the agent type: string customer: description: Information about the loan applicant type: object properties: person: description: Details of the person type: object properties: name: description: Name of the loan applicant type: string dob: description: Date of birth of the loan applicant gender: description: Gender of the loan applicant type: string creds: description: Credentials and documents for a customer type: object properties: type: description: type of the credential type: string id: description: ID of the credential type: string url: description: URL of the credential type: string tags: description: >- Various information requried for the loan application with no first class mapping in the beckn spec type: array items: type: object properties: descriptor: description: >- Description of the type of data enclosed by the list of items here type: object properties: short_desc: type: string example: Personal details of the loan applicant list: type: array items: type: object properties: descriptor: type: object properties: name: description: Name of the field type: string example: - descriptor: name: father-name value: john doe - descriptor: name: father-name value: john doe - descriptor: name: marital-status value: single LoanItem: description: >- Defines a loan item as it is structured inside the catalog send in `/on_search` type: object properties: id: description: ID of the loan item type: string descriptor: description: Contains the description for the loan item type: object properties: name: type: string price: description: Holds information about the loan amount type: object properties: currency: description: currency of exchange type: string value: description: actual price type: string provider: type: object properties: id: type: string tags: type: object properties: block: type: string district: type: string loan_tenure: type: string interest_rate: type: number processing_charges: type: number Provider: description: Describes the catalog of a business. type: object properties: id: type: string description: Id of the provider descriptor: $ref: '#/components/schemas/Descriptor' items: type: array items: $ref: '#/components/schemas/LoanItem' FarmerAuthRequest: type: object properties: kcc_number: type: string description: Membership Number entered example: 123ABC aadhaar_number: type: string description: Farmer's Aadhaar number example: XXXXYYYYZZZZ FarmerAuthSuccess: type: object properties: bank_token: type: string description: Authentication token from bank example: hKpKupTM391pE10xfQiorMxXarRKAHRhTfH_xkGf7U4 FarmerAuthError: type: object properties: error_code: type: string description: Code of the error example: 1001 error_message: type: string description: Message detailing the error example: Membership Number not found FarmerRegRequest: type: object properties: age: type: integer description: age of farmer example: 17 genderId: type: string enum: - "1" - "2" description: > Farmer's Gender: `1` - Male, `2` - Female example: "1" contactDetailList: type: array items: type: object properties: addressTypeId: type: string enum: - "1" - "2" description: > Farmer's Address Type: `1` - Permanent Address, `2` - Correspondence Address example: "1" districtId: type: number description: District ID of farmer example: 2 talukaId: type: number description: Taluka ID of farmer example: 7 villageId: type: number description: Village ID of farmer example: 620 digitalProofDetailList: type: array items: type: object properties: typeId: type: string enum: - "1" - "2" - "3" - "4" - "5" - "6" description: > Farmer's Identity proof Id: `1` - AADHAR CARD, `2` - PAN CARD, `3` - SIGNATURE, `4` - PHOTO, `5` - THUMB IMPRESSION, `6` - PASSPORT example: "1" typeName: type: string description: Based on typeId selected above example: AADHAAR CARD documentNumber: type: string description: Number entered by farmer example: 461124561223 memberCategoryId: type: string enum: - "AC0001" - "AC0003" - "AC0004" - "AC0005" description: > Farmer's category id: `AC0001` - GENERAL, `AC0003` - OTHERS, `AC0004` - SR. CITIZEN, `AC0005` - WOMEN example: "AC0001" name: type: string description: Farmer's name example: KOMALI Sane fatherSpouseName: type: string description: Farmer's father name if gender is male else spouse name example: Goutam customerTypeId: type: string enum: - "1" - "2" - "3" description: > Farmer's Type id: `1` - General, `2` - Individual, `3` - Others example: "1" membershipTypeId: type: string example: 1 farmerTypeId: type: string enum: - "1" - "2" - "3" description: > Farmer's caste: `1` - Small, `2` - Marginal, `3` - Others example: "1" dateOfBirth: type: string example: 23/04/2004 casteId: type: string enum: - "1" - "2" - "3" - "4" description: > Farmer's caste: `1` - OBC, `2` - SC, `3` - ST, `4` - General example: "1" educationId: type: string enum: - "1" - "2" - "3" - "4" - "9" - "10" - "11" - "12" description: > Farmer's education: SSC - `1`, Graduate - `2` , PostGraduate- `3`, HSC- `4`, Bachelor of Engineering- `9`, Bachelor of Science - `10`, Secondary School Certificate - `11`, Uneducated- `12` example: "1" occupationId: type: string enum: - "2" - "4" description: > Farmer's occupation: Farmer - `2`, Agri Labor - `4` example: "2" pacsId: type: string example: 00124 FarmerRegSuccess: type: object properties: status: type: string example: "200" message: type: string example: "Member Details Saved Successful with Member Id : 300900100014319 and Share Account Number : 300900100101373374" FarmerRegError: type: object properties: error_code: type: string description: Code of the error example: 1001 error_message: type: string description: Message detailing the error example: Invalid member type FarmerNCLRequest: type: object properties: district_code: type: integer description: District code of user example: 17 land: type: integer description: User's land in meters example: 1000 crop: type: object properties: code: type: integer description: Code of the crop selected by user name: type: string description: Name of the crop selected by user FarmerNCLSuccess: type: object properties: ncl: type: number description: NCL for farmer example: 50000 FarmerNCLError: type: object properties: error_code: type: string description: Code of the error example: 1001 error_message: type: string description: Message detailing the error example: Invalid crop code RegisterResponse: description: The object returned as response on a consent artifact request type: object properties: caId: description: ID of the consent artifact in UUID format type: string consent_artifact: description: The actual consent artifact sent along side the request allOf: - $ref: '#/components/schemas/ConsentArtifact' user_id: description: user id of the consumer data is requested from type: string state: description: current state of the request type: string created_by: type: string webhook_url: description: Webhook URL where the user was notified of the access request ConsentArtifact: description: This schema defines the structure of a consent artifact. In the description of fields, the term `user` refers to the entity whose data needs to be accessed. For example in case of Safal Odisha, the `user` will be a farmer whose data needs to be fetched from the Krushak Odisha database. type: object properties: signature: description: Cryptographic signature to check the integrity of a consent artifact type: string created: description: Date on which the artifact was created type: string expires: description: Date on which the consent agreed for expires type: string id: description: UUID of the consent artifact type: string revocable: description: Defines if the credential is revocable or not type: boolean collector: description: Information about the data collector type: object properties: id: type: string url: type: string consumer: description: Information about the data consumer (whoever will be using the data fetched using the consent artifact) type: object properties: id: type: string url: type: string provider: description: Information about the data provider type: object properties: id: type: string url: type: string revoker: description: Information about the artifact revoker type: object properties: id: type: string url: type: string user: description: Information about the user whose data can be accessed via this consent artifact type: object properties: id: type: string purpose: description: Purpose of the consent artifact type: string user_sign: description: crypotgraphic signature of the user whose data is to be accessed type: string collector_sign: description: cryptographic signature of the collector type: string frequency: description: This object represents the frequence with which the data can be accessed using this consent artifact. We can do `limit` number of requests within `ttl` number of seconds type: object properties: ttl: type: number limit: type: number total_queries_allowed: description: Total data retrieval queries that can be made using this consent artifact in its lifetime, after these are exhausted the consent artifact cannot be used to send further requests even if it not revoked or expired. type: number log: description: A log of the access requests type: object properties: consent_use: type: object properties: url: type: string data_access: type: object properties: url: type: string data: description: This is the superset GraphQL query containing of all the fields that the user has granted access to. type: string