Getting Started with ONDC
What is ONDC?
Open Network for Digital Commerce (ONDC) is a market-led initiative aimed at enabling interoperability in Digital Commerce.
Based on the principles of Openness, it aims to enable unbundling Digital Commerce, democratising Digital Commerce and unlock value for all parts of Digital Commerce, as well as enable innovation to unlock the next chapter of Digital Commerce. — ONDC LinkedIn
After the groundbreaking implementation of UPI (Unified Payment Interface), we have the next big thing in the form of ONDC.
The way UPI simplified the payments in India, ONDC will level the playing field of digital commerce.
How does it work?
ONDC is not a website or an app but it's a network. An open network built on top of Beckn protocol that makes it possible for any buyer/seller/logistics partner/credit provider, etc. to communicate with each other in a standardized language.
Which in turn makes the ecosystem open for anyone to participate.
So any buyer can use a buyer app to search for any products/services and sellers can list their offerings and serve orders.
Operations in ONDC
ONDC uses async APIs, which buyer apps and seller apps have to integrate to use the network.
In the list below you will find the APIs implemented in ONDC. The APIs starting with on_ are callback APIs/webhooks.
Example. The buyer app will call search API to search an offering. Once this call is sent buyer app will get a unique id in response. Now the on_search hook of the buyer app will be called by the network to provide the result of the search from the sellers.
- search - on_search
- select - on_select
- init - on_init
- confirm - on_confirm
- status - on_status
- track - on_track
- cancel - on_cancel
- update - on_update
- rating - on_rating
- support - on_support
- get_cancellation_reasons
- cancellation_reasons
- get_return_reasons
- return_reasons
- get_rating_categories
- rating_categories
- get_feedback_categories
- feedback_categories
- get_feedback_form
- feedback_form
The flow of a transaction
In the image above you can see the sequence of operations being performed from search to rating.
Let’s see it in action
You can play around with a demo implementation of ONDC here.
Also if you open developer tools in your browser you can see the flow of the search to understand how Async APIs are being used with UI and Backend.
In response to the search API call, we get a unique message_id which is used to verify if the data received by the on_search hook is correct.
In the video above you can see the flow of search API in the demo app.
Thank you for reading till the end.