Integrating ONDC Updated
Integrating ONDC Updated
([email protected])
Intern (Team – Web).
So once all the participants have implemented the APIs on their backends, the applications
can communicate with each other as the servers have common APIs and a common schema
for the payload.
Try it first will be a buyer side app initially. These factors are very important for a buyer side
app:
1. Marketing.
2. Acquire Customers.
3. Payments.
4. Website.
5. Customer Service.
6. Customer Refund.
Structure.
Call: search
Ack
Buyer App Acknowledgment Seller App
Recall: on_search
Ack
Acknowledgment
Gateway is required in case of search < > on_search only. Other all APIs are P2P i.e., Peer
to Peer.
/search Searching a particular product from a buyer side app through a Discover
gateway.
/select Adding a particular searched product into the cart on the buyer side Order
app.
/status To get the status of the order. (Ordered, Delivered, and Cancelled.) Fulfilment
/rating Feedback. (Customer → Buyer Side App → Seller Side App) Support
The search API uses gateway and the flow is as shown below:
/search → gateway (request to get a list of relevant suppliers) → Registry (Provides a list of
relevant suppliers) → call seller side app → /on_search.
Other all calls and recalls take place directly without any gateway.
API Schema:
Auth Header:
Creating Key Pairs → Auth Header Signing → Auth Header Verification.
Context:
Message.
Error.
Important:
BAP = Backend Application Participant.
BPP = Backend Provider Participant.
/search
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_search
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/search
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 02:53:16 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Response Time.
1893 ms
/select
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_select
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/select
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 05:14:12 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Response Time.
708 ms
/init
Initialize an order by providing billing and/or shipping details.
Buyer initializes order checkout.
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_init
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/init
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 05:21:18 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
2026 ms
/confirm
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_confirm
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/confirm
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 05:30:23 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
1316 ms
/status
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_status
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/status
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 05:37:42 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
1295 ms
/track
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/track
Response body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 05:47:27 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
975 ms
/cancle
Cancel an order.
Buyer cancels an order.
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_cancel
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/cancel
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 05:57:09 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
966 ms
/update
Update an order.
Buyer updates an order.
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_update
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/update
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 06:03:39 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
1356 ms
/rating
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_rating
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/rating
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 06:08:04 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
1031 ms
/support
Contact support.
Buyer searches for Support Contact details.
https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/ONDC%20Seller%20App/post_support
Request URL.
https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Retail/1.0.29/support
Response Body.
{
"message": {
"ack": {
"status": "ACK"
}
},
"error": {
"type": "CONTEXT-ERROR",
"code": "string",
"path": "string",
"message": "string"
}
}
Response Headers.
access-control-allow-credentials: true
access-control-allow-headers: X-Requested-With,Content-Type,Accept,Origin
access-control-allow-methods: *
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-length: 126
content-type: application/json;charset=utf-8
date: Tue,08 Aug 2023 06:13:16 GMT
etag: W/"7e-gO/DcSPnFt9bieLHNwblIinsCBE"
expires: -1
status: 200 OK
Request Duration.
1007 ms
Reference: https://app.swaggerhub.com/apis/blezDev/ondc-
protocol_api_for_retail_grocery_f_b/1.0.29#/info