The XInput Schema - CWG Working Draft #315
Replies: 8 comments 16 replies
-
|
Example: A mentor can seek additional information about a mentee before accepting the mentee's request for enrollment into the session(1-1 session as well as 1-many sessions). The provider and customer are on apps that are DSEP-enabled (Beckn protocol for education and skilling). Workflow: In this case, the on_init BPP passes the form URL to BAP, which is rendered and filled by the mentee on BAP. The BAP then sends the acknowledgment ID received after the submission of the form in the confirm API call to BPP. An example of a form can be as below:- Cc - @vijiurs @kiranharidas187 |
Beta Was this translation helpful? Give feedback.
-
|
Hi @core-wg-admin Point 1:HTML Forms may contain lot of "UI" definition schema given the "wide specification" of HTML, whereas we need a "data field schema". XForm could still be applicable, but again that is too wide specification. Can there be a simpler schema for "form fields"? Point 2:Apart from having a "URL" for fetching a form, would it be beneficial to directly provide the complete form (XForm schema) details within the on_init response body? So instead of having "url", it'll have a string/json field which will have the complete form itself. Consider a case, where BPP needs XInput for multiple "items" of the "order" object. In such case, having "URL" based forms, would require multiple network round-trips not only for "fetch" but also to "submit" the forms. And this may degrade the user experience due to the "time" delays, apart from the network/bandwidth overheads. To see the XInput requirement at item level, you can correlate it with the world of customized/personlized products (e.g. https://www.vistaprint.in/), where each product item will have some custom information added by the shopper. If we support form fields schema within the on_init response itself, then we would also need the "XInput" property for confirm request's order schema too. Please let me know, if I am understanding this XInput draft correctly or not? |
Beta Was this translation helpful? Give feedback.
-
|
@sankarshanmukhopadhyay added your inputs regarding standardizing forms by network facilitators to prevent misuse of forms. |
Beta Was this translation helpful? Give feedback.
-
|
@aks30 added your example to the draft |
Beta Was this translation helpful? Give feedback.
-
|
Example: A scholarship provider wants additional information from student while applying to scholarship In this example, we will assume ABC Limited is providing scholarship for engineering students and student is applying to this scholarship. Below is XInput object containing a link the following form: Let us assume this form is hosted at - https://api.example-bpp.com/getForm?id=t8923y4ryu328473y4 Let us assume, the DSEP BAP has already declared the intent (via search), received the catalogs (via on_search), selected a specific scholarship (via select), and has received a scholarship details (via on_select). Form identification Form Fetching from BPP Form Rendering on the BAP The BAP has to render the submit button for this form. Once this form is submitted, submission_id will be received at BAP end in response. BAP has to send this submission_id along with the confirm API call to BPP. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @core-wg-admin! What benefit does supporting the XForms standard provide given that the engineering effort required to render forms on the client app is doubled by having to support two standards? HTML is clearly the dominant standard of the world in rendering forms, whereas XForms seems to be dead by comparison. |
Beta Was this translation helpful? Give feedback.
-
|
@core-wg-admin Not sure, if this is the right concern or not but we are providing a way to show a BPPs form inside the BAPs system |
Beta Was this translation helpful? Give feedback.
-
|
I think we could merge this 2 step process to a single-step process.
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The XInput Schema
CWG Working Draft - September 06, 2022
Document Details
This version
TODO
Latest published version
TODO
Latest editor's draft
TODO
Implementation report
TODO
Editors
Ravi Prakash (Beckn Foundation)
Authors
Ravi Prakash (Beckn Foundation)
Feedback
Issues: TODO
Discussions: TODO
PRs: TODO
Errata
No Errata exists as of now
Context
Beckn protocol defines a domain-agnostic specification that can be used to represent any customer- provider transaction by implementing a standard set of APIs and schema. Creating a transaction ideally involves the customer discovering products and services offered by various providers, selecting the desired products or services, obtaining the terms of service and payment, and then finally confirming the order. But sometimes, the provider might require additional metadata in order to confirm a transaction. This requirement may be due to legal requirements imposed by the regulatory authorities, or business requirements to allow better serviceability.
For example, a logistics service provider might require additional information from the logistics customer (like a restaurant) like the dimensions of the package, category of items (food, flammable, fragile etc), approximate weight of the package, the order Number etc,
to confirm the order. All of this information needs to be transmitted to the person availing the logistics service.
Similarly, a healthcare service might want the patient to provide information like, their medical history, a description of their symptoms, details of the insurance, etc, before confirming the order.
The nature of additional information required could vary significantly across sectors. These fields could be varied and many, and adding them as protocol attributes would make the protocol bulky and cluttered.
Problem
We require an object that captures additional information (over and above what has been published in the catalog) from the customer regarding the item being ordered without extending the core transaction protocol.
Solution
It is probably not such a good idea to transmit such required data fields as first class citizens of the transaction protocol, rather transmit them in some sort of a custom form object. This form could be a simple HTML form hosted on a url endpoint or transmitted as a whole as per standard form specifications like XForms 2.0.
The proposed design of this feature is as follows.
It starts with a schema called
XInputof typeForm. The definition ofFormis also shown here among other relevant schemas.Recommendations for BPPs
The following recommendations are for BPPs who will create the form to be rendered on BAPs and receive the submissions from it.
Declaring the form
Modeling the form
scripttags along with HTML forms as it will pose a security concern for BAPsstyletags along with HTML forms as BAPs may re-render the form as per their UIbuttontags along with HTML forms as BAPs may render the CTA for form submission according to their UIHandling form requests
Handling form submissions
<form action="url" method="post">application/jsonresponseLinking form submission to existing transactions
Discarding Form Submissions
Recommendations for BAPs
The following recommendations are for BAPs who will render the form to its users and send the submissions to the BPPs.
Identifying form declarations
{Item}.xinput.form.urlendpoint from its API endpoint.Rendering the form
Submitting the form
Handling form submission responses
Post-Form Submission
After successful submission of the form, the BAP must ideally, send the submission_id received in the previous submission and send it in the corresponding item’s xinput.form.submission_id field, in the confirm API.
Recommendations for Network Facilitators
Tagslist published by networksExamples
The following examples show how XInput can be used by BPPs to collect additional information from the user before confirming the order.
Example 1 : A logistics provider wants additional information on the nature of the package just before placing the order
In this example, the Logistics BPP can create a XInput object containing a link the the following form
Let us assume this form is hosted at - https://api.example-bpp.com/getForm?id=t8923y4ryu328473y4
The BPP can choose to send this form at an Item level or at an order level. To keep things simple, let us send this form at an order level.
Let us assume, the Logistics BAP has already declared the intent (via search), received the catalogs (via on_search), selected a specific item ( via select), and has received a quote(via on_select).
Form identification
When the BAP calls init, the Logistics BPP sends the following order object
Form Fetching from BPP
When the Logistics BAP receives this object via on_init, it must pull the form data from the order.xinput.form.url field and render the form on the UI. It is recommended that the Logistics BAP keeps watching for the xinput field at the item and order level.
Form Rendering on the BAP
Once pulled the BAP can render the form as-is on its UI, but it is not recommended, as doing so would result in a sub-optimal user experience. This is how the form will look if the BAP renders the form as-is using an HTML parser.
However, the BAP application can apply any styling framework (like css) on the form and render it as per the style guide of the application.
This form must be rendered just before firing the confirm API. This is typically just before checkout, when the BAP invokes the payment flow.
The BAP must render the submit button for this form. This submit button functionality can be merged with the final checkout button or placed exclusively for this form as part of a two-step process.
For example, in the case of a two step process, the flow might look like this
Step 1:
Step 2:
In the case of a one step process, the BAP can collect all the data on a single form and then fire two consecutive API calls, one to submit the form, and the other to confirm the order.
In any case, the form submission id must be transmitted along with the confirm API call.
The BPP will receive the confirm call with the submission_id as reference. It will verify the submission against the submission_id and link that data along with the confirm API.
Now the BPP has all the information required to confirm the order. It can either go ahead with the confirmation or reject the request if applicable.
Example 2: A health & wellness service provider wants additional information about the patient's symptoms before confirming a teleconsultation appointment. The provider and customer are on apps that are DHP-enabled (beckn protocol for health and wellness).
[TODO]
Example 3: A recruitment agency wants additional information about the candidate before confirming a job application. The provider and customer are on apps that are DSEP-enabled (beckn protocol for education and skilling).
Example 4: A flight booking system wants the passenger to declare his Covid vaccination status before confirming the booking.
Example 5: A mentor can seek additional information about a mentee before accepting the mentee's request for enrollment into the session(1-1 session as well as 1-many sessions). The provider and customer are on apps that are DSEP-enabled (Beckn protocol for education and skilling).
In this case, the on_init BPP passes the form URL to BAP, which is rendered and filled by the mentee on BAP. The BAP then sends the acknowledgment ID received after the submission of the form in the confirm API call to BPP.
An example of a form can be as below:-
Acknowledgements
The authors would like to thank the following people for their support and contributions to this document.
Beta Was this translation helpful? Give feedback.
All reactions