diff --git a/plugins/implementations/plugin_impl.go b/plugins/implementations/plugin_impl.go
index 6c7aaa7..5919f53 100644
--- a/plugins/implementations/plugin_impl.go
+++ b/plugins/implementations/plugin_impl.go
@@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
+ "log"
"os"
"path/filepath"
@@ -84,10 +85,10 @@ func (v *tekuriValidator) Validate(ctx context.Context, data []byte) error {
// }
// (Approach 2)(all json files for each schema from sub directories)
-
func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plugins.Validator, error) {
vp.schemaCache = make(map[string]map[string]*jsonschema.Schema)
validatorCache := make(map[string]plugins.Validator)
+ baseCustomID := "https://core/v1.1.0/"
// Walk through the directory and compile all .json files
err := filepath.Walk(schemaDir, func(path string, info os.FileInfo, err error) error {
@@ -96,12 +97,28 @@ func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plug
}
if !info.IsDir() && filepath.Ext(info.Name()) == ".json" {
filePath := filepath.Join(schemaDir, info.Name())
- fmt.Println("printing path : ", path)
- fmt.Println("Compiling file path: ", filePath)
+ // Construct the CustomID using baseCustomID and the file name
+ customID := baseCustomID + info.Name()
compiler := jsonschema.NewCompiler()
- compiledSchema, err := compiler.Compile(path)
+ resource, err := os.Open(path)
+ if err != nil {
+ return fmt.Errorf("failed to open JSON schema file %s: %v", info.Name(), err)
+ }
+ defer func() {
+ if err := resource.Close(); err != nil {
+ log.Printf("Error closing resource: %v", err)
+ }
+ }()
+ // defer resource.Close()
+
+ if err := compiler.AddResource(customID, resource); err != nil {
+ return fmt.Errorf("failed to add resource for JSON schema file %s and custom id is %s: %v", info.Name(), customID, err)
+ }
+
+ // compiledSchema, err := compiler.Compile(path)
+ compiledSchema, err := compiler.Compile(customID)
if err != nil {
return fmt.Errorf("failed to compile JSON schema from file %s: %v", info.Name(), err)
}
@@ -109,8 +126,6 @@ func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plug
return fmt.Errorf("compiled schema is nil for file %s", info.Name())
}
- fmt.Printf("Compiled schema for file %s: %+v\n", info.Name(), compiledSchema)
-
dir := filepath.Base(filepath.Dir(filePath))
if vp.schemaCache[dir] == nil {
vp.schemaCache[dir] = make(map[string]*jsonschema.Schema)
@@ -131,6 +146,7 @@ var _ plugins.ValidatorProvider = (*tekuriValidatorProvider)(nil)
var providerInstance = &tekuriValidatorProvider{}
+// GetProvider returns the ValidatorProvider instance.
func GetProvider() plugins.ValidatorProvider {
return providerInstance
}
diff --git a/plugins/implementations/plugin_impl_test.go b/plugins/implementations/plugin_impl_test.go
index 56871e2..c967152 100644
--- a/plugins/implementations/plugin_impl_test.go
+++ b/plugins/implementations/plugin_impl_test.go
@@ -21,7 +21,7 @@ type Message struct{}
func TestInitializeValidDirectory(t *testing.T) {
provider := &tekuriValidatorProvider{}
- schemaDir := "../schema/ondc_trv10_2.0.0/"
+ schemaDir := "../schema_valid/ondc_trv10_2.0.0/"
_, err := provider.Initialize(schemaDir)
if err != nil {
t.Fatalf("expected no error, got %v", err)
@@ -30,7 +30,7 @@ func TestInitializeValidDirectory(t *testing.T) {
func TestInitializeInValidDirectory(t *testing.T) {
provider := &tekuriValidatorProvider{}
- schemaDir := "../schemas/ondc_trv10_2.0.0/"
+ schemaDir := "../schema/ondc_trv10_2.0.0/"
_, err := provider.Initialize(schemaDir)
if err != nil {
t.Fatalf("failed to read schema directory: %v", err)
@@ -68,7 +68,7 @@ func TestInvalidCompileSchema(t *testing.T) {
}
func TestValidateData(t *testing.T) {
- schemaDir := "../schema/ondc_trv10_2.0.0/"
+ schemaDir := "../schema_valid/ondc_trv10_2.0.0/"
if _, err := os.Stat(schemaDir); os.IsNotExist(err) {
t.Fatalf("Schema directory does not exist: %v", schemaDir)
}
@@ -108,7 +108,7 @@ func TestValidateData(t *testing.T) {
}
func TestInValidateData(t *testing.T) {
- schemaDir := "../schema/ondc_trv10_2.0.0/"
+ schemaDir := "../schema_valid/ondc_trv10_2.0.0/"
if _, err := os.Stat(schemaDir); os.IsNotExist(err) {
t.Fatalf("Schema directory does not exist: %v", schemaDir)
@@ -138,7 +138,7 @@ func TestInValidateData(t *testing.T) {
}
func TestInValidateUnmarshalData(t *testing.T) {
- schemaDir := "../schema/ondc_trv10_2.0.0/"
+ schemaDir := "../schema_valid/ondc_trv10_2.0.0/"
if _, err := os.Stat(schemaDir); os.IsNotExist(err) {
t.Fatalf("Schema directory does not exist: %v", schemaDir)
diff --git a/plugins/implementations/tekuriValidator.so b/plugins/implementations/tekuriValidator.so
index 166e1fa..150dc2a 100644
Binary files a/plugins/implementations/tekuriValidator.so and b/plugins/implementations/tekuriValidator.so differ
diff --git a/plugins/manager.go b/plugins/manager.go
index 14471bf..90b1242 100644
--- a/plugins/manager.go
+++ b/plugins/manager.go
@@ -12,20 +12,24 @@ import (
"gopkg.in/yaml.v2"
)
+// PluginConfig represents the configuration for plugins, including the plugins themselves.
type PluginConfig struct {
Plugins Plugins `yaml:"plugins"`
}
+// Plugins holds the various plugin types used in the configuration.
type Plugins struct {
ValidationPlugin ValidationPlugin `yaml:"validation_plugin"`
}
+// ValidationPlugin represents a plugin with an ID, configuration, and the path to the plugin.
type ValidationPlugin struct {
ID string `yaml:"id"`
Config PluginDetails `yaml:"config"`
PluginPath string `yaml:"plugin_path"`
}
+// PluginDetails contains information about the plugin schema directory.
type PluginDetails struct {
Schema string `yaml:"schema_dir"`
}
@@ -87,7 +91,7 @@ func NewValidatorProvider(pluginsConfig PluginConfig) (*PluginManager, map[strin
return &PluginManager{validatorProvider: validatorProvider}, validator, nil
}
-// loadPluginsConfig loads the plugins configuration from a YAML file.
+// LoadPluginsConfig loads the plugins configuration from a YAML file.
func LoadPluginsConfig(filePath string) (PluginConfig, error) {
// start := time.Now()
diff --git a/plugins/schemas/core/v1.1.0/Cancel.json b/plugins/schemas/core/v1.1.0/Cancel.json
index b09e97a..1f8f87d 100644
--- a/plugins/schemas/core/v1.1.0/Cancel.json
+++ b/plugins/schemas/core/v1.1.0/Cancel.json
@@ -22,8 +22,25 @@
]
}
]
+ },
+ "message": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "order_id": {
+ "$ref": "definitions.json#/$defs/Order"
+ },
+ "cancellation_reason_id": {
+ "$ref": "definitions.json#/$defs/Option"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ }
+ },
+ "required": [
+ "order_id"
+ ]
}
-
},
"required": [
"message",
diff --git a/plugins/schemas/core/v1.1.0/Confirm.json b/plugins/schemas/core/v1.1.0/Confirm.json
index 96510ba..d4b4277 100644
--- a/plugins/schemas/core/v1.1.0/Confirm.json
+++ b/plugins/schemas/core/v1.1.0/Confirm.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/confirm",
+ "$id": "confirm",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/Init.json b/plugins/schemas/core/v1.1.0/Init.json
index a13d644..fec48db 100644
--- a/plugins/schemas/core/v1.1.0/Init.json
+++ b/plugins/schemas/core/v1.1.0/Init.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/init",
+ "$id": "init",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnCancel.json b/plugins/schemas/core/v1.1.0/OnCancel.json
index 2a6c18d..4eafef2 100644
--- a/plugins/schemas/core/v1.1.0/OnCancel.json
+++ b/plugins/schemas/core/v1.1.0/OnCancel.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnCancel",
+ "$id": "OnCancel",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnConfirm.json b/plugins/schemas/core/v1.1.0/OnConfirm.json
index c0b4d8b..6043056 100644
--- a/plugins/schemas/core/v1.1.0/OnConfirm.json
+++ b/plugins/schemas/core/v1.1.0/OnConfirm.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnConfirm",
+ "$id": "OnConfirm",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnInit.json b/plugins/schemas/core/v1.1.0/OnInit.json
index 6092399..be74e86 100644
--- a/plugins/schemas/core/v1.1.0/OnInit.json
+++ b/plugins/schemas/core/v1.1.0/OnInit.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnInit",
+ "$id": "OnInit",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnRating.json b/plugins/schemas/core/v1.1.0/OnRating.json
index 83a0f22..8864f06 100644
--- a/plugins/schemas/core/v1.1.0/OnRating.json
+++ b/plugins/schemas/core/v1.1.0/OnRating.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnRating",
+ "$id": "OnRating",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnSearch.json b/plugins/schemas/core/v1.1.0/OnSearch.json
index b133a81..982b26d 100644
--- a/plugins/schemas/core/v1.1.0/OnSearch.json
+++ b/plugins/schemas/core/v1.1.0/OnSearch.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnSearch",
+ "$id": "OnSearch",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnSelect.json b/plugins/schemas/core/v1.1.0/OnSelect.json
index 1404d31..fa86378 100644
--- a/plugins/schemas/core/v1.1.0/OnSelect.json
+++ b/plugins/schemas/core/v1.1.0/OnSelect.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnSelect",
+ "$id": "OnSelect",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnStatus.json b/plugins/schemas/core/v1.1.0/OnStatus.json
index 8459e82..7453a11 100644
--- a/plugins/schemas/core/v1.1.0/OnStatus.json
+++ b/plugins/schemas/core/v1.1.0/OnStatus.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnStatus",
+ "$id": "OnStatus",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnSupport.json b/plugins/schemas/core/v1.1.0/OnSupport.json
index 226aa3b..ed91c42 100644
--- a/plugins/schemas/core/v1.1.0/OnSupport.json
+++ b/plugins/schemas/core/v1.1.0/OnSupport.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnSupport",
+ "$id": "OnSupport",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnTrack.json b/plugins/schemas/core/v1.1.0/OnTrack.json
index ab06934..7d46838 100644
--- a/plugins/schemas/core/v1.1.0/OnTrack.json
+++ b/plugins/schemas/core/v1.1.0/OnTrack.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnTrack",
+ "$id": "OnTrack",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/OnUpdate.json b/plugins/schemas/core/v1.1.0/OnUpdate.json
index 53038d1..2b2f2e8 100644
--- a/plugins/schemas/core/v1.1.0/OnUpdate.json
+++ b/plugins/schemas/core/v1.1.0/OnUpdate.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/OnUpdate",
+ "$id": "OnUpdate",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/Rating.json b/plugins/schemas/core/v1.1.0/Rating.json
index 61bd2f3..3006d12 100644
--- a/plugins/schemas/core/v1.1.0/Rating.json
+++ b/plugins/schemas/core/v1.1.0/Rating.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/rating",
+ "$id": "rating",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/Response.json b/plugins/schemas/core/v1.1.0/Response.json
index bf4540f..cbd7372 100644
--- a/plugins/schemas/core/v1.1.0/Response.json
+++ b/plugins/schemas/core/v1.1.0/Response.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/Response",
+ "$id": "Response",
"type": "object",
"properties": {},
"required": []
diff --git a/plugins/schemas/core/v1.1.0/Status.json b/plugins/schemas/core/v1.1.0/Status.json
index 4a5947a..871f693 100644
--- a/plugins/schemas/core/v1.1.0/Status.json
+++ b/plugins/schemas/core/v1.1.0/Status.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/status",
+ "$id": "status",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/Support.json b/plugins/schemas/core/v1.1.0/Support.json
index 9b39df5..729b81a 100644
--- a/plugins/schemas/core/v1.1.0/Support.json
+++ b/plugins/schemas/core/v1.1.0/Support.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/support",
+ "$id": "support",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/Track.json b/plugins/schemas/core/v1.1.0/Track.json
index 5fabb7e..ec891b1 100644
--- a/plugins/schemas/core/v1.1.0/Track.json
+++ b/plugins/schemas/core/v1.1.0/Track.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/track",
+ "$id": "track",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/Update.json b/plugins/schemas/core/v1.1.0/Update.json
index dda31f4..6a664fa 100644
--- a/plugins/schemas/core/v1.1.0/Update.json
+++ b/plugins/schemas/core/v1.1.0/Update.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/update",
+ "$id": "update",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/definitions.json b/plugins/schemas/core/v1.1.0/definitions.json
index 4c82c20..832057c 100644
--- a/plugins/schemas/core/v1.1.0/definitions.json
+++ b/plugins/schemas/core/v1.1.0/definitions.json
@@ -1,2459 +1,2459 @@
{
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "definitions.json",
- "$defs": {
- "Ack": {
- "$id": "Ack",
- "description": "Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "status": {
- "type": "string",
- "description": "The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.",
- "enum": [
- "ACK",
- "NACK"
- ]
- },
- "tags": {
- "description": "A list of tags containing any additional information sent along with the Acknowledgement.",
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "definitions.json",
+ "$defs": {
+ "Ack": {
+ "$id": "Ack",
+ "description": "Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.",
+ "enum": [
+ "ACK",
+ "NACK"
+ ]
+ },
+ "tags": {
+ "description": "A list of tags containing any additional information sent along with the Acknowledgement.",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
+ }
+ }
+ }
+ },
+ "AddOn": {
+ "$id": "AddOn",
+ "description": "Describes an additional item offered as a value-addition to a product or service. This does not exist independently in a catalog and is always associated with an item.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Provider-defined ID of the add-on",
+ "type": "string"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "price": {
+ "$ref": "definitions.json#/$defs/Price"
+ },
+ "quantity": {
+ "$ref": "definitions.json#/$defs/ItemQuantity"
+ }
+ }
+ },
+ "Address": {
+ "$id": "Address",
+ "description": "Describes a postal address.",
+ "type": "string"
+ },
+ "Agent": {
+ "$id": "Agent",
+ "description": "Describes the direct performer, driver or executor that fulfills an order. It is usually a person. But in some rare cases, it could be a non-living entity like a drone, or a bot. Some examples of agents are Doctor in the healthcare sector, a driver in the mobility sector, or a delivery person in the logistics sector. This object can be set at any stage of the order lifecycle. This can be set at the discovery stage when the BPP wants to provide details on the agent fulfilling the order, like in healthcare, where the doctor's name appears during search. This object can also used to search for a particular person that the customer wants fulfilling an order. Sometimes, this object gets instantiated after the order is confirmed, like in the case of on-demand taxis, where the driver is assigned after the user confirms the ride.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "person": {
+ "$ref": "definitions.json#/$defs/Person"
+ },
+ "contact": {
+ "$ref": "definitions.json#/$defs/Contact"
+ },
+ "organization": {
+ "$ref": "definitions.json#/$defs/Organization"
+ },
+ "rating": {
+ "$ref": "definitions.json#/$defs/Rating/properties/value"
+ }
+ }
+ },
+ "Authorization": {
+ "$id": "Authorization",
+ "description": "Describes an authorization mechanism used to start or end the fulfillment of an order. For example, in the mobility sector, the driver may require a one-time password to initiate the ride. In the healthcare sector, a patient may need to provide a password to open a video conference link during a teleconsultation.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "description": "Type of authorization mechanism used. The allowed values for this field can be published as part of the network policy.",
+ "type": "string"
+ },
+ "token": {
+ "description": "Token used for authorization. This is typically generated at the BPP. The BAP can send this value to the user via any channel that it uses to authenticate the user like SMS, Email, Push notification, or in-app rendering.",
+ "type": "string"
+ },
+ "valid_from": {
+ "description": "Timestamp in RFC3339 format from which token is valid",
+ "type": "string",
+ "format": "date-time"
+ },
+ "valid_to": {
+ "description": "Timestamp in RFC3339 format until which token is valid",
+ "type": "string",
+ "format": "date-time"
+ },
+ "status": {
+ "description": "Status of the token",
+ "type": "string"
+ }
+ }
+ },
+ "Billing": {
+ "$id": "Billing",
+ "description": "Describes the billing details of an entity.
This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "description": "Name of the billable entity",
+ "type": "string"
+ },
+ "organization": {
+ "description": "Details of the organization being billed.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Organization"
}
- }
- }
- },
- "AddOn": {
- "$id": "AddOn",
- "description": "Describes an additional item offered as a value-addition to a product or service. This does not exist independently in a catalog and is always associated with an item.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Provider-defined ID of the add-on",
- "type": "string"
- },
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "price": {
- "$ref": "#/$defs/Price"
- },
- "quantity": {
- "$ref": "#/$defs/ItemQuantity"
- }
- }
- },
- "Address": {
- "$id": "Address",
- "description": "Describes a postal address.",
- "type": "string"
- },
- "Agent": {
- "$id": "Agent",
- "description": "Describes the direct performer, driver or executor that fulfills an order. It is usually a person. But in some rare cases, it could be a non-living entity like a drone, or a bot. Some examples of agents are Doctor in the healthcare sector, a driver in the mobility sector, or a delivery person in the logistics sector. This object can be set at any stage of the order lifecycle. This can be set at the discovery stage when the BPP wants to provide details on the agent fulfilling the order, like in healthcare, where the doctor's name appears during search. This object can also used to search for a particular person that the customer wants fulfilling an order. Sometimes, this object gets instantiated after the order is confirmed, like in the case of on-demand taxis, where the driver is assigned after the user confirms the ride.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "person": {
- "$ref": "#/$defs/Person"
- },
- "contact": {
- "$ref": "#/$defs/Contact"
- },
- "organization": {
- "$ref": "#/$defs/Organization"
- },
- "rating": {
- "$ref": "#/$defs/Rating/properties/value"
- }
- }
- },
- "Authorization": {
- "$id": "Authorization",
- "description": "Describes an authorization mechanism used to start or end the fulfillment of an order. For example, in the mobility sector, the driver may require a one-time password to initiate the ride. In the healthcare sector, a patient may need to provide a password to open a video conference link during a teleconsultation.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "type": {
- "description": "Type of authorization mechanism used. The allowed values for this field can be published as part of the network policy.",
- "type": "string"
- },
- "token": {
- "description": "Token used for authorization. This is typically generated at the BPP. The BAP can send this value to the user via any channel that it uses to authenticate the user like SMS, Email, Push notification, or in-app rendering.",
- "type": "string"
- },
- "valid_from": {
- "description": "Timestamp in RFC3339 format from which token is valid",
- "type": "string",
- "format": "date-time"
- },
- "valid_to": {
- "description": "Timestamp in RFC3339 format until which token is valid",
- "type": "string",
- "format": "date-time"
- },
- "status": {
- "description": "Status of the token",
- "type": "string"
- }
- }
- },
- "Billing": {
- "$id": "Billing",
- "description": "Describes the billing details of an entity.
This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "description": "Name of the billable entity",
- "type": "string"
- },
- "organization": {
- "description": "Details of the organization being billed.",
- "allOf": [
- {
- "$ref": "#/$defs/Organization"
- }
- ]
- },
- "address": {
- "description": "The address of the billable entity",
- "allOf": [
- {
- "$ref": "#/$defs/Address"
- }
- ]
- },
- "state": {
- "description": "The state where the billable entity resides. This is important for state-level tax calculation",
- "allOf": [
- {
- "$ref": "#/$defs/State"
- }
- ]
- },
- "city": {
- "description": "The city where the billable entity resides.",
- "allOf": [
- {
- "$ref": "#/$defs/City"
- }
- ]
- },
- "email": {
- "description": "Email address where the bill is sent to",
- "type": "string",
- "format": "email"
- },
- "phone": {
- "description": "Phone number of the billable entity",
- "type": "string"
- },
- "time": {
- "description": "Details regarding the billing period",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "tax_id": {
- "description": "ID of the billable entity as recognized by the taxation authority",
- "type": "string"
- }
- }
- },
- "Cancellation": {
- "$id": "Cancellation",
- "description": "Describes a cancellation event",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "time": {
- "description": "Date-time when the order was cancelled by the buyer",
- "type": "string",
- "format": "date-time"
- },
- "cancelled_by": {
- "type": "string",
- "enum": [
- "CONSUMER",
- "PROVIDER"
- ]
- },
- "reason": {
- "description": "The reason for cancellation",
- "allOf": [
- {
- "$ref": "#/$defs/Option"
- }
- ]
- },
- "additional_description": {
- "description": "Any additional information regarding the nature of cancellation",
- "allOf": [
- {
- "$ref": "#/$defs/Descriptor"
- }
- ]
- }
- }
- },
- "CancellationTerm": {
- "$id": "CancellationTerm",
- "description": "Describes the cancellation terms of an item or an order. This can be referenced at an item or order level. Item-level cancellation terms can override the terms at the order level.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "fulfillment_state": {
- "description": "The state of fulfillment during which this term is applicable.",
- "allOf": [
- {
- "$ref": "#/$defs/FulfillmentState"
- }
- ]
- },
- "reason_required": {
- "description": "Indicates whether a reason is required to cancel the order",
- "type": "boolean"
- },
- "cancel_by": {
- "description": "Information related to the time of cancellation.",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "cancellation_fee": {
- "$ref": "#/$defs/Fee"
- },
- "xinput": {
- "$ref": "#/$defs/XInput"
- },
- "external_ref": {
- "$ref": "#/$defs/MediaFile"
- }
- }
- },
- "Catalog": {
- "$id": "Catalog",
- "description": "Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.
This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp
This is used in the following situations.
- This is typically used in the discovery stage when the BPP sends the details of the products and services it offers as response to a search intent from the BAP.
",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "fulfillments": {
- "description": "Fulfillment modes offered at the BPP level. This is used when a BPP itself offers fulfillments on behalf of the providers it has onboarded.",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Fulfillment"
+ ]
+ },
+ "address": {
+ "description": "The address of the billable entity",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Address"
}
- },
- "payments": {
- "description": "Payment terms offered by the BPP for all transactions. This can be overriden at the provider level.",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Payment"
+ ]
+ },
+ "state": {
+ "description": "The state where the billable entity resides. This is important for state-level tax calculation",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/State"
}
- },
- "offers": {
- "description": "Offers at the BPP-level. This is common across all providers onboarded by the BPP.",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Offer"
+ ]
+ },
+ "city": {
+ "description": "The city where the billable entity resides.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/City"
}
- },
- "providers": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Provider"
+ ]
+ },
+ "email": {
+ "description": "Email address where the bill is sent to",
+ "type": "string",
+ "format": "email"
+ },
+ "phone": {
+ "description": "Phone number of the billable entity",
+ "type": "string"
+ },
+ "time": {
+ "description": "Details regarding the billing period",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
}
- },
- "exp": {
- "description": "Timestamp after which catalog will expire",
- "type": "string",
- "format": "date-time"
- },
- "ttl": {
- "description": "Duration in seconds after which this catalog will expire",
- "type": "string"
- }
+ ]
+ },
+ "tax_id": {
+ "description": "ID of the billable entity as recognized by the taxation authority",
+ "type": "string"
}
- },
- "Category": {
- "$id": "Category",
- "description": "A label under which a collection of items can be grouped.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "ID of the category",
- "type": "string"
- },
- "parent_category_id": {
- "$ref": "#/$defs/Category/properties/id"
- },
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "time": {
- "$ref": "#/$defs/Time"
- },
- "ttl": {
- "description": "Time to live for an instance of this schema"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
+ }
+ },
+ "Cancellation": {
+ "$id": "Cancellation",
+ "description": "Describes a cancellation event",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "time": {
+ "description": "Date-time when the order was cancelled by the buyer",
+ "type": "string",
+ "format": "date-time"
+ },
+ "cancelled_by": {
+ "type": "string",
+ "enum": [
+ "CONSUMER",
+ "PROVIDER"
+ ]
+ },
+ "reason": {
+ "description": "The reason for cancellation",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Option"
}
- }
- }
- },
- "Circle": {
- "$id": "Circle",
- "description": "Describes a circular region of a specified radius centered at a specified GPS coordinate.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "gps": {
- "$ref": "#/$defs/Gps"
- },
- "radius": {
- "$ref": "#/$defs/Scalar"
- }
- }
- },
- "City": {
- "$id": "City",
- "description": "Describes a city",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "description": "Name of the city",
- "type": "string"
- },
- "code": {
- "description": "City code",
- "type": "string"
- }
- }
- },
- "Contact": {
- "$id": "Contact",
- "description": "Describes the contact information of an entity",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "phone": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "jcard": {
- "type": "object",
- "additionalProperties": false,
- "description": "A Jcard object as per draft-ietf-jcardcal-jcard-03 specification"
- }
- }
- },
- "Context": {
- "$id": "Context",
- "description": "Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer's location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields. - Demographic information about the transaction using fields like `domain`, `country`, and `region`.
- Addressing details like the sending and receiving platform's ID and API URL.
- Interoperability information like the protocol version that implemented by the sender and,
- Transaction details like the method being called at the receiver's endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.
This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions,",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "domain": {
- "description": "Domain code that is relevant to this transaction context",
- "allOf": [
- {
- "$ref": "#/$defs/Domain/properties/code",
- "type": "string"
- }
- ]
- },
- "location": {
- "description": "The location where the transaction is intended to be fulfilled.",
- "allOf": [
- {
- "$ref": "#/$defs/Location"
- }
- ]
- },
- "action": {
- "description": "The Beckn protocol method being called by the sender and executed at the receiver.",
- "type": "string"
- },
- "version": {
- "type": "string",
- "description": "Version of transaction protocol being used by the sender."
- },
- "bap_id": {
- "description": "Subscriber ID of the BAP",
- "allOf": [
- {
- "description": "A globally unique identifier of the platform, Typically it is the fully qualified domain name (FQDN) of the platform.",
- "type": "string"
- }
- ]
- },
- "bap_uri": {
- "description": "Subscriber URL of the BAP for accepting callbacks from BPPs.",
- "allOf": [
- {
- "description": "The callback URL of the Subscriber. This should necessarily contain the same domain name as set in `subscriber_id``.",
- "type": "string",
- "format": "uri"
- }
- ]
- },
- "bpp_id": {
- "description": "Subscriber ID of the BPP",
- "allOf": [
- {
- "$ref": "#/$defs/Context/properties/bap_id/allOf/0"
- }
- ]
- },
- "bpp_uri": {
- "description": "Subscriber URL of the BPP for accepting calls from BAPs.",
- "allOf": [
- {
- "$ref": "#/$defs/Context/properties/bap_uri/allOf/0"
- }
- ]
- },
- "transaction_id": {
- "description": "This is a unique value which persists across all API calls from `search` through `confirm`. This is done to indicate an active user session across multiple requests. The BPPs can use this value to push personalized recommendations, and dynamic offerings related to an ongoing transaction despite being unaware of the user active on the BAP.",
- "type": "string",
- "format": "uuid"
- },
- "message_id": {
- "description": "This is a unique value which persists during a request / callback cycle. Since beckn protocol APIs are asynchronous, BAPs need a common value to match an incoming callback from a BPP to an earlier call. This value can also be used to ignore duplicate messages coming from the BPP. It is recommended to generate a fresh message_id for every new interaction. When sending unsolicited callbacks, BPPs must generate a new message_id.",
- "type": "string",
- "format": "uuid"
- },
- "timestamp": {
- "description": "Time of request generation in RFC3339 format",
- "type": "string",
- "format": "date-time"
- },
- "key": {
- "description": "The encryption public key of the sender",
- "type": "string"
- },
- "ttl": {
- "description": "The duration in ISO8601 format after timestamp for which this message holds valid",
- "type": "string"
- }
- }
- },
- "Country": {
- "$id": "Country",
- "description": "Describes a country",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of the country"
- },
- "code": {
- "type": "string",
- "description": "Country code as per ISO 3166-1 and ISO 3166-2 format"
- }
- }
- },
- "Credential": {
- "$id": "Credential",
- "description": "Describes a credential of an entity - Person or Organization",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "default": "VerifiableCredential"
- },
- "url": {
- "description": "URL of the credential",
- "type": "string",
- "format": "uri"
- }
- }
- },
- "Customer": {
- "$id": "Customer",
- "description": "Describes a customer buying/availing a product or a service",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "person": {
- "$ref": "#/$defs/Person"
- },
- "contact": {
- "$ref": "#/$defs/Contact"
- }
- }
- },
- "DecimalValue": {
- "$id": "DecimalValue",
- "description": "Describes a numerical value in decimal form",
- "type": "string",
- "pattern": "[+-]?([0-9]*[.])?[0-9]+"
- },
- "Descriptor": {
- "$id": "Descriptor",
- "description": "Physical description of something.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string"
- },
- "code": {
- "type": "string"
- },
- "short_desc": {
- "type": "string"
- },
- "long_desc": {
- "type": "string"
- },
- "additional_desc": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "url": {
- "type": "string"
- },
- "content_type": {
- "type": "string",
- "enum": [
- "text/plain",
- "text/html",
- "application/json"
- ]
- }
+ ]
+ },
+ "additional_description": {
+ "description": "Any additional information regarding the nature of cancellation",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Descriptor"
}
- },
- "media": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/MediaFile"
+ ]
+ }
+ }
+ },
+ "CancellationTerm": {
+ "$id": "CancellationTerm",
+ "description": "Describes the cancellation terms of an item or an order. This can be referenced at an item or order level. Item-level cancellation terms can override the terms at the order level.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "fulfillment_state": {
+ "description": "The state of fulfillment during which this term is applicable.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/FulfillmentState"
}
- },
- "images": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Image"
+ ]
+ },
+ "reason_required": {
+ "description": "Indicates whether a reason is required to cancel the order",
+ "type": "boolean"
+ },
+ "cancel_by": {
+ "description": "Information related to the time of cancellation.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
}
+ ]
+ },
+ "cancellation_fee": {
+ "$ref": "definitions.json#/$defs/Fee"
+ },
+ "xinput": {
+ "$ref": "definitions.json#/$defs/XInput"
+ },
+ "external_ref": {
+ "$ref": "definitions.json#/$defs/MediaFile"
+ }
+ }
+ },
+ "Catalog": {
+ "$id": "Catalog",
+ "description": "Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.
This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp
This is used in the following situations.
- This is typically used in the discovery stage when the BPP sends the details of the products and services it offers as response to a search intent from the BAP.
",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "fulfillments": {
+ "description": "Fulfillment modes offered at the BPP level. This is used when a BPP itself offers fulfillments on behalf of the providers it has onboarded.",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Fulfillment"
+ }
+ },
+ "payments": {
+ "description": "Payment terms offered by the BPP for all transactions. This can be overriden at the provider level.",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Payment"
+ }
+ },
+ "offers": {
+ "description": "Offers at the BPP-level. This is common across all providers onboarded by the BPP.",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Offer"
+ }
+ },
+ "providers": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Provider"
+ }
+ },
+ "exp": {
+ "description": "Timestamp after which catalog will expire",
+ "type": "string",
+ "format": "date-time"
+ },
+ "ttl": {
+ "description": "Duration in seconds after which this catalog will expire",
+ "type": "string"
+ }
+ }
+ },
+ "Category": {
+ "$id": "Category",
+ "description": "A label under which a collection of items can be grouped.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "ID of the category",
+ "type": "string"
+ },
+ "parent_category_id": {
+ "$ref": "definitions.json#/$defs/Category/properties/id"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "time": {
+ "$ref": "definitions.json#/$defs/Time"
+ },
+ "ttl": {
+ "description": "Time to live for an instance of this schema"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
}
}
- },
- "Domain": {
- "$id": "Domain",
- "description": "Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don't have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "description": "Name of the domain",
- "type": "string"
- },
- "code": {
- "description": "Standard code representing the domain. The standard is usually published as part of the network policy. Furthermore, the network facilitator should also provide a mechanism to provide the supported domains of a network."
- },
- "additional_info": {
- "description": "A url that contains addtional information about that domain.",
- "allOf": [
- {
- "$ref": "#/$defs/MediaFile"
- }
- ]
- }
+ }
+ },
+ "Circle": {
+ "$id": "Circle",
+ "description": "Describes a circular region of a specified radius centered at a specified GPS coordinate.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "gps": {
+ "$ref": "definitions.json#/$defs/Gps"
+ },
+ "radius": {
+ "$ref": "definitions.json#/$defs/Scalar"
}
- },
- "Duration": {
- "$id": "Duration",
- "description": "Describes duration as per ISO8601 format",
- "type": "string"
- },
- "Error": {
- "$id": "Error",
- "description": "Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "code": {
- "type": "string",
- "description": "Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo\""
- },
- "paths": {
- "type": "string",
- "description": "Path to json schema generating the error. Used only during json schema validation errors"
- },
- "message": {
- "type": "string",
- "description": "Human readable message describing the error. Used mainly for logging. Not recommended to be shown to the user."
- }
+ }
+ },
+ "City": {
+ "$id": "City",
+ "description": "Describes a city",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "description": "Name of the city",
+ "type": "string"
+ },
+ "code": {
+ "description": "City code",
+ "type": "string"
}
- },
- "Fee": {
- "$id": "Fee",
- "description": "A fee applied on a particular entity",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "percentage": {
- "description": "Percentage of a value",
- "allOf": [
- {
- "$ref": "#/$defs/DecimalValue"
- }
- ]
- },
- "amount": {
- "description": "A fixed value",
- "allOf": [
- {
- "$ref": "#/$defs/Price"
- }
- ]
- }
+ }
+ },
+ "Contact": {
+ "$id": "Contact",
+ "description": "Describes the contact information of an entity",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "phone": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "jcard": {
+ "type": "object",
+ "additionalProperties": false,
+ "description": "A Jcard object as per draft-ietf-jcardcal-jcard-03 specification"
}
- },
- "Form": {
- "$id": "Form",
- "description": "Describes a form",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "The form identifier.",
- "type": "string"
- },
- "url": {
- "description": "The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object. Once fetched, the rendering platform can choosed to render the form as-is as an embeddable element; or process it further to blend with the theme of the application. In case the interface is non-visual, the the render can process the form data and reproduce it as per the standard specified in the form.",
- "type": "string",
- "format": "uri"
- },
- "data": {
- "description": "The form submission data",
- "type": "object",
- "additionalProperties": {
+ }
+ },
+ "Context": {
+ "$id": "Context",
+ "description": "Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer's location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields. - Demographic information about the transaction using fields like `domain`, `country`, and `region`.
- Addressing details like the sending and receiving platform's ID and API URL.
- Interoperability information like the protocol version that implemented by the sender and,
- Transaction details like the method being called at the receiver's endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.
This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions,",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "domain": {
+ "description": "Domain code that is relevant to this transaction context",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Domain/properties/code",
"type": "string"
}
- },
- "mime_type": {
- "description": "This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838.",
- "type": "string",
- "enum": [
- "text/html",
- "application/html",
- "application/xml"
- ]
- },
- "resubmit": {
- "type": "boolean"
- },
- "multiple_sumbissions": {
- "type": "boolean"
- }
- }
- },
- "Fulfillment": {
- "$id": "Fulfillment",
- "description": "Describes how a an order will be rendered/fulfilled to the end-customer",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "Unique reference ID to the fulfillment of an order",
- "type": "string"
- },
- "type": {
- "description": "A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled. For example, a retail order can be fulfilled either via store pickup or a home delivery. Similarly, a medical consultation can be provided either in-person or via tele-consultation. The network policy must publish standard fulfillment type codes for the different modes of fulfillment.",
- "type": "string"
- },
- "rateable": {
- "description": "Whether the fulfillment can be rated or not",
- "type": "boolean"
- },
- "rating": {
- "description": "The rating value of the fulfullment service.",
- "allOf": [
- {
- "$ref": "#/$defs/Rating/properties/value"
- }
- ]
- },
- "state": {
- "description": "The current state of fulfillment. The BPP must set this value whenever the state of the order fulfillment changes and fire an unsolicited `on_status` call.",
- "allOf": [
- {
- "$ref": "#/$defs/FulfillmentState"
- }
- ]
- },
- "tracking": {
- "type": "boolean",
- "description": "Indicates whether the fulfillment allows tracking",
- "default": false
- },
- "customer": {
- "description": "The person that will ultimately receive the order",
- "allOf": [
- {
- "$ref": "#/$defs/Customer"
- }
- ]
- },
- "agent": {
- "description": "The agent that is currently handling the fulfillment of the order",
- "allOf": [
- {
- "$ref": "#/$defs/Agent"
- }
- ]
- },
- "contact": {
- "$ref": "#/$defs/Contact"
- },
- "vehicle": {
- "$ref": "#/$defs/Vehicle"
- },
- "stops": {
- "description": "The list of logical stops encountered during the fulfillment of an order.",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Stop"
+ ]
+ },
+ "location": {
+ "description": "The location where the transaction is intended to be fulfilled.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Location"
}
- },
- "path": {
- "description": "The physical path taken by the agent that can be rendered on a map. The allowed format of this property can be set by the network.",
- "type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
+ ]
+ },
+ "action": {
+ "description": "The Beckn protocol method being called by the sender and executed at the receiver.",
+ "type": "string"
+ },
+ "version": {
+ "type": "string",
+ "description": "Version of transaction protocol being used by the sender."
+ },
+ "bap_id": {
+ "description": "Subscriber ID of the BAP",
+ "allOf": [
+ {
+ "description": "A globally unique identifier of the platform, Typically it is the fully qualified domain name (FQDN) of the platform.",
+ "type": "string"
}
- }
- }
- },
- "FulfillmentState": {
- "$id": "FulfillmentState",
- "description": "Describes the state of fulfillment",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "updated_at": {
- "type": "string",
- "format": "date-time"
- },
- "updated_by": {
- "type": "string",
- "description": "ID of entity which changed the state"
- }
- }
- },
- "Gps": {
- "$id": "Gps",
- "description": "Describes a GPS coordinate",
- "type": "string",
- "pattern": "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?),\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$"
- },
- "Image": {
- "$id": "Image",
- "description": "Describes an image",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "url": {
- "description": "URL to the image. This can be a data url or an remote url",
- "type": "string",
- "format": "uri"
- },
- "size_type": {
- "description": "The size of the image. The network policy can define the default dimensions of each type",
- "type": "string",
- "enum": [
- "xs",
- "sm",
- "md",
- "lg",
- "xl",
- "custom"
- ]
- },
- "width": {
- "description": "Width of the image in pixels",
- "type": "string"
- },
- "height": {
- "description": "Height of the image in pixels",
- "type": "string"
- }
- }
- },
- "Intent": {
- "$id": "Intent",
- "description": "The intent to buy or avail a product or a service. The BAP can declare the intent of the consumer containing - What they want (A product, service, offer)
- Who they want (A seller, service provider, agent etc)
- Where they want it and where they want it from
- When they want it (start and end time of fulfillment
- How they want to pay for it
This has properties like descriptor,provider,fulfillment,payment,category,offer,item,tags
This is typically used by the BAP to send the purpose of the user's search to the BPP. This will be used by the BPP to find products or services it offers that may match the user's intent.
For example, in Mobility, the mobility consumer declares a mobility intent. In this case, the mobility consumer declares information that describes various aspects of their journey like,- Where would they like to begin their journey (intent.fulfillment.start.location)
- Where would they like to end their journey (intent.fulfillment.end.location)
- When would they like to begin their journey (intent.fulfillment.start.time)
- When would they like to end their journey (intent.fulfillment.end.time)
- Who is the transport service provider they would like to avail services from (intent.provider)
- Who is traveling (This is not recommended in public networks) (intent.fulfillment.customer)
- What kind of fare product would they like to purchase (intent.item)
- What add-on services would they like to avail
- What offers would they like to apply on their booking (intent.offer)
- What category of services would they like to avail (intent.category)
- What additional luggage are they carrying
- How would they like to pay for their journey (intent.payment)
For example, in health domain, a consumer declares the intent for a lab booking the describes various aspects of their booking like,- Where would they like to get their scan/test done (intent.fulfillment.start.location)
- When would they like to get their scan/test done (intent.fulfillment.start.time)
- When would they like to get the results of their test/scan (intent.fulfillment.end.time)
- Who is the service provider they would like to avail services from (intent.provider)
- Who is getting the test/scan (intent.fulfillment.customer)
- What kind of test/scan would they like to purchase (intent.item)
- What category of services would they like to avail (intent.category)
- How would they like to pay for their journey (intent.payment)
",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "descriptor": {
- "description": "A raw description of the search intent. Free text search strings, raw audio, etc can be sent in this object.",
- "allOf": [
- {
- "$ref": "#/$defs/Descriptor"
- }
- ]
- },
- "provider": {
- "description": "The provider from which the customer wants to place to the order from",
- "allOf": [
- {
- "$ref": "#/$defs/Provider"
- }
- ]
- },
- "fulfillment": {
- "description": "Details on how the customer wants their order fulfilled",
- "allOf": [
- {
- "$ref": "#/$defs/Fulfillment"
- }
- ]
- },
- "payment": {
- "description": "Details on how the customer wants to pay for the order",
- "allOf": [
- {
- "$ref": "#/$defs/Payment"
- }
- ]
- },
- "category": {
- "description": "Details on the item category",
- "allOf": [
- {
- "$ref": "#/$defs/Category"
- }
- ]
- },
- "offer": {
- "description": "details on the offer the customer wants to avail",
- "allOf": [
- {
- "$ref": "#/$defs/Offer"
- }
- ]
- },
- "item": {
- "description": "Details of the item that the consumer wants to order",
- "allOf": [
- {
- "$ref": "#/$defs/Item"
- }
- ]
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
- }
- }
- }
- },
- "ItemQuantity": {
- "$id": "ItemQuantity",
- "description": "Describes the count or amount of an item",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "allocated": {
- "description": "This represents the exact quantity allocated for purchase of the item.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "count": {
- "type": "integer",
- "minimum": 0
- },
- "measure": {
- "$ref": "#/$defs/Scalar"
- }
- }
- },
- "available": {
- "description": "This represents the exact quantity available for purchase of the item. The buyer can only purchase multiples of this",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "count": {
- "type": "integer",
- "minimum": 0
- },
- "measure": {
- "$ref": "#/$defs/Scalar"
- }
- }
- },
- "maximum": {
- "description": "This represents the maximum quantity allowed for purchase of the item",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "count": {
- "type": "integer",
- "minimum": 1
- },
- "measure": {
- "$ref": "#/$defs/Scalar"
- }
- }
- },
- "minimum": {
- "description": "This represents the minimum quantity allowed for purchase of the item",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "count": {
- "type": "integer",
- "minimum": 0
- },
- "measure": {
- "$ref": "#/$defs/Scalar"
- }
- }
- },
- "selected": {
- "description": "This represents the quantity selected for purchase of the item",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "count": {
- "type": "integer",
- "minimum": 0
- },
- "measure": {
- "$ref": "#/$defs/Scalar"
- }
- }
- },
- "unitized": {
- "description": "This represents the quantity available in a single unit of the item",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "count": {
- "type": "integer",
- "minimum": 1,
- "maximum": 1
- },
- "measure": {
- "$ref": "#/$defs/Scalar"
- }
- }
- }
- }
- },
- "Item": {
- "$id": "Item",
- "description": "Describes a product or a service offered to the end consumer by the provider. In the mobility sector, it can represent a fare product like one way journey. In the logistics sector, it can represent the delivery service offering. In the retail domain it can represent a product like a grocery item.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "ID of the item.",
- "type": "string"
- },
- "parent_item_id": {
- "description": "ID of the item, this item is a variant of",
- "allOf": [
- {
- "$ref": "#/$defs/Item/properties/id"
- }
- ]
- },
- "parent_item_quantity": {
- "description": "The number of units of the parent item this item is a multiple of",
- "allOf": [
- {
- "$ref": "#/$defs/ItemQuantity"
- }
- ]
- },
- "descriptor": {
- "description": "Physical description of the item",
- "allOf": [
- {
- "$ref": "#/$defs/Descriptor"
- }
- ]
- },
- "creator": {
- "description": "The creator of this item",
- "allOf": [
- {
- "$ref": "#/$defs/Organization"
- }
- ]
- },
- "price": {
- "description": "The price of this item, if it has intrinsic value",
- "allOf": [
- {
- "$ref": "#/$defs/Price"
- }
- ]
- },
- "quantity": {
- "description": "The selling quantity of the item",
- "allOf": [
- {
- "$ref": "#/$defs/ItemQuantity"
- }
- ]
- },
- "category_ids": {
- "description": "Categories this item can be listed under",
- "type": "array",
- "items": {
- "allOf": [
- {
- "$ref": "#/$defs/Category/properties/id"
- }
- ]
- }
- },
- "fulfillment_ids": {
- "description": "Modes through which this item can be fulfilled",
- "type": "array",
- "items": {
- "allOf": [
- {
- "$ref": "#/$defs/Fulfillment/properties/id"
- }
- ]
- }
- },
- "location_ids": {
- "description": "Provider Locations this item is available in",
- "type": "array",
- "items": {
- "allOf": [
- {
- "$ref": "#/$defs/Location/properties/id"
- }
- ]
- }
- },
- "payment_ids": {
- "description": "Payment modalities through which this item can be ordered",
- "type": "array",
- "items": {
- "allOf": [
- {
- "$ref": "#/$defs/Payment/properties/id"
- }
- ]
- }
- },
- "add_ons": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/AddOn"
- }
- },
- "cancellation_terms": {
- "description": "Cancellation terms of this item",
- "type": "array",
- "items": {
- "$ref": "#/$defs/CancellationTerm"
- }
- },
- "refund_terms": {
- "description": "Refund terms of this item",
- "type": "array",
- "items": {
- "description": "Refund term of an item or an order",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "fulfillment_state": {
- "description": "The state of fulfillment during which this term is applicable.",
- "allOf": [
- {
- "$ref": "#/$defs/State"
- }
- ]
- },
- "refund_eligible": {
- "description": "Indicates if cancellation will result in a refund",
- "type": "boolean"
- },
- "refund_within": {
- "description": "Time within which refund will be processed after successful cancellation.",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "refund_amount": {
- "$ref": "#/$defs/Price"
- }
- }
- }
- },
- "replacement_terms": {
- "description": "Terms that are applicable be met when this item is replaced",
- "type": "array",
- "items": {
- "$ref": "#/$defs/ReplacementTerm"
- }
- },
- "return_terms": {
- "description": "Terms that are applicable when this item is returned",
- "type": "array",
- "items": {
- "$ref": "#/$defs/ReturnTerm"
- }
- },
- "xinput": {
- "description": "Additional input required from the customer to purchase / avail this item",
- "allOf": [
- {
- "$ref": "#/$defs/XInput"
- }
- ]
- },
- "time": {
- "description": "Temporal attributes of this item. This property is used when the item exists on the catalog only for a limited period of time.",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "rateable": {
- "description": "Whether this item can be rated",
- "type": "boolean"
- },
- "rating": {
- "description": "The rating of the item",
- "allOf": [
- {
- "$ref": "#/$defs/Rating/properties/value"
- }
- ]
- },
- "matched": {
- "description": "Whether this item is an exact match of the request",
- "type": "boolean"
- },
- "related": {
- "description": "Whether this item is a related item to the exactly matched item",
- "type": "boolean"
- },
- "recommended": {
- "description": "Whether this item is a recommended item to a response",
- "type": "boolean"
- },
- "ttl": {
- "description": "Time to live in seconds for an instance of this schema",
- "type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
- }
- }
- }
- },
- "Location": {
- "$id": "Location",
- "description": "The physical location of something",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string"
- },
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "map_url": {
- "description": "The url to the map of the location. This can be a globally recognized map url or the one specified by the network policy.",
- "type": "string",
- "format": "uri"
- },
- "gps": {
- "description": "The GPS co-ordinates of this location.",
- "allOf": [
- {
- "$ref": "#/$defs/Gps"
- }
- ]
- },
- "updated_at": {
- "type": "string",
- "format": "date-time"
- },
- "address": {
- "description": "The address of this location.",
- "allOf": [
- {
- "$ref": "#/$defs/Address"
- }
- ]
- },
- "city": {
- "description": "The city this location is, or is located within",
- "allOf": [
- {
- "$ref": "#/$defs/City"
- }
- ]
- },
- "district": {
- "description": "The state this location is, or is located within",
- "type": "string"
- },
- "state": {
- "description": "The state this location is, or is located within",
- "allOf": [
- {
- "$ref": "#/$defs/State"
- }
- ]
- },
- "country": {
- "description": "The country this location is, or is located within",
- "allOf": [
- {
- "$ref": "#/$defs/Country"
- }
- ]
- },
- "area_code": {
- "type": "string"
- },
- "circle": {
- "$ref": "#/$defs/Circle"
- },
- "polygon": {
- "description": "The boundary polygon of this location",
- "type": "string"
- },
- "3dspace": {
- "description": "The three dimensional region describing this location",
- "type": "string"
- },
- "rating": {
- "description": "The rating of this location",
- "allOf": [
- {
- "$ref": "#/$defs/Rating/properties/value"
- }
- ]
- }
- }
- },
- "MediaFile": {
- "$id": "MediaFile",
- "description": "This object contains a url to a media file.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "mimetype": {
- "description": "indicates the nature and format of the document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838",
- "type": "string"
- },
- "url": {
- "description": "The URL of the file",
- "type": "string",
- "format": "uri"
- },
- "signature": {
- "description": "The digital signature of the file signed by the sender",
- "type": "string"
- },
- "dsa": {
- "description": "The signing algorithm used by the sender",
- "type": "string"
- }
- }
- },
- "Offer": {
- "$id": "Offer",
- "description": "An offer associated with a catalog. This is typically used to promote a particular product and enable more purchases.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string"
- },
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "location_ids": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Location/properties/id"
- }
- },
- "category_ids": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Category/properties/id"
- }
- },
- "item_ids": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Item/properties/id"
- }
- },
- "time": {
- "$ref": "#/$defs/Time"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
- }
- }
- }
- },
- "Option": {
- "$id": "Option",
- "description": "Describes a selectable option",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string"
- },
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- }
- }
- },
- "Order": {
- "$id": "Order",
- "description": "Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string",
- "description": "Human-readable ID of the order. This is generated at the BPP layer. The BPP can either generate order id within its system or forward the order ID created at the provider level."
- },
- "ref_order_ids": {
- "description": "A list of order IDs to link this order to previous orders.",
- "type": "array",
- "items": {
+ ]
+ },
+ "bap_uri": {
+ "description": "Subscriber URL of the BAP for accepting callbacks from BPPs.",
+ "allOf": [
+ {
+ "description": "The callback URL of the Subscriber. This should necessarily contain the same domain name as set in `subscriber_id``.",
"type": "string",
- "description": "ID of a previous order"
+ "format": "uri"
}
- },
- "status": {
- "description": "Status of the order. Allowed values can be defined by the network policy",
- "type": "string",
- "enum": [
- "ACTIVE",
- "COMPLETE",
- "CANCELLED",
- "COMPLETED",
- "SOFT_CANCEL"
- ]
- },
- "type": {
- "description": "This is used to indicate the type of order being created to BPPs. Sometimes orders can be linked to previous orders, like a replacement order in a retail domain. A follow-up consultation in healthcare domain. A single order part of a subscription order. The list of order types can be standardized at the network level.",
- "type": "string",
- "default": "DEFAULT",
- "enum": [
- "DRAFT",
- "DEFAULT"
- ]
- },
- "provider": {
- "description": "Details of the provider whose catalog items have been selected.",
- "allOf": [
- {
- "$ref": "#/$defs/Provider"
- }
- ]
- },
+ ]
+ },
+ "bpp_id": {
+ "description": "Subscriber ID of the BPP",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Context/properties/bap_id/allOf/0"
+ }
+ ]
+ },
+ "bpp_uri": {
+ "description": "Subscriber URL of the BPP for accepting calls from BAPs.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Context/properties/bap_uri/allOf/0"
+ }
+ ]
+ },
+ "transaction_id": {
+ "description": "This is a unique value which persists across all API calls from `search` through `confirm`. This is done to indicate an active user session across multiple requests. The BPPs can use this value to push personalized recommendations, and dynamic offerings related to an ongoing transaction despite being unaware of the user active on the BAP.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "message_id": {
+ "description": "This is a unique value which persists during a request / callback cycle. Since beckn protocol APIs are asynchronous, BAPs need a common value to match an incoming callback from a BPP to an earlier call. This value can also be used to ignore duplicate messages coming from the BPP. It is recommended to generate a fresh message_id for every new interaction. When sending unsolicited callbacks, BPPs must generate a new message_id.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "timestamp": {
+ "description": "Time of request generation in RFC3339 format",
+ "type": "string",
+ "format": "date-time"
+ },
+ "key": {
+ "description": "The encryption public key of the sender",
+ "type": "string"
+ },
+ "ttl": {
+ "description": "The duration in ISO8601 format after timestamp for which this message holds valid",
+ "type": "string"
+ }
+ }
+ },
+ "Country": {
+ "$id": "Country",
+ "description": "Describes a country",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the country"
+ },
+ "code": {
+ "type": "string",
+ "description": "Country code as per ISO 3166-1 and ISO 3166-2 format"
+ }
+ }
+ },
+ "Credential": {
+ "$id": "Credential",
+ "description": "Describes a credential of an entity - Person or Organization",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "default": "VerifiableCredential"
+ },
+ "url": {
+ "description": "URL of the credential",
+ "type": "string",
+ "format": "uri"
+ }
+ }
+ },
+ "Customer": {
+ "$id": "Customer",
+ "description": "Describes a customer buying/availing a product or a service",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "person": {
+ "$ref": "definitions.json#/$defs/Person"
+ },
+ "contact": {
+ "$ref": "definitions.json#/$defs/Contact"
+ }
+ }
+ },
+ "DecimalValue": {
+ "$id": "DecimalValue",
+ "description": "Describes a numerical value in decimal form",
+ "type": "string",
+ "pattern": "[+-]?([0-9]*[.])?[0-9]+"
+ },
+ "Descriptor": {
+ "$id": "Descriptor",
+ "description": "Physical description of something.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ },
+ "short_desc": {
+ "type": "string"
+ },
+ "long_desc": {
+ "type": "string"
+ },
+ "additional_desc": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text/plain",
+ "text/html",
+ "application/json"
+ ]
+ }
+ }
+ },
+ "media": {
+ "type": "array",
"items": {
- "description": "The items purchased / availed in this order",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Item"
- }
- },
- "add_ons": {
- "description": "The add-ons purchased / availed in this order",
- "type": "array",
- "items": {
- "$ref": "#/$defs/AddOn"
- }
- },
- "offers": {
- "description": "The offers applied in this order",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Offer"
- }
- },
- "billing": {
- "description": "The billing details of this order",
- "allOf": [
- {
- "$ref": "#/$defs/Billing"
- }
- ]
- },
- "fulfillments": {
- "description": "The fulfillments involved in completing this order",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Fulfillment"
- }
- },
- "cancellation": {
- "description": "The cancellation details of this order",
- "allOf": [
- {
- "$ref": "#/$defs/Cancellation"
- }
- ]
- },
- "cancellation_terms": {
- "description": "Cancellation terms of this item",
- "type": "array",
- "items": {
- "$ref": "#/$defs/CancellationTerm"
- }
- },
- "documents": {
- "type": "array",
- "items": {
- "description": "Documnents associated to the order",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "mime_type": {
- "description": "This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838.",
- "type": "string",
- "enum": [
- "text/html",
- "application/html",
- "application/xml",
- "application/pdf"
- ]
- },
- "url": {
- "description": "The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object.",
- "type": "string",
- "format": "uri"
- }
- }
- }
- },
- "refund_terms": {
- "description": "Refund terms of this item",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Item/properties/refund_terms/items"
- }
- },
- "replacement_terms": {
- "description": "Replacement terms of this item",
- "type": "array",
- "items": {
- "$ref": "#/$defs/ReplacementTerm"
- }
- },
- "return_terms": {
- "description": "Return terms of this item",
- "type": "array",
- "items": {
- "$ref": "#/$defs/ReturnTerm"
- }
- },
- "quote": {
- "description": "The mutually agreed upon quotation for this order.",
- "allOf": [
- {
- "$ref": "#/$defs/Quotation"
- }
- ]
- },
- "payments": {
- "description": "The terms of settlement for this order",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Payment"
- }
- },
- "created_at": {
- "description": "The date-time of creation of this order",
- "type": "string",
- "format": "date-time"
- },
- "updated_at": {
- "description": "The date-time of updated of this order",
- "type": "string",
- "format": "date-time"
- },
- "xinput": {
- "description": "Additional input required from the customer to confirm this order",
- "allOf": [
- {
- "$ref": "#/$defs/XInput"
- }
- ]
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
- }
+ "$ref": "definitions.json#/$defs/MediaFile"
}
- }
- },
- "Organization": {
- "$id": "Organization",
- "description": "An organization. Usually a recognized business entity.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "address": {
- "description": "The postal address of the organization",
- "allOf": [
- {
- "$ref": "#/$defs/Address"
- }
- ]
- },
- "state": {
- "description": "The state where the organization's address is registered",
- "allOf": [
- {
- "$ref": "#/$defs/State"
- }
- ]
- },
- "city": {
- "description": "The city where the the organization's address is registered",
- "allOf": [
- {
- "$ref": "#/$defs/City"
- }
- ]
- },
- "contact": {
- "$ref": "#/$defs/Contact"
- }
- }
- },
- "Payment": {
- "$id": "Payment",
- "description": "Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains - the amount that has to be settled,
- The payment destination destination details
- When the settlement should happen, and
- A transaction reference ID
. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider's autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "ID of the payment term that can be referred at an item or an order level in a catalog",
- "type": "string"
- },
- "collected_by": {
- "description": "This field indicates who is the collector of payment. The BAP can set this value to 'bap' if it wants to collect the payment first and settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value 'bpp' if it wants the payment to be made directly.",
- "type": "string"
- },
- "url": {
- "type": "string",
- "description": "A payment url to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If tl_method = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory.",
- "format": "uri"
- },
- "tl_method": {
- "type": "string"
- },
- "params": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "transaction_id": {
- "type": "string",
- "description": "The reference transaction ID associated with a payment activity"
- },
- "amount": {
- "type": "string"
- },
- "currency": {
- "type": "string"
- },
- "bank_code": {
- "type": "string"
- },
- "bank_account_number": {
- "type": "string"
- },
- "virtual_payment_address": {
- "type": "string"
- },
- "source_bank_code": {
- "type": "string"
- },
- "source_bank_account_number": {
- "type": "string"
- },
- "source_virtual_payment_address": {
- "type": "string"
- }
- }
- },
- "type": {
- "type": "string",
- "enum": [
- "PRE-ORDER",
- "PRE-FULFILLMENT",
- "ON-FULFILLMENT",
- "POST-FULFILLMENT",
- "ON-ORDER",
- "PART-PAYMENT"
- ]
- },
- "status": {
- "type": "string",
- "enum": [
- "PAID",
- "NOT-PAID"
- ]
- },
- "time": {
- "$ref": "#/$defs/Time"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
- }
- }
- }
- },
- "Person": {
- "$id": "Person",
- "description": "Describes a person as any individual",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string",
- "description": "Describes the identity of the person"
- },
- "url": {
- "description": "Profile url of the person",
- "type": "string",
- "format": "uri"
- },
- "name": {
- "description": "the name of the person",
- "type": "string"
- },
- "image": {
- "$ref": "#/$defs/Image"
- },
- "age": {
- "description": "Age of the person",
- "allOf": [
- {
- "$ref": "#/$defs/Duration"
- }
- ]
- },
- "dob": {
- "description": "Date of birth of the person",
- "type": "string",
- "format": "date"
- },
- "gender": {
- "type": "string",
- "description": "Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While Male and Female may be used, text strings are also acceptable for people who do not identify as a binary gender.Allowed values for this field can be published in the network policy"
- },
- "creds": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Credential"
- }
- },
- "languages": {
- "type": "array",
- "items": {
- "description": "Describes a language known to the person.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "code": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- }
- }
- },
- "skills": {
- "type": "array",
- "items": {
- "description": "Describes a skill of the person.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "code": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- }
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
- }
- }
- }
- },
- "Price": {
- "$id": "Price",
- "description": "Describes the price of a product or service",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "currency": {
- "type": "string"
- },
- "value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "estimated_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "computed_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "listed_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "offered_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "minimum_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "maximum_value": {
- "$ref": "#/$defs/DecimalValue"
- }
- }
- },
- "Provider": {
- "$id": "Provider",
- "description": "Describes the catalog of a business.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string",
- "description": "Id of the provider"
- },
- "descriptor": {
- "$ref": "#/$defs/Descriptor"
- },
- "category_id": {
- "type": "string",
- "description": "Category Id of the provider at the BPP-level catalog"
- },
- "rating": {
- "$ref": "#/$defs/Rating/properties/value"
- },
- "time": {
- "$ref": "#/$defs/Time"
- },
- "categories": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Category"
- }
- },
- "fulfillments": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Fulfillment"
- }
- },
- "payments": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Payment"
- }
- },
- "locations": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Location"
- }
- },
- "offers": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Offer"
- }
- },
+ },
+ "images": {
+ "type": "array",
"items": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Item"
+ "$ref": "definitions.json#/$defs/Image"
+ }
+ }
+ }
+ },
+ "Domain": {
+ "$id": "Domain",
+ "description": "Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don't have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "description": "Name of the domain",
+ "type": "string"
+ },
+ "code": {
+ "description": "Standard code representing the domain. The standard is usually published as part of the network policy. Furthermore, the network facilitator should also provide a mechanism to provide the supported domains of a network."
+ },
+ "additional_info": {
+ "description": "A url that contains addtional information about that domain.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/MediaFile"
}
- },
- "exp": {
- "type": "string",
- "description": "Time after which catalog has to be refreshed",
- "format": "date-time"
- },
- "rateable": {
- "description": "Whether this provider can be rated or not",
- "type": "boolean"
- },
- "ttl": {
- "description": "The time-to-live in seconds, for this object. This can be overriden at deeper levels. A value of -1 indicates that this object is not cacheable.",
+ ]
+ }
+ }
+ },
+ "Duration": {
+ "$id": "Duration",
+ "description": "Describes duration as per ISO8601 format",
+ "type": "string"
+ },
+ "Error": {
+ "$id": "Error",
+ "description": "Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo\""
+ },
+ "paths": {
+ "type": "string",
+ "description": "Path to json schema generating the error. Used only during json schema validation errors"
+ },
+ "message": {
+ "type": "string",
+ "description": "Human readable message describing the error. Used mainly for logging. Not recommended to be shown to the user."
+ }
+ }
+ },
+ "Fee": {
+ "$id": "Fee",
+ "description": "A fee applied on a particular entity",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "percentage": {
+ "description": "Percentage of a value",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ }
+ ]
+ },
+ "amount": {
+ "description": "A fixed value",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Price"
+ }
+ ]
+ }
+ }
+ },
+ "Form": {
+ "$id": "Form",
+ "description": "Describes a form",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "The form identifier.",
+ "type": "string"
+ },
+ "url": {
+ "description": "The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object. Once fetched, the rendering platform can choosed to render the form as-is as an embeddable element; or process it further to blend with the theme of the application. In case the interface is non-visual, the the render can process the form data and reproduce it as per the standard specified in the form.",
+ "type": "string",
+ "format": "uri"
+ },
+ "data": {
+ "description": "The form submission data",
+ "type": "object",
+ "additionalProperties": {
"type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TagGroup"
+ }
+ },
+ "mime_type": {
+ "description": "This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838.",
+ "type": "string",
+ "enum": [
+ "text/html",
+ "application/html",
+ "application/xml"
+ ]
+ },
+ "resubmit": {
+ "type": "boolean"
+ },
+ "multiple_sumbissions": {
+ "type": "boolean"
+ }
+ }
+ },
+ "Fulfillment": {
+ "$id": "Fulfillment",
+ "description": "Describes how a an order will be rendered/fulfilled to the end-customer",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "Unique reference ID to the fulfillment of an order",
+ "type": "string"
+ },
+ "type": {
+ "description": "A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled. For example, a retail order can be fulfilled either via store pickup or a home delivery. Similarly, a medical consultation can be provided either in-person or via tele-consultation. The network policy must publish standard fulfillment type codes for the different modes of fulfillment.",
+ "type": "string"
+ },
+ "rateable": {
+ "description": "Whether the fulfillment can be rated or not",
+ "type": "boolean"
+ },
+ "rating": {
+ "description": "The rating value of the fulfullment service.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Rating/properties/value"
+ }
+ ]
+ },
+ "state": {
+ "description": "The current state of fulfillment. The BPP must set this value whenever the state of the order fulfillment changes and fire an unsolicited `on_status` call.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/FulfillmentState"
+ }
+ ]
+ },
+ "tracking": {
+ "type": "boolean",
+ "description": "Indicates whether the fulfillment allows tracking",
+ "default": false
+ },
+ "customer": {
+ "description": "The person that will ultimately receive the order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Customer"
+ }
+ ]
+ },
+ "agent": {
+ "description": "The agent that is currently handling the fulfillment of the order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Agent"
+ }
+ ]
+ },
+ "contact": {
+ "$ref": "definitions.json#/$defs/Contact"
+ },
+ "vehicle": {
+ "$ref": "definitions.json#/$defs/Vehicle"
+ },
+ "stops": {
+ "description": "The list of logical stops encountered during the fulfillment of an order.",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Stop"
+ }
+ },
+ "path": {
+ "description": "The physical path taken by the agent that can be rendered on a map. The allowed format of this property can be set by the network.",
+ "type": "string"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
+ }
+ }
+ }
+ },
+ "FulfillmentState": {
+ "$id": "FulfillmentState",
+ "description": "Describes the state of fulfillment",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_by": {
+ "type": "string",
+ "description": "ID of entity which changed the state"
+ }
+ }
+ },
+ "Gps": {
+ "$id": "Gps",
+ "description": "Describes a GPS coordinate",
+ "type": "string",
+ "pattern": "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?),\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$"
+ },
+ "Image": {
+ "$id": "Image",
+ "description": "Describes an image",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "url": {
+ "description": "URL to the image. This can be a data url or an remote url",
+ "type": "string",
+ "format": "uri"
+ },
+ "size_type": {
+ "description": "The size of the image. The network policy can define the default dimensions of each type",
+ "type": "string",
+ "enum": [
+ "xs",
+ "sm",
+ "md",
+ "lg",
+ "xl",
+ "custom"
+ ]
+ },
+ "width": {
+ "description": "Width of the image in pixels",
+ "type": "string"
+ },
+ "height": {
+ "description": "Height of the image in pixels",
+ "type": "string"
+ }
+ }
+ },
+ "Intent": {
+ "$id": "Intent",
+ "description": "The intent to buy or avail a product or a service. The BAP can declare the intent of the consumer containing - What they want (A product, service, offer)
- Who they want (A seller, service provider, agent etc)
- Where they want it and where they want it from
- When they want it (start and end time of fulfillment
- How they want to pay for it
This has properties like descriptor,provider,fulfillment,payment,category,offer,item,tags
This is typically used by the BAP to send the purpose of the user's search to the BPP. This will be used by the BPP to find products or services it offers that may match the user's intent.
For example, in Mobility, the mobility consumer declares a mobility intent. In this case, the mobility consumer declares information that describes various aspects of their journey like,- Where would they like to begin their journey (intent.fulfillment.start.location)
- Where would they like to end their journey (intent.fulfillment.end.location)
- When would they like to begin their journey (intent.fulfillment.start.time)
- When would they like to end their journey (intent.fulfillment.end.time)
- Who is the transport service provider they would like to avail services from (intent.provider)
- Who is traveling (This is not recommended in public networks) (intent.fulfillment.customer)
- What kind of fare product would they like to purchase (intent.item)
- What add-on services would they like to avail
- What offers would they like to apply on their booking (intent.offer)
- What category of services would they like to avail (intent.category)
- What additional luggage are they carrying
- How would they like to pay for their journey (intent.payment)
For example, in health domain, a consumer declares the intent for a lab booking the describes various aspects of their booking like,- Where would they like to get their scan/test done (intent.fulfillment.start.location)
- When would they like to get their scan/test done (intent.fulfillment.start.time)
- When would they like to get the results of their test/scan (intent.fulfillment.end.time)
- Who is the service provider they would like to avail services from (intent.provider)
- Who is getting the test/scan (intent.fulfillment.customer)
- What kind of test/scan would they like to purchase (intent.item)
- What category of services would they like to avail (intent.category)
- How would they like to pay for their journey (intent.payment)
",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "descriptor": {
+ "description": "A raw description of the search intent. Free text search strings, raw audio, etc can be sent in this object.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ }
+ ]
+ },
+ "provider": {
+ "description": "The provider from which the customer wants to place to the order from",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Provider"
+ }
+ ]
+ },
+ "fulfillment": {
+ "description": "Details on how the customer wants their order fulfilled",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Fulfillment"
+ }
+ ]
+ },
+ "payment": {
+ "description": "Details on how the customer wants to pay for the order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Payment"
+ }
+ ]
+ },
+ "category": {
+ "description": "Details on the item category",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Category"
+ }
+ ]
+ },
+ "offer": {
+ "description": "details on the offer the customer wants to avail",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Offer"
+ }
+ ]
+ },
+ "item": {
+ "description": "Details of the item that the consumer wants to order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Item"
+ }
+ ]
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
+ }
+ }
+ }
+ },
+ "ItemQuantity": {
+ "$id": "ItemQuantity",
+ "description": "Describes the count or amount of an item",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "allocated": {
+ "description": "This represents the exact quantity allocated for purchase of the item.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "count": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "measure": {
+ "$ref": "definitions.json#/$defs/Scalar"
+ }
+ }
+ },
+ "available": {
+ "description": "This represents the exact quantity available for purchase of the item. The buyer can only purchase multiples of this",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "count": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "measure": {
+ "$ref": "definitions.json#/$defs/Scalar"
+ }
+ }
+ },
+ "maximum": {
+ "description": "This represents the maximum quantity allowed for purchase of the item",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "count": {
+ "type": "integer",
+ "minimum": 1
+ },
+ "measure": {
+ "$ref": "definitions.json#/$defs/Scalar"
+ }
+ }
+ },
+ "minimum": {
+ "description": "This represents the minimum quantity allowed for purchase of the item",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "count": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "measure": {
+ "$ref": "definitions.json#/$defs/Scalar"
+ }
+ }
+ },
+ "selected": {
+ "description": "This represents the quantity selected for purchase of the item",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "count": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "measure": {
+ "$ref": "definitions.json#/$defs/Scalar"
+ }
+ }
+ },
+ "unitized": {
+ "description": "This represents the quantity available in a single unit of the item",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "count": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1
+ },
+ "measure": {
+ "$ref": "definitions.json#/$defs/Scalar"
}
}
}
- },
- "Quotation": {
- "$id": "Quotation",
- "description": "Describes a quote. It is the estimated price of products or services from the BPP.
This has properties like price, breakup, ttl",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "ID of the quote.",
- "type": "string",
- "format": "uuid"
- },
- "price": {
- "description": "The total quoted price",
- "allOf": [
- {
- "$ref": "#/$defs/Price"
- }
- ]
- },
- "breakup": {
- "description": "the breakup of the total quoted price",
- "type": "array",
- "items": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "item": {
- "$ref": "#/$defs/Item"
- },
- "title": {
- "type": "string"
- },
- "price": {
- "$ref": "#/$defs/Price"
- }
- }
+ }
+ },
+ "Item": {
+ "$id": "Item",
+ "description": "Describes a product or a service offered to the end consumer by the provider. In the mobility sector, it can represent a fare product like one way journey. In the logistics sector, it can represent the delivery service offering. In the retail domain it can represent a product like a grocery item.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "ID of the item.",
+ "type": "string"
+ },
+ "parent_item_id": {
+ "description": "ID of the item, this item is a variant of",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Item/properties/id"
}
- },
- "ttl": {
- "$ref": "#/$defs/Duration"
- }
- }
- },
- "Rating": {
- "$id": "Rating",
- "description": "Describes the rating of an entity",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "rating_category": {
- "description": "Category of the entity being rated",
- "type": "string",
- "enum": [
- "Item",
- "Order",
- "Fulfillment",
- "Provider",
- "Agent",
- "Support"
- ]
- },
- "id": {
- "description": "Id of the object being rated",
- "type": "string"
- },
- "value": {
- "description": "Rating value given to the object. This can be a single value or can also contain an inequality operator like gt, gte, lt, lte. This can also contain an inequality expression containing logical operators like && and ||.",
- "type": "string"
- }
- }
- },
- "Region": {
- "$id": "Region",
- "description": "Describes an arbitrary region of space. The network policy should contain a published list of supported regions by the network.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "dimensions": {
- "description": "The number of dimensions that are used to describe any point inside that region. The most common dimensionality of a region is 2, that represents an area on a map. There are regions on the map that can be approximated to one-dimensional regions like roads, railway lines, or shipping lines. 3 dimensional regions are rarer, but are gaining popularity as flying drones are being adopted for various fulfillment services.",
- "type": "string",
- "enum": [
- "1",
- "2",
- "3"
- ]
- },
- "type": {
- "description": "The type of region. This is used to specify the granularity of the region represented by this object. Various examples of two-dimensional region types are city, country, state, district, and so on. The network policy should contain a list of all possible region types supported by the network.",
- "type": "string"
- },
- "name": {
- "type": "string",
- "description": "Name of the region as specified on the map where that region exists."
- },
- "code": {
- "type": "string",
- "description": "A standard code representing the region. This should be interpreted in the same way by all network participants."
- },
- "boundary": {
- "type": "string",
- "description": "A string representing the boundary of the region. One-dimensional regions are represented by polylines. Two-dimensional regions are represented by polygons, and three-dimensional regions can represented by polyhedra."
- },
- "map_url": {
- "type": "string",
- "description": "The url to the map of the region. This can be a globally recognized map or the one specified by the network policy."
- }
- }
- },
- "ReplacementTerm": {
- "$id": "ReplacementTerm",
- "description": "The replacement policy of an item or an order",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "fulfillment_state": {
- "description": "The state of fulfillment during which this term is applicable.",
+ ]
+ },
+ "parent_item_quantity": {
+ "description": "The number of units of the parent item this item is a multiple of",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/ItemQuantity"
+ }
+ ]
+ },
+ "descriptor": {
+ "description": "Physical description of the item",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ }
+ ]
+ },
+ "creator": {
+ "description": "The creator of this item",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Organization"
+ }
+ ]
+ },
+ "price": {
+ "description": "The price of this item, if it has intrinsic value",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Price"
+ }
+ ]
+ },
+ "quantity": {
+ "description": "The selling quantity of the item",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/ItemQuantity"
+ }
+ ]
+ },
+ "category_ids": {
+ "description": "Categories this item can be listed under",
+ "type": "array",
+ "items": {
"allOf": [
{
- "$ref": "#/$defs/State"
+ "$ref": "definitions.json#/$defs/Category/properties/id"
}
]
- },
- "replace_within": {
- "description": "Applicable only for buyer managed returns where the buyer has to replace the item before a certain date-time, failing which they will not be eligible for replacement",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "external_ref": {
- "$ref": "#/$defs/MediaFile"
- }
- }
- },
- "ReturnTerm": {
- "$id": "ReturnTerm",
- "description": "Describes the return policy of an item or an order",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "fulfillment_state": {
- "description": "The state of fulfillment during which this term IETF''s applicable.",
- "allOf": [
- {
- "$ref": "#/$defs/State"
- }
- ]
- },
- "return_eligible": {
- "description": "Indicates whether the item is eligible for return",
- "type": "boolean"
- },
- "return_time": {
- "description": "Applicable only for buyer managed returns where the buyer has to return the item to the origin before a certain date-time, failing which they will not be eligible for refund.",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "return_location": {
- "description": "The location where the item or order must / will be returned to",
- "allOf": [
- {
- "$ref": "#/$defs/Location"
- }
- ]
- },
- "fulfillment_managed_by": {
- "description": "The entity that will perform the return",
- "type": "string",
- "enum": [
- "CONSUMER",
- "PROVIDER"
- ]
}
- }
- },
- "Scalar": {
- "$id": "Scalar",
- "description": "Describes a scalar",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "CONSTANT",
- "VARIABLE"
+ },
+ "fulfillment_ids": {
+ "description": "Modes through which this item can be fulfilled",
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Fulfillment/properties/id"
+ }
]
- },
- "value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "estimated_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "computed_value": {
- "$ref": "#/$defs/DecimalValue"
- },
- "range": {
+ }
+ },
+ "location_ids": {
+ "description": "Provider Locations this item is available in",
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Location/properties/id"
+ }
+ ]
+ }
+ },
+ "payment_ids": {
+ "description": "Payment modalities through which this item can be ordered",
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Payment/properties/id"
+ }
+ ]
+ }
+ },
+ "add_ons": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/AddOn"
+ }
+ },
+ "cancellation_terms": {
+ "description": "Cancellation terms of this item",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/CancellationTerm"
+ }
+ },
+ "refund_terms": {
+ "description": "Refund terms of this item",
+ "type": "array",
+ "items": {
+ "description": "Refund term of an item or an order",
"type": "object",
"additionalProperties": false,
"properties": {
- "min": {
- "$ref": "#/$defs/DecimalValue"
+ "fulfillment_state": {
+ "description": "The state of fulfillment during which this term is applicable.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/State"
+ }
+ ]
},
- "max": {
- "$ref": "#/$defs/DecimalValue"
- }
- }
- },
- "unit": {
- "type": "string"
- }
- }
- },
- "Schedule": {
- "$id": "Schedule",
- "description": "Describes schedule as a repeating time period used to describe a regularly recurring event. At a minimum a schedule will specify frequency which describes the interval between occurrences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the timestamps(s) of when the event will take place. Schedules may also have holidays to exclude a specific day from the schedule.
This has properties like frequency, holidays, times",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "frequency": {
- "$ref": "#/$defs/Duration"
- },
- "holidays": {
- "type": "array",
- "items": {
- "type": "string",
- "format": "date-time"
- }
- },
- "times": {
- "type": "array",
- "items": {
- "type": "string",
- "format": "date-time"
- }
- }
- }
- },
- "State": {
- "$id": "State",
- "description": "A bounded geopolitical region of governance inside a country.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of the state"
- },
- "code": {
- "type": "string",
- "description": "State code as per country or international standards"
- }
- }
- },
- "Stop": {
- "$id": "Stop",
- "description": "A logical point in space and time during the fulfillment of an order.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "type": "string"
- },
- "parent_stop_id": {
- "type": "string"
- },
- "location": {
- "description": "Location of the stop",
- "allOf": [
- {
- "$ref": "#/$defs/Location"
- }
- ]
- },
- "type": {
- "description": "The type of stop. Allowed values of this property can be defined by the network policy.",
- "type": "string"
- },
- "time": {
- "description": "Timings applicable at the stop.",
- "allOf": [
- {
- "$ref": "#/$defs/Time"
- }
- ]
- },
- "instructions": {
- "description": "Instructions that need to be followed at the stop",
- "allOf": [
- {
- "$ref": "#/$defs/Descriptor"
- }
- ]
- },
- "contact": {
- "description": "Contact details of the stop",
- "allOf": [
- {
- "$ref": "#/$defs/Contact"
- }
- ]
- },
- "person": {
- "description": "The details of the person present at the stop",
- "allOf": [
- {
- "$ref": "#/$defs/Person"
- }
- ]
- },
- "authorization": {
- "$ref": "#/$defs/Authorization"
- }
- }
- },
- "Support": {
- "$id": "Support",
- "description": "Details of customer support",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "ref_id": {
- "type": "string"
- },
- "callback_phone": {
- "type": "string",
- "format": "phone"
- },
- "phone": {
- "type": "string",
- "format": "phone"
- },
- "email": {
- "type": "string",
- "format": "email"
- },
- "url": {
- "type": "string",
- "format": "uri"
- }
- }
- },
- "Tag": {
- "$id": "Tag",
- "description": "Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "descriptor": {
- "description": "Description of the Tag, can be used to store detailed information.",
- "allOf": [
- {
- "$ref": "#/$defs/Descriptor"
- }
- ]
- },
- "value": {
- "description": "The value of the tag. This set by the BPP and rendered as-is by the BAP.",
- "type": "string"
- },
- "display": {
- "description": "This value indicates if the tag is intended for display purposes. If set to `true`, then this tag must be displayed. If it is set to `false`, it should not be displayed. This value can override the group display value.",
- "type": "boolean"
- }
- }
- },
- "TagGroup": {
- "$id": "TagGroup",
- "description": "A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "display": {
- "description": "Indicates the display properties of the tag group. If display is set to false, then the group will not be displayed. If it is set to true, it should be displayed. However, group-level display properties can be overriden by individual tag-level display property. As this schema is purely for catalog display purposes, it is not recommended to send this value during search.",
- "type": "boolean",
- "default": true
- },
- "descriptor": {
- "description": "Description of the TagGroup, can be used to store detailed information.",
- "allOf": [
- {
- "$ref": "#/$defs/Descriptor"
- }
- ]
- },
- "list": {
- "description": "An array of Tag objects listed under this group. This property can be set by BAPs during search to narrow the `search` and achieve more relevant results. When received during `on_search`, BAPs must render this list under the heading described by the `name` property of this schema.",
- "type": "array",
- "items": {
- "$ref": "#/$defs/Tag"
- }
- }
- }
- },
- "Time": {
- "$id": "Time",
- "description": "Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations
This has properties like label, time stamp,duration,range, days, schedule",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "label": {
- "type": "string"
- },
- "timestamp": {
- "type": "string",
- "format": "date-time"
- },
- "duration": {
- "$ref": "#/$defs/Duration"
- },
- "range": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "start": {
- "type": "string",
- "format": "date-time"
+ "refund_eligible": {
+ "description": "Indicates if cancellation will result in a refund",
+ "type": "boolean"
},
- "end": {
- "type": "string",
- "format": "date-time"
+ "refund_within": {
+ "description": "Time within which refund will be processed after successful cancellation.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
+ }
+ ]
+ },
+ "refund_amount": {
+ "$ref": "definitions.json#/$defs/Price"
}
}
- },
- "days": {
- "type": "string",
- "description": "comma separated values representing days of the week"
- },
- "schedule": {
- "$ref": "#/$defs/Schedule"
+ }
+ },
+ "replacement_terms": {
+ "description": "Terms that are applicable be met when this item is replaced",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/ReplacementTerm"
+ }
+ },
+ "return_terms": {
+ "description": "Terms that are applicable when this item is returned",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/ReturnTerm"
+ }
+ },
+ "xinput": {
+ "description": "Additional input required from the customer to purchase / avail this item",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/XInput"
+ }
+ ]
+ },
+ "time": {
+ "description": "Temporal attributes of this item. This property is used when the item exists on the catalog only for a limited period of time.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
+ }
+ ]
+ },
+ "rateable": {
+ "description": "Whether this item can be rated",
+ "type": "boolean"
+ },
+ "rating": {
+ "description": "The rating of the item",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Rating/properties/value"
+ }
+ ]
+ },
+ "matched": {
+ "description": "Whether this item is an exact match of the request",
+ "type": "boolean"
+ },
+ "related": {
+ "description": "Whether this item is a related item to the exactly matched item",
+ "type": "boolean"
+ },
+ "recommended": {
+ "description": "Whether this item is a recommended item to a response",
+ "type": "boolean"
+ },
+ "ttl": {
+ "description": "Time to live in seconds for an instance of this schema",
+ "type": "string"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
}
}
- },
- "Tracking": {
- "$id": "Tracking",
- "description": "Contains tracking information that can be used by the BAP to track the fulfillment of an order in real-time. which is useful for knowing the location of time sensitive deliveries.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "id": {
- "description": "A unique tracking reference number",
- "type": "string"
- },
- "url": {
- "description": "A URL to the tracking endpoint. This can be a link to a tracking webpage, a webhook URL created by the BAP where BPP can push the tracking data, or a GET url creaed by the BPP which the BAP can poll to get the tracking data. It can also be a websocket URL where the BPP can push real-time tracking data.",
- "type": "string",
- "format": "uri"
- },
- "location": {
- "description": "In case there is no real-time tracking endpoint available, this field will contain the latest location of the entity being tracked. The BPP will update this value everytime the BAP calls the track API.",
- "allOf": [
- {
- "$ref": "#/$defs/Location"
- }
- ]
- },
- "status": {
- "description": "This value indicates if the tracking is currently active or not. If this value is `active`, then the BAP can begin tracking the order. If this value is `inactive`, the tracking URL is considered to be expired and the BAP should stop tracking the order.",
- "type": "string",
- "enum": [
- "active",
- "inactive"
- ]
+ }
+ },
+ "Location": {
+ "$id": "Location",
+ "description": "The physical location of something",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "map_url": {
+ "description": "The url to the map of the location. This can be a globally recognized map url or the one specified by the network policy.",
+ "type": "string",
+ "format": "uri"
+ },
+ "gps": {
+ "description": "The GPS co-ordinates of this location.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Gps"
+ }
+ ]
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "address": {
+ "description": "The address of this location.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Address"
+ }
+ ]
+ },
+ "city": {
+ "description": "The city this location is, or is located within",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/City"
+ }
+ ]
+ },
+ "district": {
+ "description": "The state this location is, or is located within",
+ "type": "string"
+ },
+ "state": {
+ "description": "The state this location is, or is located within",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/State"
+ }
+ ]
+ },
+ "country": {
+ "description": "The country this location is, or is located within",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Country"
+ }
+ ]
+ },
+ "area_code": {
+ "type": "string"
+ },
+ "circle": {
+ "$ref": "definitions.json#/$defs/Circle"
+ },
+ "polygon": {
+ "description": "The boundary polygon of this location",
+ "type": "string"
+ },
+ "3dspace": {
+ "description": "The three dimensional region describing this location",
+ "type": "string"
+ },
+ "rating": {
+ "description": "The rating of this location",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Rating/properties/value"
+ }
+ ]
+ }
+ }
+ },
+ "MediaFile": {
+ "$id": "MediaFile",
+ "description": "This object contains a url to a media file.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "mimetype": {
+ "description": "indicates the nature and format of the document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838",
+ "type": "string"
+ },
+ "url": {
+ "description": "The URL of the file",
+ "type": "string",
+ "format": "uri"
+ },
+ "signature": {
+ "description": "The digital signature of the file signed by the sender",
+ "type": "string"
+ },
+ "dsa": {
+ "description": "The signing algorithm used by the sender",
+ "type": "string"
+ }
+ }
+ },
+ "Offer": {
+ "$id": "Offer",
+ "description": "An offer associated with a catalog. This is typically used to promote a particular product and enable more purchases.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "location_ids": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Location/properties/id"
+ }
+ },
+ "category_ids": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Category/properties/id"
+ }
+ },
+ "item_ids": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Item/properties/id"
+ }
+ },
+ "time": {
+ "$ref": "definitions.json#/$defs/Time"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
}
}
- },
- "Vehicle": {
- "$id": "Vehicle",
- "description": "Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.
This has properties like category, capacity, make, model, size,variant,color,energy_type,registration",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "category": {
- "type": "string"
- },
- "capacity": {
- "type": "integer"
- },
- "make": {
- "type": "string"
- },
- "model": {
- "type": "string"
- },
- "size": {
- "type": "string"
- },
- "variant": {
- "type": "string"
- },
- "color": {
- "type": "string"
- },
- "energy_type": {
- "type": "string"
- },
- "registration": {
- "type": "string"
- },
- "wheels_count": {
- "type": "string"
- },
- "cargo_volumne": {
- "type": "string"
- },
- "wheelchair_access": {
- "type": "string"
- },
- "code": {
- "type": "string"
- },
- "emission_standard": {
- "type": "string"
- }
+ }
+ },
+ "Option": {
+ "$id": "Option",
+ "description": "Describes a selectable option",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
}
- },
- "XInput": {
- "$id": "XInput",
- "description": "Contains any additional or extended inputs required to confirm an order. This is typically a Form Input. Sometimes, selection of catalog elements is not enough for the BPP to confirm an order. For example, to confirm a flight ticket, the airline requires details of the passengers along with information on baggage, identity, in addition to the class of ticket. Similarly, a logistics company may require details on the nature of shipment in order to confirm the shipping. A recruiting firm may require additional details on the applicant in order to confirm a job application. For all such purposes, the BPP can choose to send this object attached to any object in the catalog that is required to be sent while placing the order. This object can typically be sent at an item level or at the order level. The item level XInput will override the Order level XInput as it indicates a special requirement of information for that particular item. Hence the BAP must render a separate form for the Item and another form at the Order level before confirmation.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "head": {
- "description": "Provides the header information for the xinput.",
+ }
+ },
+ "Order": {
+ "$id": "Order",
+ "description": "Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Human-readable ID of the order. This is generated at the BPP layer. The BPP can either generate order id within its system or forward the order ID created at the provider level."
+ },
+ "ref_order_ids": {
+ "description": "A list of order IDs to link this order to previous orders.",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "description": "ID of a previous order"
+ }
+ },
+ "status": {
+ "description": "Status of the order. Allowed values can be defined by the network policy",
+ "type": "string",
+ "enum": [
+ "ACTIVE",
+ "COMPLETE",
+ "CANCELLED",
+ "COMPLETED",
+ "SOFT_CANCEL"
+ ]
+ },
+ "type": {
+ "description": "This is used to indicate the type of order being created to BPPs. Sometimes orders can be linked to previous orders, like a replacement order in a retail domain. A follow-up consultation in healthcare domain. A single order part of a subscription order. The list of order types can be standardized at the network level.",
+ "type": "string",
+ "default": "DEFAULT",
+ "enum": [
+ "DRAFT",
+ "DEFAULT"
+ ]
+ },
+ "provider": {
+ "description": "Details of the provider whose catalog items have been selected.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Provider"
+ }
+ ]
+ },
+ "items": {
+ "description": "The items purchased / availed in this order",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Item"
+ }
+ },
+ "add_ons": {
+ "description": "The add-ons purchased / availed in this order",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/AddOn"
+ }
+ },
+ "offers": {
+ "description": "The offers applied in this order",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Offer"
+ }
+ },
+ "billing": {
+ "description": "The billing details of this order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Billing"
+ }
+ ]
+ },
+ "fulfillments": {
+ "description": "The fulfillments involved in completing this order",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Fulfillment"
+ }
+ },
+ "cancellation": {
+ "description": "The cancellation details of this order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Cancellation"
+ }
+ ]
+ },
+ "cancellation_terms": {
+ "description": "Cancellation terms of this item",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/CancellationTerm"
+ }
+ },
+ "documents": {
+ "type": "array",
+ "items": {
+ "description": "Documnents associated to the order",
"type": "object",
"additionalProperties": false,
"properties": {
"descriptor": {
- "$ref": "#/$defs/Descriptor"
+ "$ref": "definitions.json#/$defs/Descriptor"
},
- "index": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "min": {
- "type": "integer"
- },
- "cur": {
- "type": "integer"
- },
- "max": {
- "type": "integer"
- }
- }
+ "mime_type": {
+ "description": "This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838.",
+ "type": "string",
+ "enum": [
+ "text/html",
+ "application/html",
+ "application/xml",
+ "application/pdf"
+ ]
},
- "headings": {
- "type": "array",
- "items": {
- "type": "string",
- "description": "The heading names of the forms"
- }
+ "url": {
+ "description": "The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object.",
+ "type": "string",
+ "format": "uri"
}
}
- },
- "form": {
- "$ref": "#/$defs/Form"
- },
- "form_response": {
- "description": "Describes the response to a form submission",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "status": {
- "description": "Contains the status of form submission.",
- "type": "string"
- },
- "signature": {
- "type": "string"
- },
- "submission_id": {
- "type": "string"
- },
- "errors": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Error"
- }
- }
+ }
+ },
+ "refund_terms": {
+ "description": "Refund terms of this item",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Item/properties/refund_terms/items"
+ }
+ },
+ "replacement_terms": {
+ "description": "Replacement terms of this item",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/ReplacementTerm"
+ }
+ },
+ "return_terms": {
+ "description": "Return terms of this item",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/ReturnTerm"
+ }
+ },
+ "quote": {
+ "description": "The mutually agreed upon quotation for this order.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Quotation"
}
- },
- "required": {
- "description": "Indicates whether the form data is mandatorily required by the BPP to confirm the order.",
- "type": "boolean"
+ ]
+ },
+ "payments": {
+ "description": "The terms of settlement for this order",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Payment"
+ }
+ },
+ "created_at": {
+ "description": "The date-time of creation of this order",
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "description": "The date-time of updated of this order",
+ "type": "string",
+ "format": "date-time"
+ },
+ "xinput": {
+ "description": "Additional input required from the customer to confirm this order",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/XInput"
+ }
+ ]
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
}
}
}
+ },
+ "Organization": {
+ "$id": "Organization",
+ "description": "An organization. Usually a recognized business entity.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "address": {
+ "description": "The postal address of the organization",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Address"
+ }
+ ]
+ },
+ "state": {
+ "description": "The state where the organization's address is registered",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/State"
+ }
+ ]
+ },
+ "city": {
+ "description": "The city where the the organization's address is registered",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/City"
+ }
+ ]
+ },
+ "contact": {
+ "$ref": "definitions.json#/$defs/Contact"
+ }
+ }
+ },
+ "Payment": {
+ "$id": "Payment",
+ "description": "Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains - the amount that has to be settled,
- The payment destination destination details
- When the settlement should happen, and
- A transaction reference ID
. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider's autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "ID of the payment term that can be referred at an item or an order level in a catalog",
+ "type": "string"
+ },
+ "collected_by": {
+ "description": "This field indicates who is the collector of payment. The BAP can set this value to 'bap' if it wants to collect the payment first and settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value 'bpp' if it wants the payment to be made directly.",
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "description": "A payment url to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If tl_method = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory.",
+ "format": "uri"
+ },
+ "tl_method": {
+ "type": "string"
+ },
+ "params": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "transaction_id": {
+ "type": "string",
+ "description": "The reference transaction ID associated with a payment activity"
+ },
+ "amount": {
+ "type": "string"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "bank_code": {
+ "type": "string"
+ },
+ "bank_account_number": {
+ "type": "string"
+ },
+ "virtual_payment_address": {
+ "type": "string"
+ },
+ "source_bank_code": {
+ "type": "string"
+ },
+ "source_bank_account_number": {
+ "type": "string"
+ },
+ "source_virtual_payment_address": {
+ "type": "string"
+ }
+ }
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "PRE-ORDER",
+ "PRE-FULFILLMENT",
+ "ON-FULFILLMENT",
+ "POST-FULFILLMENT",
+ "ON-ORDER",
+ "PART-PAYMENT"
+ ]
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "PAID",
+ "NOT-PAID"
+ ]
+ },
+ "time": {
+ "$ref": "definitions.json#/$defs/Time"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
+ }
+ }
+ }
+ },
+ "Person": {
+ "$id": "Person",
+ "description": "Describes a person as any individual",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Describes the identity of the person"
+ },
+ "url": {
+ "description": "Profile url of the person",
+ "type": "string",
+ "format": "uri"
+ },
+ "name": {
+ "description": "the name of the person",
+ "type": "string"
+ },
+ "image": {
+ "$ref": "definitions.json#/$defs/Image"
+ },
+ "age": {
+ "description": "Age of the person",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Duration"
+ }
+ ]
+ },
+ "dob": {
+ "description": "Date of birth of the person",
+ "type": "string",
+ "format": "date"
+ },
+ "gender": {
+ "type": "string",
+ "description": "Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While Male and Female may be used, text strings are also acceptable for people who do not identify as a binary gender.Allowed values for this field can be published in the network policy"
+ },
+ "creds": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Credential"
+ }
+ },
+ "languages": {
+ "type": "array",
+ "items": {
+ "description": "Describes a language known to the person.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "description": "Describes a skill of the person.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
+ }
+ }
+ }
+ },
+ "Price": {
+ "$id": "Price",
+ "description": "Describes the price of a product or service",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "currency": {
+ "type": "string"
+ },
+ "value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "estimated_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "computed_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "listed_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "offered_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "minimum_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "maximum_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ }
+ }
+ },
+ "Provider": {
+ "$id": "Provider",
+ "description": "Describes the catalog of a business.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Id of the provider"
+ },
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "category_id": {
+ "type": "string",
+ "description": "Category Id of the provider at the BPP-level catalog"
+ },
+ "rating": {
+ "$ref": "definitions.json#/$defs/Rating/properties/value"
+ },
+ "time": {
+ "$ref": "definitions.json#/$defs/Time"
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Category"
+ }
+ },
+ "fulfillments": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Fulfillment"
+ }
+ },
+ "payments": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Payment"
+ }
+ },
+ "locations": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Location"
+ }
+ },
+ "offers": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Offer"
+ }
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Item"
+ }
+ },
+ "exp": {
+ "type": "string",
+ "description": "Time after which catalog has to be refreshed",
+ "format": "date-time"
+ },
+ "rateable": {
+ "description": "Whether this provider can be rated or not",
+ "type": "boolean"
+ },
+ "ttl": {
+ "description": "The time-to-live in seconds, for this object. This can be overriden at deeper levels. A value of -1 indicates that this object is not cacheable.",
+ "type": "string"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/TagGroup"
+ }
+ }
+ }
+ },
+ "Quotation": {
+ "$id": "Quotation",
+ "description": "Describes a quote. It is the estimated price of products or services from the BPP.
This has properties like price, breakup, ttl",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "ID of the quote.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "price": {
+ "description": "The total quoted price",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Price"
+ }
+ ]
+ },
+ "breakup": {
+ "description": "the breakup of the total quoted price",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "item": {
+ "$ref": "definitions.json#/$defs/Item"
+ },
+ "title": {
+ "type": "string"
+ },
+ "price": {
+ "$ref": "definitions.json#/$defs/Price"
+ }
+ }
+ }
+ },
+ "ttl": {
+ "$ref": "definitions.json#/$defs/Duration"
+ }
+ }
+ },
+ "Rating": {
+ "$id": "Rating",
+ "description": "Describes the rating of an entity",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "rating_category": {
+ "description": "Category of the entity being rated",
+ "type": "string",
+ "enum": [
+ "Item",
+ "Order",
+ "Fulfillment",
+ "Provider",
+ "Agent",
+ "Support"
+ ]
+ },
+ "id": {
+ "description": "Id of the object being rated",
+ "type": "string"
+ },
+ "value": {
+ "description": "Rating value given to the object. This can be a single value or can also contain an inequality operator like gt, gte, lt, lte. This can also contain an inequality expression containing logical operators like && and ||.",
+ "type": "string"
+ }
+ }
+ },
+ "Region": {
+ "$id": "Region",
+ "description": "Describes an arbitrary region of space. The network policy should contain a published list of supported regions by the network.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "dimensions": {
+ "description": "The number of dimensions that are used to describe any point inside that region. The most common dimensionality of a region is 2, that represents an area on a map. There are regions on the map that can be approximated to one-dimensional regions like roads, railway lines, or shipping lines. 3 dimensional regions are rarer, but are gaining popularity as flying drones are being adopted for various fulfillment services.",
+ "type": "string",
+ "enum": [
+ "1",
+ "2",
+ "3"
+ ]
+ },
+ "type": {
+ "description": "The type of region. This is used to specify the granularity of the region represented by this object. Various examples of two-dimensional region types are city, country, state, district, and so on. The network policy should contain a list of all possible region types supported by the network.",
+ "type": "string"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the region as specified on the map where that region exists."
+ },
+ "code": {
+ "type": "string",
+ "description": "A standard code representing the region. This should be interpreted in the same way by all network participants."
+ },
+ "boundary": {
+ "type": "string",
+ "description": "A string representing the boundary of the region. One-dimensional regions are represented by polylines. Two-dimensional regions are represented by polygons, and three-dimensional regions can represented by polyhedra."
+ },
+ "map_url": {
+ "type": "string",
+ "description": "The url to the map of the region. This can be a globally recognized map or the one specified by the network policy."
+ }
+ }
+ },
+ "ReplacementTerm": {
+ "$id": "ReplacementTerm",
+ "description": "The replacement policy of an item or an order",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "fulfillment_state": {
+ "description": "The state of fulfillment during which this term is applicable.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/State"
+ }
+ ]
+ },
+ "replace_within": {
+ "description": "Applicable only for buyer managed returns where the buyer has to replace the item before a certain date-time, failing which they will not be eligible for replacement",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
+ }
+ ]
+ },
+ "external_ref": {
+ "$ref": "definitions.json#/$defs/MediaFile"
+ }
+ }
+ },
+ "ReturnTerm": {
+ "$id": "ReturnTerm",
+ "description": "Describes the return policy of an item or an order",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "fulfillment_state": {
+ "description": "The state of fulfillment during which this term IETF''s applicable.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/State"
+ }
+ ]
+ },
+ "return_eligible": {
+ "description": "Indicates whether the item is eligible for return",
+ "type": "boolean"
+ },
+ "return_time": {
+ "description": "Applicable only for buyer managed returns where the buyer has to return the item to the origin before a certain date-time, failing which they will not be eligible for refund.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
+ }
+ ]
+ },
+ "return_location": {
+ "description": "The location where the item or order must / will be returned to",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Location"
+ }
+ ]
+ },
+ "fulfillment_managed_by": {
+ "description": "The entity that will perform the return",
+ "type": "string",
+ "enum": [
+ "CONSUMER",
+ "PROVIDER"
+ ]
+ }
+ }
+ },
+ "Scalar": {
+ "$id": "Scalar",
+ "description": "Describes a scalar",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CONSTANT",
+ "VARIABLE"
+ ]
+ },
+ "value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "estimated_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "computed_value": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "range": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "min": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ },
+ "max": {
+ "$ref": "definitions.json#/$defs/DecimalValue"
+ }
+ }
+ },
+ "unit": {
+ "type": "string"
+ }
+ }
+ },
+ "Schedule": {
+ "$id": "Schedule",
+ "description": "Describes schedule as a repeating time period used to describe a regularly recurring event. At a minimum a schedule will specify frequency which describes the interval between occurrences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the timestamps(s) of when the event will take place. Schedules may also have holidays to exclude a specific day from the schedule.
This has properties like frequency, holidays, times",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "frequency": {
+ "$ref": "definitions.json#/$defs/Duration"
+ },
+ "holidays": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "times": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ }
+ },
+ "State": {
+ "$id": "State",
+ "description": "A bounded geopolitical region of governance inside a country.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the state"
+ },
+ "code": {
+ "type": "string",
+ "description": "State code as per country or international standards"
+ }
+ }
+ },
+ "Stop": {
+ "$id": "Stop",
+ "description": "A logical point in space and time during the fulfillment of an order.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "parent_stop_id": {
+ "type": "string"
+ },
+ "location": {
+ "description": "Location of the stop",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Location"
+ }
+ ]
+ },
+ "type": {
+ "description": "The type of stop. Allowed values of this property can be defined by the network policy.",
+ "type": "string"
+ },
+ "time": {
+ "description": "Timings applicable at the stop.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Time"
+ }
+ ]
+ },
+ "instructions": {
+ "description": "Instructions that need to be followed at the stop",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ }
+ ]
+ },
+ "contact": {
+ "description": "Contact details of the stop",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Contact"
+ }
+ ]
+ },
+ "person": {
+ "description": "The details of the person present at the stop",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Person"
+ }
+ ]
+ },
+ "authorization": {
+ "$ref": "definitions.json#/$defs/Authorization"
+ }
+ }
+ },
+ "Support": {
+ "$id": "Support",
+ "description": "Details of customer support",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "ref_id": {
+ "type": "string"
+ },
+ "callback_phone": {
+ "type": "string",
+ "format": "phone"
+ },
+ "phone": {
+ "type": "string",
+ "format": "phone"
+ },
+ "email": {
+ "type": "string",
+ "format": "email"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri"
+ }
+ }
+ },
+ "Tag": {
+ "$id": "Tag",
+ "description": "Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "descriptor": {
+ "description": "Description of the Tag, can be used to store detailed information.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ }
+ ]
+ },
+ "value": {
+ "description": "The value of the tag. This set by the BPP and rendered as-is by the BAP.",
+ "type": "string"
+ },
+ "display": {
+ "description": "This value indicates if the tag is intended for display purposes. If set to `true`, then this tag must be displayed. If it is set to `false`, it should not be displayed. This value can override the group display value.",
+ "type": "boolean"
+ }
+ }
+ },
+ "TagGroup": {
+ "$id": "TagGroup",
+ "description": "A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "display": {
+ "description": "Indicates the display properties of the tag group. If display is set to false, then the group will not be displayed. If it is set to true, it should be displayed. However, group-level display properties can be overriden by individual tag-level display property. As this schema is purely for catalog display purposes, it is not recommended to send this value during search.",
+ "type": "boolean",
+ "default": true
+ },
+ "descriptor": {
+ "description": "Description of the TagGroup, can be used to store detailed information.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ }
+ ]
+ },
+ "list": {
+ "description": "An array of Tag objects listed under this group. This property can be set by BAPs during search to narrow the `search` and achieve more relevant results. When received during `on_search`, BAPs must render this list under the heading described by the `name` property of this schema.",
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Tag"
+ }
+ }
+ }
+ },
+ "Time": {
+ "$id": "Time",
+ "description": "Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations
This has properties like label, time stamp,duration,range, days, schedule",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "label": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "duration": {
+ "$ref": "definitions.json#/$defs/Duration"
+ },
+ "range": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "start": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "end": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ },
+ "days": {
+ "type": "string",
+ "description": "comma separated values representing days of the week"
+ },
+ "schedule": {
+ "$ref": "definitions.json#/$defs/Schedule"
+ }
+ }
+ },
+ "Tracking": {
+ "$id": "Tracking",
+ "description": "Contains tracking information that can be used by the BAP to track the fulfillment of an order in real-time. which is useful for knowing the location of time sensitive deliveries.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "description": "A unique tracking reference number",
+ "type": "string"
+ },
+ "url": {
+ "description": "A URL to the tracking endpoint. This can be a link to a tracking webpage, a webhook URL created by the BAP where BPP can push the tracking data, or a GET url creaed by the BPP which the BAP can poll to get the tracking data. It can also be a websocket URL where the BPP can push real-time tracking data.",
+ "type": "string",
+ "format": "uri"
+ },
+ "location": {
+ "description": "In case there is no real-time tracking endpoint available, this field will contain the latest location of the entity being tracked. The BPP will update this value everytime the BAP calls the track API.",
+ "allOf": [
+ {
+ "$ref": "definitions.json#/$defs/Location"
+ }
+ ]
+ },
+ "status": {
+ "description": "This value indicates if the tracking is currently active or not. If this value is `active`, then the BAP can begin tracking the order. If this value is `inactive`, the tracking URL is considered to be expired and the BAP should stop tracking the order.",
+ "type": "string",
+ "enum": [
+ "active",
+ "inactive"
+ ]
+ }
+ }
+ },
+ "Vehicle": {
+ "$id": "Vehicle",
+ "description": "Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.
This has properties like category, capacity, make, model, size,variant,color,energy_type,registration",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "category": {
+ "type": "string"
+ },
+ "capacity": {
+ "type": "integer"
+ },
+ "make": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "size": {
+ "type": "string"
+ },
+ "variant": {
+ "type": "string"
+ },
+ "color": {
+ "type": "string"
+ },
+ "energy_type": {
+ "type": "string"
+ },
+ "registration": {
+ "type": "string"
+ },
+ "wheels_count": {
+ "type": "string"
+ },
+ "cargo_volumne": {
+ "type": "string"
+ },
+ "wheelchair_access": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ },
+ "emission_standard": {
+ "type": "string"
+ }
+ }
+ },
+ "XInput": {
+ "$id": "XInput",
+ "description": "Contains any additional or extended inputs required to confirm an order. This is typically a Form Input. Sometimes, selection of catalog elements is not enough for the BPP to confirm an order. For example, to confirm a flight ticket, the airline requires details of the passengers along with information on baggage, identity, in addition to the class of ticket. Similarly, a logistics company may require details on the nature of shipment in order to confirm the shipping. A recruiting firm may require additional details on the applicant in order to confirm a job application. For all such purposes, the BPP can choose to send this object attached to any object in the catalog that is required to be sent while placing the order. This object can typically be sent at an item level or at the order level. The item level XInput will override the Order level XInput as it indicates a special requirement of information for that particular item. Hence the BAP must render a separate form for the Item and another form at the Order level before confirmation.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "head": {
+ "description": "Provides the header information for the xinput.",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "descriptor": {
+ "$ref": "definitions.json#/$defs/Descriptor"
+ },
+ "index": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "min": {
+ "type": "integer"
+ },
+ "cur": {
+ "type": "integer"
+ },
+ "max": {
+ "type": "integer"
+ }
+ }
+ },
+ "headings": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "description": "The heading names of the forms"
+ }
+ }
+ }
+ },
+ "form": {
+ "$ref": "definitions.json#/$defs/Form"
+ },
+ "form_response": {
+ "description": "Describes the response to a form submission",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "status": {
+ "description": "Contains the status of form submission.",
+ "type": "string"
+ },
+ "signature": {
+ "type": "string"
+ },
+ "submission_id": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "$ref": "definitions.json#/$defs/Error"
+ }
+ }
+ }
+ },
+ "required": {
+ "description": "Indicates whether the form data is mandatorily required by the BPP to confirm the order.",
+ "type": "boolean"
+ }
+ }
}
- }
\ No newline at end of file
+ }
+}
\ No newline at end of file
diff --git a/plugins/schemas/core/v1.1.0/on_cancel.json b/plugins/schemas/core/v1.1.0/on_cancel.json
index 5dc56b4..4abb380 100644
--- a/plugins/schemas/core/v1.1.0/on_cancel.json
+++ b/plugins/schemas/core/v1.1.0/on_cancel.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_cancel",
+ "$id": "on_cancel",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_confirm.json b/plugins/schemas/core/v1.1.0/on_confirm.json
index 6d5a7e9..4abea80 100644
--- a/plugins/schemas/core/v1.1.0/on_confirm.json
+++ b/plugins/schemas/core/v1.1.0/on_confirm.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_confirm",
+ "$id": "on_confirm",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_init.json b/plugins/schemas/core/v1.1.0/on_init.json
index 44446b4..18c44f3 100644
--- a/plugins/schemas/core/v1.1.0/on_init.json
+++ b/plugins/schemas/core/v1.1.0/on_init.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_init",
+ "$id": "on_init",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_rating.json b/plugins/schemas/core/v1.1.0/on_rating.json
index 860dc7b..0b9898b 100644
--- a/plugins/schemas/core/v1.1.0/on_rating.json
+++ b/plugins/schemas/core/v1.1.0/on_rating.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_rating",
+ "$id": "on_rating",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_search.json b/plugins/schemas/core/v1.1.0/on_search.json
index 31c9649..854c6f9 100644
--- a/plugins/schemas/core/v1.1.0/on_search.json
+++ b/plugins/schemas/core/v1.1.0/on_search.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_search",
+ "$id": "on_search",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_select.json b/plugins/schemas/core/v1.1.0/on_select.json
index bfd9875..956c6a8 100644
--- a/plugins/schemas/core/v1.1.0/on_select.json
+++ b/plugins/schemas/core/v1.1.0/on_select.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_select",
+ "$id": "on_select",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_status.json b/plugins/schemas/core/v1.1.0/on_status.json
index a932177..00167e5 100644
--- a/plugins/schemas/core/v1.1.0/on_status.json
+++ b/plugins/schemas/core/v1.1.0/on_status.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_status",
+ "$id": "on_status",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_support.json b/plugins/schemas/core/v1.1.0/on_support.json
index 84d9742..7ba94f0 100644
--- a/plugins/schemas/core/v1.1.0/on_support.json
+++ b/plugins/schemas/core/v1.1.0/on_support.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_support",
+ "$id": "on_support",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_track.json b/plugins/schemas/core/v1.1.0/on_track.json
index fb9f234..cbaf906 100644
--- a/plugins/schemas/core/v1.1.0/on_track.json
+++ b/plugins/schemas/core/v1.1.0/on_track.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_track",
+ "$id": "on_track",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/on_update.json b/plugins/schemas/core/v1.1.0/on_update.json
index 9285b16..74de03c 100644
--- a/plugins/schemas/core/v1.1.0/on_update.json
+++ b/plugins/schemas/core/v1.1.0/on_update.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/on_update",
+ "$id": "on_update",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/search.json b/plugins/schemas/core/v1.1.0/search.json
index 62dbe5a..7faae89 100644
--- a/plugins/schemas/core/v1.1.0/search.json
+++ b/plugins/schemas/core/v1.1.0/search.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/search",
+ "$id": "search",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/core/v1.1.0/select.json b/plugins/schemas/core/v1.1.0/select.json
index 73fd3e1..7151fff 100644
--- a/plugins/schemas/core/v1.1.0/select.json
+++ b/plugins/schemas/core/v1.1.0/select.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://beckn.org/schema/select",
+ "$id": "select",
"type": "object",
"properties": {
"context": {
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/cancel.json b/plugins/schemas/ondc_trv10/v2.0.0/cancel.json
index ba0a40b..7c94ba7 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/cancel.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/cancel.json
@@ -1,13 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/cancel",
+ "$id": "cancel",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/cancel.json#"
- },
- {
- "$ref": "https://beckn.org/schema/cancel#"
+ "$ref": "../../core/v1.1.0/cancel.json#"
},
{
"$ref": "./init.json#/allOf/2"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/confirm.json b/plugins/schemas/ondc_trv10/v2.0.0/confirm.json
index 7cfaf2e..c5fa36d 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/confirm.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/confirm.json
@@ -1,13 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/confirm",
+ "$id": "confirm",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
- },
- {
- "$ref": "https://beckn.org/schema/confirm#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "./init.json#/allOf/2"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/init.json b/plugins/schemas/ondc_trv10/v2.0.0/init.json
index d5b18db..f52f346 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/init.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/init.json
@@ -1,10 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/init",
+ "$id": "init",
"type": "object",
"allOf": [
- { "$ref": "../core/v1.1.0/init.json#" },
- { "$ref": "https://beckn.org/schema/init#" },
+ { "$ref": "../../core/v1.1.0/init.json#" },
{
"allOf": [
{ "$ref": "./search.json#/properties/context/allOf/0" },
@@ -43,7 +42,7 @@
}
},
{ "$ref": "./confirm.json#/allOf/4" },
- { "$ref": "./on_select.json#/allOf/10" },
+ { "$ref": "./on_select.json#" },
{
"properties": {
"message": {
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json b/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json
index d83da6f..95f47e1 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json
@@ -4,7 +4,7 @@
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json b/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json
index 4b35523..7314c63 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json
@@ -4,7 +4,7 @@
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_init.json b/plugins/schemas/ondc_trv10/v2.0.0/on_init.json
index 1f9a926..506353d 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_init.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_init.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_init",
+ "$id": "on_init",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/on_init.json#"
+ "$ref": "../../core/v1.1.0/on_init.json#"
},
{
"$ref": "https://beckn.org/schema/on_init#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json b/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json
index cc16530..eb802fa 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_rating",
+ "$id": "on_rating",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_search.json b/plugins/schemas/ondc_trv10/v2.0.0/on_search.json
index 8a75d14..5629ebb 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_search.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_search.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_search",
+ "$id": "on_search",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/on_search.json#"
+ "$ref": "../../core/v1.1.0/on_search.json#"
},
{
"$ref": "https://beckn.org/schema/on_search#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_select.json b/plugins/schemas/ondc_trv10/v2.0.0/on_select.json
index df4ff0f..e758430 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_select.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_select.json
@@ -1,23 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_select",
+ "$id": "on_select",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/on_select.json#"
- },
- {
- "$ref": "https://beckn.org/schema/on_select#"
+ "$ref": "../../core/v1.1.0/on_select.json#"
},
{
"$ref": "./init.json#/allOf/2"
},
- {
- "$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2"
- },
- {
- "$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4"
- },
{
"properties": {
"message": {
@@ -793,9 +784,6 @@
}
]
},
- {
- "$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/6"
- },
{
"properties": {
"message": {
@@ -819,9 +807,6 @@
}
}
}
- },
- {
- "$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7"
}
]
}
\ No newline at end of file
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_status.json b/plugins/schemas/ondc_trv10/v2.0.0/on_status.json
index bb317b3..0b8afa8 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_status.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_status.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_status",
+ "$id": "on_status",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_support.json b/plugins/schemas/ondc_trv10/v2.0.0/on_support.json
index 5d14baa..88e14ae 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_support.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_support.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_support",
+ "$id": "on_support",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_track.json b/plugins/schemas/ondc_trv10/v2.0.0/on_track.json
index 5006787..83b5a23 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/on_track.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/on_track.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/on_track",
+ "$id": "on_track",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/confirm.json#"
+ "$ref": "../../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/rating.json b/plugins/schemas/ondc_trv10/v2.0.0/rating.json
index 6b6e9c7..a3248c5 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/rating.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/rating.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/rating",
+ "$id": "rating",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/rating.json#"
+ "$ref": "../../core/v1.1.0/rating.json#"
},
{
"$ref": "https://beckn.org/schema/rating#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/search.json b/plugins/schemas/ondc_trv10/v2.0.0/search.json
index 6ecd87c..53c76c6 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/search.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/search.json
@@ -1,9 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/search",
+ "$id": "search",
"allOf": [
- { "$ref": "../core/v1.1.0/search.json#" },
- { "$ref": "https://beckn.org/schema/search#" }
+ { "$ref": "../core/v1.1.0/search.json#" }
],
"type": "object",
"properties": {
@@ -40,11 +39,11 @@
},
"bap_id": {
"type": "string",
- "pattern": "^(?!https?://).*$"
+ "pattern": "^(http|https).*"
},
"bpp_id": {
"type": "string",
- "pattern": "^(?!https?://).*$"
+ "pattern": "^(http|https).*"
},
"ttl": {
"type": "string",
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/select.json b/plugins/schemas/ondc_trv10/v2.0.0/select.json
index 324cedc..555e516 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/select.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/select.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/select",
+ "$id": "select",
"type": "object",
"allOf": [
{ "$ref": "../core/v1.1.0/select.json#" },
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/status.json b/plugins/schemas/ondc_trv10/v2.0.0/status.json
index 5d6ed73..9033a5e 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/status.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/status.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/status",
+ "$id": "status",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/status.json#"
+ "$ref": "../../core/v1.1.0/status.json#"
},
{
"$ref": "https://beckn.org/schema/status#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/support.json b/plugins/schemas/ondc_trv10/v2.0.0/support.json
index e96c10c..77a707a 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/support.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/support.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/support",
+ "$id": "support",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/support.json#"
+ "$ref": "../../core/v1.1.0/support.json#"
},
{
"$ref": "https://beckn.org/schema/support#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/track.json b/plugins/schemas/ondc_trv10/v2.0.0/track.json
index 9de517e..ddfcb4c 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/track.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/track.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/track",
+ "$id": "track",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/track.json#"
+ "$ref": "../../core/v1.1.0/track.json#"
},
{
"$ref": "https://beckn.org/schema/track#"
diff --git a/plugins/schemas/ondc_trv10/v2.0.0/update.json b/plugins/schemas/ondc_trv10/v2.0.0/update.json
index 1f93324..0079e36 100644
--- a/plugins/schemas/ondc_trv10/v2.0.0/update.json
+++ b/plugins/schemas/ondc_trv10/v2.0.0/update.json
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://ondc.org/trv10/2.0.0/update",
+ "$id": "update",
"type": "object",
"allOf": [
{
- "$ref": "../core/v1.1.0/update.json#"
+ "$ref": "../../core/v1.1.0/update.json#"
},
{
"$ref": "https://beckn.org/schema/update#"
diff --git a/plugins/schemas_valid/ondc_trv10_2.0.0.json b/plugins/schemas_valid/ondc_trv10_2.0.0.json
index c55f639..e0ffb39 100644
--- a/plugins/schemas_valid/ondc_trv10_2.0.0.json
+++ b/plugins/schemas_valid/ondc_trv10_2.0.0.json
@@ -248,498 +248,6 @@
"required": ["intent"]
}
}
- },
- "select": {
- "$id": "select#",
- "type": "object",
- "properties": {
- "context": {
- "type": "object",
- "properties": {
- "domain": {
- "type": "string"
- },
- "location": {
- "type": "object",
- "properties": {
- "city": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string"
- }
- },
- "required": ["code"]
- },
- "country": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "enum": ["IND"]
- }
- },
- "required": ["code"]
- }
- },
- "required": ["city", "country"]
- },
- "action": {
- "type": "string",
- "enum": ["search"]
- },
- "bap_id": {
- "type": "string"
- },
- "bap_uri": {
- "type": "string",
- "format": "uri"
- },
- "bpp_id": {
- "type": "string"
- },
- "bpp_uri": {
- "type": "string",
- "format": "uri"
- },
- "transaction_id": {
- "type": "string",
- "format": "uuid"
- },
- "message_id": {
- "type": "string",
- "format": "uuid"
- },
- "timestamp": {
- "type": "string",
- "format": "date-time"
- },
- "ttl": {
- "type": "string",
- "format": "duration"
- }
- },
- "required": [
- "domain",
- "location",
- "action",
- "bap_id",
- "bap_uri",
- "transaction_id",
- "message_id",
- "timestamp",
- "ttl"
- ]
- },
- "message": {
- "type": "object",
- "properties": {
- "intent": {
- "type": "object",
- "properties": {
- "fulfillment": {
- "type": "object",
- "properties": {
- "stops": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "location": {
- "type": "object",
- "properties": {
- "gps": {
- "type": "string"
- }
- },
- "required": ["gps"]
- },
- "type": {
- "type": "string",
- "enum": ["START", "END"]
- }
- },
- "required": ["location", "type"]
- },
- "minItems": 2,
- "maxItems": 2
- }
- },
- "required": ["stops"]
- },
- "payment": {
- "type": "object",
- "properties": {
- "collected_by": {
- "type": "string",
- "enum": ["BPP", "BAP"]
- },
- "tags": {
- "type": "array",
- "minItems": 2,
- "maxItems": 2,
- "uniqueItems": true,
- "items": {
- "type": "object",
- "properties": {
- "descriptor": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "enum": ["SETTLEMENT_TERMS", "BUYER_FINDER_FEES"]
- }
- },
- "required": ["code"]
- }
- },
- "allOf": [
- {
- "if": {
- "properties": {
- "descriptor": {
- "properties": {
- "code": {
- "const": "SETTLEMENT_TERMS"
- }
- },
- "required": ["code"]
- }
- }
- },
- "then": {
- "properties": {
- "list": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "descriptor": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "enum": [
- "SETTLEMENT_BASIS",
- "SETTLEMENT_WINDOW",
- "STATIC_TERMS",
- "SETTLEMENT_TYPE",
- "DELAY_INTEREST"
- ]
- }
- },
- "required": ["code"]
- },
- "value": {
- "type": "string"
- }
- },
- "required": ["descriptor", "value"]
- }
- }
- }
- }
- },
- {
- "if": {
- "properties": {
- "descriptor": {
- "properties": {
- "code": {
- "const": "BUYER_FINDER_FEES"
- }
- },
- "required": ["code"]
- }
- }
- },
- "then": {
- "properties": {
- "list": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "descriptor": {
- "type": "object",
- "properties": {
- "code": {
- "enum": ["BUYER_FINDER_FEES_PERCENTAGE"]
- }
- },
- "required": ["code"]
- },
- "value": {
- "type": "string",
- "pattern": "^-?\\d+(\\.\\d+)?$"
- }
- },
- "required": ["descriptor", "value"]
- }
- }
- }
- }
- }
- ],
- "required": ["descriptor"]
- }
- }
- },
- "required": ["collected_by", "tags"]
- }
- },
- "required": ["fulfillment", "payment"]
- }
- },
- "required": ["intent"]
- }
- }
- },
- "on_init": {
- "$id": "on_init#",
- "type": "object",
- "properties": {
- "context": {
- "type": "object",
- "properties": {
- "domain": {
- "type": "string"
- },
- "location": {
- "type": "object",
- "properties": {
- "city": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string"
- }
- },
- "required": ["code"]
- },
- "country": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "enum": ["IND"]
- }
- },
- "required": ["code"]
- }
- },
- "required": ["city", "country"]
- },
- "action": {
- "type": "string",
- "enum": ["search"]
- },
- "bap_id": {
- "type": "string"
- },
- "bap_uri": {
- "type": "string",
- "format": "uri"
- },
- "bpp_id": {
- "type": "string"
- },
- "bpp_uri": {
- "type": "string",
- "format": "uri"
- },
- "transaction_id": {
- "type": "string",
- "format": "uuid"
- },
- "message_id": {
- "type": "string",
- "format": "uuid"
- },
- "timestamp": {
- "type": "string",
- "format": "date-time"
- },
- "ttl": {
- "type": "string",
- "format": "duration"
- }
- },
- "required": [
- "domain",
- "location",
- "action",
- "bap_id",
- "bap_uri",
- "transaction_id",
- "message_id",
- "timestamp",
- "ttl"
- ]
- },
- "message": {
- "type": "object",
- "properties": {
- "intent": {
- "type": "object",
- "properties": {
- "fulfillment": {
- "type": "object",
- "properties": {
- "stops": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "location": {
- "type": "object",
- "properties": {
- "gps": {
- "type": "string"
- }
- },
- "required": ["gps"]
- },
- "type": {
- "type": "string",
- "enum": ["START", "END"]
- }
- },
- "required": ["location", "type"]
- },
- "minItems": 2,
- "maxItems": 2
- }
- },
- "required": ["stops"]
- },
- "payment": {
- "type": "object",
- "properties": {
- "collected_by": {
- "type": "string",
- "enum": ["BPP", "BAP"]
- },
- "tags": {
- "type": "array",
- "minItems": 2,
- "maxItems": 2,
- "uniqueItems": true,
- "items": {
- "type": "object",
- "properties": {
- "descriptor": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "enum": ["SETTLEMENT_TERMS", "BUYER_FINDER_FEES"]
- }
- },
- "required": ["code"]
- }
- },
- "allOf": [
- {
- "if": {
- "properties": {
- "descriptor": {
- "properties": {
- "code": {
- "const": "SETTLEMENT_TERMS"
- }
- },
- "required": ["code"]
- }
- }
- },
- "then": {
- "properties": {
- "list": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "descriptor": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "enum": [
- "SETTLEMENT_BASIS",
- "SETTLEMENT_WINDOW",
- "STATIC_TERMS",
- "SETTLEMENT_TYPE",
- "DELAY_INTEREST"
- ]
- }
- },
- "required": ["code"]
- },
- "value": {
- "type": "string"
- }
- },
- "required": ["descriptor", "value"]
- }
- }
- }
- }
- },
- {
- "if": {
- "properties": {
- "descriptor": {
- "properties": {
- "code": {
- "const": "BUYER_FINDER_FEES"
- }
- },
- "required": ["code"]
- }
- }
- },
- "then": {
- "properties": {
- "list": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "descriptor": {
- "type": "object",
- "properties": {
- "code": {
- "enum": ["BUYER_FINDER_FEES_PERCENTAGE"]
- }
- },
- "required": ["code"]
- },
- "value": {
- "type": "string",
- "pattern": "^-?\\d+(\\.\\d+)?$"
- }
- },
- "required": ["descriptor", "value"]
- }
- }
- }
- }
- }
- ],
- "required": ["descriptor"]
- }
- }
- },
- "required": ["collected_by", "tags"]
- }
- },
- "required": ["fulfillment", "payment"]
- }
- },
- "required": ["intent"]
- }
- }
}
}
}
diff --git a/test.go b/test.go
index 9870db8..b547da2 100644
--- a/test.go
+++ b/test.go
@@ -10,6 +10,7 @@ import (
"strings"
)
+// Payload represents the structure of the data payload with context information.
type Payload struct {
Context struct {
Domain string `json:"domain"`