beckn / beckn/protocol-specifications

Enabling Pagination on Protocol

Open
#329 2 comments 0 reactions 1 assignee Claimed by @ravi-prakash-v View on GitHub
C4GT Community
Dominant language
No language data
Stars
453
Forks
126
PR merge metrics
No merged PRs in 30d

Description

---

Name: Protocol Specifications
Title: "Enabling Pagination on Protocol"
Labels: C4GT Community

---

## Description

### Discussed in https://github.com/beckn/protocol-specifications/discussions/328

Originally posted by **nitinmish** November 28, 2022

BecKn works on stateless asynchronous APIs, whereby the search intent issued by a caller is responded with list of items matching the search intent and keywords. In context of ONDC, currently, a search intent is raised by a buyer platform, against a transaction ID. The Gateway assesses the search intent by domain and sub domain and broadcast the intent to relevant platforms to respond.

Intent is further responded by respective seller platforms pushing catalogs on the same transaction ID to ensure session sticky ness for the search responses. We have observed that in some cases, the number of items in a search response array is significantly large leading to processing bottlenecks. Thus, a pagination feature is needed to enable seller platforms to respond against a single search intent. Following are inherent extension of the feature:

Pagination shall ensure the API transmission stays light weight and performant.
This will also ensure the buyer Apps to manage load on their side, leading to managing user experience better
Inherently, the catalog becomes more current and optimised for application of TTLs as the new search requests will mandatorily have to go for network search
Sellers will have more flexibility to order the catalog items basis their own requirements
Responses to buyer can be more efficient.
In B2B context, same flag can be used to issue action request on BAP side to expect a final quote against a search query at a later time.
Following is a proposed flow with change in Context section of on_search payload:

## Goals

- Introduction of a new flag in context with a booloen txn_open, on same transaction ID but distinct message ID
{
"context": {
"domain": "string",
"country": "string",
"region": "string",
"action": "on_search",
"version": "string",
"bap_id": "string",
"bap_uri": "string",
"bpp_id": "string",
"bpp_uri": "string",
"transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
“txn_open”: “Y”
"timestamp": "2022-11-28T08:49:27.973Z",
"key": "string",
"ttl": "string"
}

## Expected Outcome

- Upon a search intent received by a buyer App, buyer app may keep the transaction open for a time specified in the API Specs contract. Buyer Apps can render the results on PDP as the search responses are received. Buyer App may extend the time-limit for closing the transaction if this flag is received in subsequent payload, capped at a maximum value.

---

### Project

Beckn

### Organization Name:

Beckn Open Collective

### Domain

Others

### Tech Skills Needed:

Open API 3.0
beckn protocol

### Mentor(s)

Ravi Prakash

### Complexity

Medium

### Category

Feature

### Sub Category

Research, Backend

@core-wg-admin @pramodkvarma

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.