diff --git a/docs/release_notes.md b/docs/release_notes.md
index 79b1426..cfa3b35 100644
--- a/docs/release_notes.md
+++ b/docs/release_notes.md
@@ -38,6 +38,7 @@ Experience the convenience and efficiency of Beckn-ONIX as you embark on your jo
- The GUI installer needs Node, NPM and LocalTunnel to be installed before starting.
### Release date
+
2024-05-06
## Beckn-ONIX Version 0.3.0 (2024-03-20)
@@ -66,7 +67,7 @@ Experience the convenience and efficiency of Beckn-ONIX as you embark on your jo
### Limitations
-- The beckn-onix.sh installer used for multi node. For single node installation the start_beckn.sh file has to be used.
+- The beckn-onix.sh installer used for multi node. For single node installation the start_beckn.sh file has to be used. (This is not true anymore. The beckn-onix.sh has an option to install all components on a single machine)
### Upcoming Version
diff --git a/docs/user_guide.md b/docs/user_guide.md
index 227bb05..5045b7a 100644
--- a/docs/user_guide.md
+++ b/docs/user_guide.md
@@ -46,6 +46,13 @@ Docker compose and docker are extensively used in the installation and running o
- Atleast four virtual servers (EC2 instances) configured on the cloud provider with administrator login (e.g. ssh access) to them.
- Access to domain name management with ability to create domain-name/subdomains for each of the components.
+- Run the following two commands on all machines where the script is being run for the first time. Login to a new shell for the command to take effect and continue with the installation. Not doing so will result in docker permisssion error
+
+```
+sudo groupadd docker
+sudo usermod -aG docker $USER
+```
+
- Each of the various sections below list additional pre-requisites which build on these.
### Setting up a new network - Registry
@@ -233,7 +240,7 @@ Refer to the [core specification](https://github.com/beckn/protocol-specificatio
## Running Beckn-ONIX locally
-- In order for people new to Beckn who want to try out Beckn on their own machine, a simple one click installer has been written. Currently it can be installed by running the `start_beckn.sh` script present in the installfolder. In the next release, this will be integrated with the main script and the `start_beckn.sh` script deprecated. An all in one installation has preconfigured values for variables and so pretty much does not ask for any input.
+- In order for people new to Beckn who want to try out Beckn on their own machine, choose the option to "Set up a network on your local machine" in the main screen. The all in one installation has preconfigured values for variables and so pretty much does not ask for any input.
## Appendix A - Registering or adding domain or subdomains
diff --git a/install/ENV/.env-sandbox b/install/ENV/.env-sandbox
new file mode 100644
index 0000000..d71b848
--- /dev/null
+++ b/install/ENV/.env-sandbox
@@ -0,0 +1,2 @@
+BPPCLIENTURL=http://bpp-client:6001
+BASE_URL=http://sandbox-api:3000
diff --git a/install/START_BECKN.md b/install/START_BECKN.md
index 6853806..827b4bd 100644
--- a/install/START_BECKN.md
+++ b/install/START_BECKN.md
@@ -73,13 +73,7 @@ This shell script, `start_beckn_v2.sh`, automates the setup of Beckn components,
./start_container "sandbox-api"
```
-7. **Install Webhook:**
-
- ```bash
- ./start_container "sandbox-webhook"
- ```
-
-8. **Install Protocol Server for BPP:**
+7. **Install Protocol Server for BPP:**
```bash
./update_bpp_config.sh
diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh
index e70ea42..429385a 100755
--- a/install/beckn-onix.sh
+++ b/install/beckn-onix.sh
@@ -73,7 +73,7 @@ install_gateway() {
if [[ $1 && $2 ]]; then
bash scripts/update_gateway_details.sh $1 $2
else
- bash scripts/update_gateway_details.sh registry
+ bash scripts/update_gateway_details.sh http://registry:3030
fi
echo "${GREEN}................Installing Gateway service................${NC}"
start_container $gateway_docker_compose_file gateway
@@ -162,24 +162,44 @@ install_bpp_protocol_server(){
echo "Protocol server BPP installation successful"
}
+# Function to install BPP Protocol Server with Sandbox
+install_bpp_protocol_server_with_sandbox(){
+ start_support_services
+ docker volume create bpp_client_config_volume
+ docker volume create bpp_network_config_volume
+
+ echo "${GREEN}................Installing Sandbox................${NC}"
+ start_container $bpp_docker_compose_file_sandbox "sandbox-api"
+ sleep 5
+ echo "Sandbox installation successful"
-# MAIN SCRIPT STARTS HERE
-#!/bin/bash
+ echo "${GREEN}................Installing Protocol Server for BPP................${NC}"
+
+ if [[ $1 ]];then
+ registry_url=$1
+ bpp_subscriber_id=$2
+ bpp_subscriber_key_id=$3
+ bpp_subscriber_url=$4
+ webhook_url=$5
+ bash scripts/update_bpp_config.sh $registry_url $bpp_subscriber_id $bpp_subscriber_key_id $bpp_subscriber_url $webhook_url
+ else
+ bash scripts/update_bpp_config.sh
+ fi
-echo "Welcome to Beckn-ONIX!"
-if [ -f ./onix_ascii_art.txt ]; then
- cat ./onix_ascii_art.txt
-else
- echo "[Display Beckn-ONIX ASCII Art]"
-fi
+ sleep 10
+ docker run --rm -v $SCRIPT_DIR/../protocol-server-data:/source -v bpp_client_config_volume:/target busybox cp /source/bpp-client.yml /target/default.yml
+ docker run --rm -v $SCRIPT_DIR/../protocol-server-data:/source -v bpp_client_config_volume:/target busybox cp /source/bpp-client.yaml-sample /target
+ docker run --rm -v $SCRIPT_DIR/../protocol-server-data:/source -v bpp_network_config_volume:/target busybox cp /source/bpp-network.yml /target/default.yml
+ docker run --rm -v $SCRIPT_DIR/../protocol-server-data:/source -v bpp_network_config_volume:/target busybox cp /source/bpp-network.yaml-sample /target
+ docker rmi busybox
-echo "Beckn-ONIX is a platform that helps you quickly launch and configure beckn-enabled networks."
-echo -e "\nWhat would you like to do?\n1. Join an existing network\n2. Create new production network\n3. Set up a network on your local machine\n4. Merge multiple networks\n5. Configure Existing Network\n(Press Ctrl+C to exit)"
-read -p "Enter your choice: " choice
+ start_container $bpp_docker_compose_file "bpp-client"
+ start_container $bpp_docker_compose_file "bpp-network"
+ sleep 10
+ echo "Protocol server BPP installation successful"
+}
-boldGreen="\e[1m\e[92m"
-reset="\e[0m"
# Function to handle the setup process for each platform
completeSetup() {
@@ -254,25 +274,51 @@ completeSetup() {
# Key generation and subscription logic follows here
}
-# Determine the platforms available based on the initial choice
-platforms=("Gateway" "BAP" "BPP")
-[ "$choice" -eq 2 ] && platforms=("Registry" "${platforms[@]}") # Add Registry for new network setups
-echo "Great choice! Get ready."
-echo -e "\nWhich platform would you like to set up?"
-for i in "${!platforms[@]}"; do
- echo "$((i+1)). ${platforms[$i]}"
-done
+# MAIN SCRIPT STARTS HERE
-read -p "Enter your choice: " platform_choice
-
-selected_platform="${platforms[$((platform_choice-1))]}"
-
-if [[ -n $selected_platform ]]; then
- completeSetup "$selected_platform"
+echo "Welcome to Beckn-ONIX!"
+if [ -f ./onix_ascii_art.txt ]; then
+ cat ./onix_ascii_art.txt
else
- echo "Invalid option. Please restart the script and select a valid option."
- exit 1
+ echo "[Display Beckn-ONIX ASCII Art]"
+fi
+
+echo "Beckn-ONIX is a platform that helps you quickly launch and configure beckn-enabled networks."
+echo -e "\nWhat would you like to do?\n1. Join an existing network\n2. Create new production network\n3. Set up a network on your local machine\n4. Merge multiple networks\n5. Configure Existing Network\n(Press Ctrl+C to exit)"
+read -p "Enter your choice: " choice
+
+boldGreen="\e[1m\e[92m"
+reset="\e[0m"
+
+if [[ $choice -eq 3 ]]; then
+ echo "Installing all components on the local machine"
+ install_package
+ install_registry
+ install_gateway
+ install_bap_protocol_server
+ install_bpp_protocol_server_with_sandbox
+else
+ # Determine the platforms available based on the initial choice
+ platforms=("Gateway" "BAP" "BPP")
+ [ "$choice" -eq 2 ] && platforms=("Registry" "${platforms[@]}") # Add Registry for new network setups
+
+ echo "Great choice! Get ready."
+ echo -e "\nWhich platform would you like to set up?"
+ for i in "${!platforms[@]}"; do
+ echo "$((i+1)). ${platforms[$i]}"
+ done
+
+ read -p "Enter your choice: " platform_choice
+
+ selected_platform="${platforms[$((platform_choice-1))]}"
+
+ if [[ -n $selected_platform ]]; then
+ completeSetup "$selected_platform"
+ else
+ echo "Invalid option. Please restart the script and select a valid option."
+ exit 1
+ fi
fi
echo "Process complete. Thank you for using Beckn-ONIX!"
diff --git a/install/docker-compose-bpp-with-sandbox.yml b/install/docker-compose-bpp-with-sandbox.yml
index 43ffea5..3b8dcc8 100644
--- a/install/docker-compose-bpp-with-sandbox.yml
+++ b/install/docker-compose-bpp-with-sandbox.yml
@@ -25,7 +25,6 @@ services:
- bpp_network_schemas_volume:/usr/src/app/schemas
- bpp_network_logs_volume:/usr/src/app/logs
-
sandbox-api:
image: fidedocker/sandbox-api
container_name: sandbox-api
@@ -34,19 +33,8 @@ services:
ports:
- 4010:4000
restart: unless-stopped
-
- sandbox-webhook:
- image: fidedocker/sandbox-webhook-api
- depends_on:
- - sandbox-api
- container_name: sandbox-webhook
- networks:
- - beckn_network
- ports:
- - 3005:3005
- restart: unless-stopped
volumes:
- - ./ENV/.env-webhook:/usr/src/app/.env
+ - ./ENV/.env-sandbox:/usr/src/app/.env
networks:
beckn_network:
diff --git a/install/docker-compose-gcl.yml b/install/docker-compose-gcl.yml
index b73857b..67ba486 100644
--- a/install/docker-compose-gcl.yml
+++ b/install/docker-compose-gcl.yml
@@ -55,19 +55,8 @@ services:
ports:
- 4010:4000
restart: unless-stopped
-
- sandbox-webhook:
- image: fidedocker/sandbox-webhook-api
- depends_on:
- - sandbox-api
- container_name: sandbox-webhook
- networks:
- - beckn_network
- ports:
- - 3005:3005
- restart: unless-stopped
volumes:
- - ./ENV/.env-webhook:/usr/src/app/.env
+ - ./ENV/.env-sandbox:/usr/src/app/.env
bpp-client:
image: fidedocker/protocol-server
diff --git a/install/docker-compose-v2.yml b/install/docker-compose-v2.yml
index b73857b..67ba486 100644
--- a/install/docker-compose-v2.yml
+++ b/install/docker-compose-v2.yml
@@ -55,19 +55,8 @@ services:
ports:
- 4010:4000
restart: unless-stopped
-
- sandbox-webhook:
- image: fidedocker/sandbox-webhook-api
- depends_on:
- - sandbox-api
- container_name: sandbox-webhook
- networks:
- - beckn_network
- ports:
- - 3005:3005
- restart: unless-stopped
volumes:
- - ./ENV/.env-webhook:/usr/src/app/.env
+ - ./ENV/.env-sandbox:/usr/src/app/.env
bpp-client:
image: fidedocker/protocol-server
diff --git a/install/docker-compose.yml b/install/docker-compose.yml
index a7cea70..deeec38 100644
--- a/install/docker-compose.yml
+++ b/install/docker-compose.yml
@@ -66,21 +66,8 @@ services:
ports:
- 4010:4000
restart: unless-stopped
-
- sandbox-webhook:
- image: fidedocker/sandbox-webhook-api
- depends_on:
- - registry
- - gateway
- - sandbox-api
- container_name: sandbox-webhook
- networks:
- - beckn_network
- ports:
- - 3005:3005
- restart: unless-stopped
volumes:
- - ./ENV/.env-webhook:/usr/src/app/.env
+ - ./ENV/.env-sandbox:/usr/src/app/.env
bpp-client:
image: fidedocker/protocol-server
diff --git a/install/scripts/update_gateway_details.sh b/install/scripts/update_gateway_details.sh
index 2eec117..5bcb187 100755
--- a/install/scripts/update_gateway_details.sh
+++ b/install/scripts/update_gateway_details.sh
@@ -90,6 +90,9 @@ if [[ $1 ]]; then
registry_id=$(echo "$1" | sed 's/http:\/\///')
fi
fi
+ if [[ $registry_id = "registry:3030" ]]; then
+ registry_id="registry"
+ fi
fi
if [[ $2 ]]; then
diff --git a/install/scripts/variables.sh b/install/scripts/variables.sh
index a753efe..fcda32f 100755
--- a/install/scripts/variables.sh
+++ b/install/scripts/variables.sh
@@ -50,7 +50,7 @@ bpp_network_port=6002
bpp_subscriber_id="bpp-network"
bpp_subscriber_key_id="bpp-network-key"
bpp_subscriber_url="http://bpp-network:6002"
-webhook_url="http://sandbox-webhook:3005"
+webhook_url="http://sandbox-api:3000"
bpp_docker_compose_file=docker-compose-bpp.yml
bpp_docker_compose_file_sandbox=docker-compose-bpp-with-sandbox.yml
diff --git a/install/start_beckn.sh b/install/start_beckn.sh
index af9b676..51df301 100755
--- a/install/start_beckn.sh
+++ b/install/start_beckn.sh
@@ -75,11 +75,6 @@ start_container "sandbox-api"
sleep 5
echo "Sandbox installation successful"
-echo "${GREEN}................Installing Webhook................${NC}"
-start_container "sandbox-webhook"
-sleep
-echo "Webhook installation successful"
-
echo "${GREEN}................Installing Protocol Server for BPP................${NC}"
bash scripts/update_bpp_config.sh
sleep 10
diff --git a/install/start_beckn_v2.sh b/install/start_beckn_v2.sh
index acf1f44..43864e9 100755
--- a/install/start_beckn_v2.sh
+++ b/install/start_beckn_v2.sh
@@ -127,11 +127,6 @@ install_bpp_protocol_server_with_sandbox(){
sleep 5
echo "Sandbox installation successful"
- echo "${GREEN}................Installing Webhook................${NC}"
- start_container $bpp_docker_compose_file_sandbox "sandbox-webhook"
- sleep 5
- echo "Webhook installation successful"
-
echo "${GREEN}................Installing Protocol Server for BPP................${NC}"
if [[ $1 ]];then
diff --git a/layer2/samples/retail_1.1.0_1.1.0.yaml b/layer2/samples/retail_1.1.0_1.1.0.yaml
new file mode 100644
index 0000000..e57689e
--- /dev/null
+++ b/layer2/samples/retail_1.1.0_1.1.0.yaml
@@ -0,0 +1,2164 @@
+openapi: 3.0.0
+info:
+ title: Beckn for Local Retail
+ description: Adaptation of beckn protocol for the local retail domain
+ version: 1.1.0
+security:
+ - SubscriberAuth: []
+paths:
+ /search:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ - Beckn Gateway (BG)
+ description: BAP declares the customer's intent to buy products from retail providers
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - search
+ message:
+ type: object
+ properties:
+ intent:
+ $ref: "#/components/schemas/Intent"
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /select:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: BAP declares the customer's cart (or equivalent) created by selecting objects from the catalog
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - select
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /init:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Initialize an order by providing billing and/or shipping details
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - init
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ required:
+ - context
+ - message
+ responses:
+ default:
+ description: Acknowledgement of message received after successful validation of schema and signature
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ type: object
+ properties:
+ ack:
+ allOf:
+ - $ref: "#/components/schemas/Ack"
+ - properties:
+ status:
+ enum:
+ - ACK
+ - NACK
+ required:
+ - ack
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - message
+ /confirm:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Initialize an order by providing billing and/or shipping details
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - confirm
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /status:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Fetch the latest order object
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - status
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order_id:
+ $ref: "#/components/schemas/Order/properties/id"
+ required:
+ - order_id
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /track:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Track an active order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - track
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order_id:
+ $ref: "#/components/schemas/Order/properties/id"
+ callback_url:
+ type: string
+ format: uri
+ required:
+ - order_id
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /cancel:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Cancel an order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - cancel
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order_id:
+ $ref: "#/components/schemas/Order/properties/id"
+ cancellation_reason_id:
+ $ref: "#/components/schemas/Option/properties/id"
+ descriptor:
+ $ref: "#/components/schemas/Descriptor"
+ required:
+ - order_id
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /update:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Remove object
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - update
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ update_target:
+ description: 'Comma separated values of order objects being updated. For example: ```"update_target":"item,billing,fulfillment"```'
+ type: string
+ order:
+ description: Updated order object
+ allOf:
+ - $ref: "#/components/schemas/Order"
+ required:
+ - update_target
+ - order
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /rating:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Provide feedback on a service
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - rating
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ ratings:
+ type: array
+ items:
+ $ref: "#/components/schemas/Rating"
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /support:
+ post:
+ tags:
+ - Beckn Provider Platform (BPP)
+ description: Contact support
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - support
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ support:
+ $ref: "#/components/schemas/Support"
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_search:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ - Beckn Gateway (BG)
+ description: BPP sends its catalog in response to a search request.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_search
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ catalog:
+ $ref: "#/components/schemas/Catalog"
+ required:
+ - catalog
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_select:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Send draft order object with quoted price for selected items
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_select
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_init:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Send order object with payment details updated
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_init
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_confirm:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Send active order object
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_confirm
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_track:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Send tracking details of an active order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_track
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ tracking:
+ $ref: "#/components/schemas/Tracking"
+ required:
+ - tracking
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_cancel:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Send cancellation request_id with reasons list in case of cancellation request. Else send cancelled order object
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_cancel
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_update:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Returns updated service with updated runtime object
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_update
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_status:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Fetch the status of a Service
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_status
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ order:
+ $ref: "#/components/schemas/Order"
+ required:
+ - order
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_rating:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Provide feedback on a service
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_rating
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ feedback_form:
+ description: A feedback form to allow the user to provide additional information on the rating provided
+ allOf:
+ - $ref: "#/components/schemas/XInput"
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ - message
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+ /on_support:
+ post:
+ tags:
+ - Beckn Application Platform (BAP)
+ description: Contact Support
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ context:
+ allOf:
+ - $ref: "#/components/schemas/Context"
+ - properties:
+ action:
+ enum:
+ - on_support
+ required:
+ - action
+ message:
+ type: object
+ properties:
+ support:
+ $ref: "#/components/schemas/Support"
+ error:
+ $ref: "#/components/schemas/Error"
+ required:
+ - context
+ responses:
+ default:
+ $ref: "#/paths/~1init/post/responses/default"
+components:
+ securitySchemes:
+ SubscriberAuth:
+ type: apiKey
+ in: header
+ name: Authorization
+ description: 'Signature of message body using BAP or BPP subscriber''s signing public key.
Format:Authorization : Signature keyId="{subscriber_id}|{unique_key_id}|{algorithm}",algorithm="ed25519",created="1606970629",expires="1607030629",headers="(created) (expires) digest",signature="Base64(signing string)"'
+ schemas:
+ 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
+ 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: "#/components/schemas/TagGroup"
+ 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
+ properties:
+ id:
+ description: Provider-defined ID of the add-on
+ type: string
+ descriptor:
+ $ref: "#/components/schemas/Descriptor"
+ price:
+ $ref: "#/components/schemas/Price"
+ Address:
+ description: Describes a postal address.
+ type: string
+ 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."
+ properties:
+ person:
+ $ref: "#/components/schemas/Person"
+ contact:
+ $ref: "#/components/schemas/Contact"
+ organization:
+ $ref: "#/components/schemas/Organization"
+ rating:
+ $ref: "#/components/schemas/Rating/properties/value"
+ 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
+ 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:
+ 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
+ properties:
+ name:
+ description: Name of the billable entity
+ type: string
+ organization:
+ description: Details of the organization being billed.
+ allOf:
+ - $ref: "#/components/schemas/Organization"
+ address:
+ description: The address of the billable entity
+ allOf:
+ - $ref: "#/components/schemas/Address"
+ state:
+ description: The state where the billable entity resides. This is important for state-level tax calculation
+ allOf:
+ - $ref: "#/components/schemas/State"
+ city:
+ description: The city where the billable entity resides.
+ allOf:
+ - $ref: "#/components/schemas/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: "#/components/schemas/Time"
+ tax_id:
+ description: ID of the billable entity as recognized by the taxation authority
+ type: string
+ Cancellation:
+ description: Describes a cancellation event
+ type: object
+ 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: "#/components/schemas/Option"
+ additional_description:
+ description: Any additional information regarding the nature of cancellation
+ allOf:
+ - $ref: "#/components/schemas/Descriptor"
+ 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
+ properties:
+ fulfillment_state:
+ description: The state of fulfillment during which this term is applicable.
+ allOf:
+ - $ref: "#/components/schemas/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: "#/components/schemas/Time"
+ cancellation_fee:
+ $ref: "#/components/schemas/Fee"
+ xinput:
+ $ref: "#/components/schemas/XInput"
+ external_ref:
+ $ref: "#/components/schemas/MediaFile"
+ 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.