This page will contains the details of ONDC APIs Adaptors developed by NSDL eGov complied with Beckn Protocol
- Introduction
- ONDC API Adaptor Flow
- Deployment
- Postgres DB script
- Sample Postman Collection
- Configuration Details
- NSDL BG Configuration Details
- NSDL Sandbox
ONDC aims at promoting open networks developed on open-sourced methodology, using open specifications and open network protocols independent of any specific platform. NSDL eGov is helping building the ONDC API adaptors which is powered by Beckn Protocols for the netowrk participants who can easily run and integrate with their applications.
Two options are available:
- Default - Run it as a microservice. (It can be also docker enabled)
- Integration with Java application.
a. Put the jar file in maven dependency directory
b. Add package scan in pom.xml
Postgres DB scripts have been provided who wish to capture API transaction details in their database for audit.
Postman collection have been provided with sample json for each API services.
a. BAP - buyer node Configuration ("buyer node" compliant with Beckn BAP specifications)
- Application.yml
a) server:
port: 8080
b) ehcache:
cacheregion:
beckn-api:
common-cache:
timetolive: 86400
entrycount: 1000
lookup-cache:
timetolive: 1800
entrycount: 1000
c) beckn:
persistence:
type: http|db-postgres
audit-schema-error: true
entity:
type: buyer
Description :
-
port: it is server port number on which this jar will run
-
ehcache: The ehcache have been added which will cache the lookup api data fetched from the registry for the defined hours.
-
beckn.persistence.type: the pipe separated value for persistence strategy. Currently allowed values are http & db-postgres. Value http means response will be pushed to the url mentioned in the http_entity_endpoint parameter. If db-postgres used then response will be saved in database. Any other value is not allowed.
-
beckn.entity.type: the allowed values are bap or bpp. Depending on the value provided, jar will all auto configuration internally and start working accordingly . Any other value is not allowed.
- adaptor-config-bap.json
Sample Json
{
"keyid": "nsdl.co.in|nsdl_bpp_1",
"private_key": "XXXXXX",
"api": [
{
"name": "on_search",
"http_entity_endpoint": "http://localhost:8079/buyer/mock/on_search",
"http_timeout": 1000,
"http_retry_count": 3,
"header_validity": 600000,
"header_authentication": true
},
{
"name": "on_select",
"http_entity_endpoint": "http://localhost:8079/buyer/mock/on_select",
"http_timeout": 1000,
"http_retry_count": 3,
"header_validity": 600000,
"header_authentication": true
},
{
"name": "lookup",
"http_entity_endpoint": "https://pilot-gateway-1.beckn.nsdl.co.in/lookup",
"http_timeout": 5000,
"http_retry_count": 0,
"header_validity": 600000,
"header_authentication": true
}
]
}
Description: (As given in above example, add call back url configuration in array)
- keyid: it is the id that is used while registering as buyer to beckn.
- private_key: it is the private key of the buyer. This will be used while signing the authorization header.
- name: name of the api like search/select/init.
- http_entity_endpoint: http url for the entity endpoint of buyer.
- http_timeout: http call timeout in milliseconds .
- http_retry_count: http retry count in case of timeout error.
- header_validity: auth header validity in milliseconds.
- header_authentication: auth header validation check. Allowed values true or false. If false auth header validation will be skipped.
b. BPP - seller node Configuration ("seller node" compliant with Beckn BPP specifications)
- Application.yml
a) server:
port: 8080
b) ehcache:
cacheregion:
beckn-api:
common-cache:
timetolive: 86400
entrycount: 1000
lookup-cache:
timetolive: 1800
entrycount: 1000
c) beckn:
persistence:
type: http|db-postgres
audit-schema-error: true
entity:
type: seller
Description :
-
port: it is server port number on which this jar will run
-
ehcache: The ehcache have been added which will cache the lookup api data fetched from the registry for the defined hours.
-
beckn.persistence.type: the pipe separated value for persistence strategy. Currently allowed values are http & db-postgres. Value http means response will be pushed to the url mentioned in the http_entity_endpoint parameter. If db-postgres used then response will be saved in database. Any other value is not allowed.
-
beckn.entity.type: the allowed values are bap or bpp. Depending on the value provided, jar will all auto configuration internally and start working accordingly . Any other value is not allowed.
- adaptor-config-bpp.json
Sample Json
{
"keyid": "nsdl.co.in|nsdl_bpp_1",
"private_key": "XXXXXXX",
"api": [
{
"name": "search",
"http_entity_endpoint": "http://localhost:8079/seller/mock/search",
"http_timeout": 1000,
"http_retry_count": 3,
"header_validity": 600000,
"header_authentication": true
},
{
"name": "select",
"http_entity_endpoint": "http://localhost:8079/seller/mock/select",
"http_timeout": 1000,
"http_retry_count": 3,
"header_validity": 600000,
"header_authentication": true
},
{
"name": "lookup",
"http_entity_endpoint": "https://pilot-gateway-1.beckn.nsdl.co.in/lookup",
"http_timeout": 5000,
"http_retry_count": 0,
"header_validity": 600000,
"header_authentication": true
}
]
}
Description: (As given in above example, add call back url configuration in array)
- keyid: it is the id that is used while registering as seller to beckn.
- private_key: it is the private key of the seller. This will be used while signing the authorization header.
- name: name of the api like search/select/init.
- http_entity_endpoint: http url for the entity endpoint of seller.
- http_timeout: http call timeout in milliseconds .
- http_retry_count: http retry count in case of timeout error.
- header_validity: auth header validity in milliseconds.
- header_authentication: auth header validation check. Allowed values true or false. If false auth header validation will be skipped.
To get register at BG - gateway node/Registry node below field details required:
- subscriber_id
- Domain
- Entity Type (BAP/BPP)
- CallBack URL for On_Subscribe
- Signing Public Key
The end points for BG Gateway Node are as below: ("gateway node" compliant with Beckn gateway specifications)
a. Search : https://pilot-gateway-1.beckn.nsdl.co.in/search
b. On_search : https://pilot-gateway-1.beckn.nsdl.co.in/on_search
The end points for Registry Node are as below: ("registry node" compliant with Beckn registry specifications)
a. https://pilot-gateway-1.beckn.nsdl.co.in/subscribe
b. https://pilot-gateway-1.beckn.nsdl.co.in/lookup
Mail your details at : [email protected]
- BG - Gateway Node: As mentioned in section 7, provide details to get register with BG gateway node.
The end points for BG Gateway Node are as below:
a. Search : https://pilot-gateway-1.beckn.nsdl.co.in/search
b. On_search : https://pilot-gateway-1.beckn.nsdl.co.in/on_search
- Registry Node: As mentioned in section 7, provide details to get register with BG registry node.
The end points for Registry Node are as below:
a. https://pilot-gateway-1.beckn.nsdl.co.in/subscribe
b. https://pilot-gateway-1.beckn.nsdl.co.in/lookup