For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrating Sample Provider Service

Mock Provider Setup and ONIX Routing Configuration

Overview

This guide explains how to clone and run the mock weather BPP provider, update the ONIX adapter routing configuration, restart the adapters, and verify the search flow using a sample curl request.

1) Clone the repository

git clone https://github.com/kanakkshk-deloitte/mock-bpp-provider

cd mock-bpp-provider

2) Build the Docker image

docker build -t sample-weather-provider .

3) Run the provider container

docker run -d --name weather-provider \

--network beckn_network \

-p 3002:3000 \

-e CALLBACK_URL=http://bpp-onix-adapter:8081/bpp/caller/on_search \

-e BPP_ID=bpp-network \

-e BPP_URI=http://bpp-onix-adapter:8081/bpp/caller \

sample-weather-provider

4) Check provider logs

docker logs -f weather-provider

5) In Beckn Onix update the routing configuration

Create the below files if not present

config/local-simple-routing-BAPReceiver.yaml

routingRules:

- domain: "weather-forecast:oan:kenya"

version: "0.0.1"

targetType: "url"

target:

url: "http://seeker-service:4030"

endpoints:

- on_search

- on_select

- on_init

- on_confirm

- on_status

- on_track

- on_cancel

- on_update

- on_rating

- on_support

config/local-simple-routing-BPPCaller.yaml

routingRules:

- domain: "weather-forecast:oan:kenya"

version: "0.0.1"

targetType: "bap"

endpoints:

- on_search

- on_select

- on_init

- on_confirm

- on_status

- on_track

- on_cancel

- on_update

- on_rating

- on_support

config/local-simple-routing-BPPReceiver.yaml

Point the route to the weather provider service:

target:

url: "http://weather-provider:3000/mobility"

If required, point this to the service or domain where the search endpoint is implemented, following the repository specifications.

6) Update config/local-simple.yaml

Make sure the following values are added or updated in your local file:

subscriberId: bap-network

config:

routingConfig: ./config/local-simple-routing-BAPReceiver.yaml

subscriberId: bpp-network

config:

routingConfig: ./config/local-simple-routing-BPPCaller.yaml

A sample full configuration is shown below.

appName: "onix-local"

log:

level: debug

destinations:

- type: stdout

contextKeys:

- transaction_id

- message_id

- subscriber_id

- module_id

plugins:

otelsetup:

id: otelsetup

config:

serviceName: "beckn-onix"

serviceVersion: "1.0.0"

enableMetrics: "true"

environment: "development"

http:

port: 8081

timeout:

read: 30

write: 30

idle: 30

pluginManager:

root: ./plugins

modules:

- name: bapTxnReceiver

path: /bap/receiver/

handler:

type: std

role: bap

subscriberId: bap-network

httpClientConfig:

maxIdleConns: 1000

maxIdleConnsPerHost: 200

idleConnTimeout: 300s

responseHeaderTimeout: 5s

plugins:

registry:

id: registry

config:

url: http://registry:3030/subscribers

retry_max: 3

retry_wait_min: 100ms

retry_wait_max: 500ms

keyManager:

id: simplekeymanager

config:

networkParticipant: bap-network

keyId: bap-network-key

signingPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8="

signingPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4="

encrPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8="

encrPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4="

cache:

id: cache

config:

addr: redis:6379

schemaValidator:

id: schemavalidator

config:

schemaDir: ./schemas

signValidator:

id: signvalidator

signer:

id: signer

router:

id: router

config:

routingConfig: ./config/local-simple-routing-BAPReceiver.yaml

checkPolicy:

id: opapolicychecker

config:

networkPolicyConfig: ./config/opa-network-policies.yaml

refreshInterval: "5m"

middleware:

- id: reqpreprocessor

config:

contextKeys: transaction_id,message_id

role: bap

steps:

- validateSign

- checkPolicy

- addRoute

- signAck

- name: bapTxnCaller

path: /bap/caller/

handler:

type: std

role: bap

httpClientConfig:

maxIdleConns: 1000

maxIdleConnsPerHost: 200

idleConnTimeout: 300s

responseHeaderTimeout: 5s

plugins:

registry:

id: registry

config:

url: http://registry:3030/subscribers

retry_max: 3

retry_wait_min: 100ms

retry_wait_max: 500ms

keyManager:

id: simplekeymanager

config:

networkParticipant: bap-network

keyId: bap-network-key

signingPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8="

signingPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4="

encrPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8="

encrPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4="

cache:

id: cache

config:

addr: redis:6379

router:

id: router

config:

routingConfig: ./config/local-simple-routing-BAPCaller.yaml

signer:

id: signer

middleware:

- id: reqpreprocessor

config:

contextKeys: transaction_id,message_id

role: bap

steps:

- addRoute

- sign

- name: bppTxnReceiver

path: /bpp/receiver/

handler:

type: std

role: bpp

httpClientConfig:

maxIdleConns: 1000

maxIdleConnsPerHost: 200

idleConnTimeout: 300s

responseHeaderTimeout: 5s

plugins:

registry:

id: registry

config:

url: http://registry:3030/subscribers

retry_max: 3

retry_wait_min: 100ms

retry_wait_max: 500ms

keyManager:

id: simplekeymanager

config:

networkParticipant: bpp-network

keyId: bpp-network-key

signingPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw="

signingPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE="

encrPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw="

encrPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE="

cache:

id: cache

config:

addr: redis:6379

schemaValidator:

id: schemavalidator

config:

schemaDir: ./schemas

signValidator:

id: signvalidator

signer:

id: signer

router:

id: router

config:

routingConfig: ./config/local-simple-routing-BPPReceiver.yaml

checkPolicy:

id: opapolicychecker

config:

networkPolicyConfig: ./config/opa-network-policies.yaml

refreshInterval: "5m"

steps:

- validateSign

- checkPolicy

- addRoute

- signAck

- name: bppTxnCaller

path: /bpp/caller/

handler:

type: std

role: bpp

subscriberId: bpp-network

httpClientConfig:

maxIdleConns: 1000

maxIdleConnsPerHost: 200

idleConnTimeout: 300s

responseHeaderTimeout: 5s

plugins:

registry:

id: registry

config:

url: http://registry:3030/subscribers

retry_max: 3

retry_wait_min: 100ms

retry_wait_max: 500ms

keyManager:

id: simplekeymanager

config:

networkParticipant: bpp-network

keyId: bpp-network-key

signingPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw="

signingPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE="

encrPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw="

encrPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE="

cache:

id: cache

config:

addr: redis:6379

router:

id: router

config:

routingConfig: ./config/local-simple-routing-BPPCaller.yaml

signer:

id: signer

steps:

- addRoute

- sign

7) Restart the adapters

docker restart bap-onix-adapter bpp-onix-adapter

8) Test the search flow

Run the following request:

curl -X POST http://localhost:8080/bap/caller/search \

-H "Content-Type: application/json" \

-d '{

"context": {

"domain": "weather-forecast:oan:kenya",

"country": "IND",

"city": "std:080",

"action": "search",

"version": "0.0.1",

"bap_id": "bap-network",

"bap_uri": "http://bap-onix-adapter:8081/bap/receiver",

"transaction_id": "550e8400-e29b-41d4-a716-446655440000",

"message_id": "550e8400-e29b-41d4-a716-446655440001",

"timestamp": "2023-06-15T09:30:00.000Z",

"ttl": "PT30S"

},

"message": {

"intent": {

"fulfillment": {

"stops": [{

"location": {

"gps": "12.9715987,77.5945627"

}

}]

}

}

}

}'

9) Check adapter logs

docker logs -f bap-onix-adapter

10) Expected log output

Validate that you can see output similar to the following:

{"level":"info","transaction_id":"550e8400-e29b-41d4-a716-446655440000","message_id":"","subscriber_id":"bap-network","module_id":"bapTxnReceiver","time":"2026-07-29T10:31:35Z","message":"Forwarding request to URL: http://seeker-service:4030/on_search"}

{"level":"info","transaction_id":"550e8400-e29b-41d4-a716-446655440000","message_id":"msg-1785321095755","subscriber_id":"bap-network","module_id":"bapTxnReceiver","method":"POST","url":"http://seeker-service:4030/on_search","body":"{\"context\":{\"domain\":\"weather-forecast:oan:kenya\",\"country\":\"IND\",\"city\":\"std:080\",\"action\":\"on_search\",\"version\":\"0.0.1\",\"bap_id\":\"bap-network\",\"bap_uri\":\"http://bap-onix-adapter:8081/bap/receiver\",\"transaction_id\":\"550e8400-e29b-41d4-a716-446655440000\",\"message_id\":\"msg-1785321095755\",\"timestamp\":\"2026-07-29T10:31:35.755Z\",\"ttl\":\"PT30S\",\"bpp_id\":\"bpp-network\",\"bpp_uri\":\"http://bpp-onix-adapter:8081/bpp/caller\"},\"message\":{\"catalog\":{\"descriptor\":{\"name\":\"Mock Weather Advisory Catalog\"},\"providers\":[{\"id\":\"provider-weather-1\",\"descriptor\":{\"name\":\"Mock Met Service\",\"short_desc\":\"Live temperature: 27.2°C\"},\"fulfillments\":[{\"id\":\"weather-location-1\",\"stops\":[{\"location\":{\"gps\":\"12.9715987,77.5945627\",\"lat\":\"12.9715987\",\"lon\":\"77.5945627\"}}]}],\"items\":[{\"id\":\"advisory-rain-001\",\"descriptor\":{\"name\":\"Heavy Rain Advisory\",\"short_desc\":\"Orange alert for heavy rainfall in next 6 hours.\",\"long_desc\":\"Live temperature: 27.2°C\"}},{\"id\":\"advisory-heat-002\",\"descriptor\":{\"name\":\"Heatwave Advisory\",\"short_desc\":\"Avoid outdoor exposure from 12:00 to 16:00.\",\"long_desc\":\"Live temperature: 27.2°C\"}}]}}]}}}","remoteAddr":"172.18.0.7:52612","time":"2026-07-29T10:31:35Z","message":"HTTP Request"}

Checklist

Status

Task

Verification

☐

Clone the Mock BPP Provider repository

Repository cloned successfully

☐

Build the Docker image

sample-weather-provider image created

☐

Run the Weather Provider container

Container is running on beckn_network

☐

Verify Weather Provider logs

docker logs -f weather-provider shows no startup errors

☐

Update config/local-simple-routing-BAPReceiver.yaml

Domain weather-forecast:oan:kenya added with target http://seeker-service:4030

☐

Update config/local-simple-routing-BPPCaller.yaml

Routing rule for weather-forecast:oan:kenya configured

☐

Update config/local-simple-routing-BPPReceiver.yaml

Target URL set to http://weather-provider:3000/mobility (or appropriate service endpoint)

☐

Update config/local-simple.yaml

subscriberId: bap-network added for bapTxnReceiver

☐

Update config/local-simple.yaml

routingConfig: ./config/local-simple-routing-BAPReceiver.yaml configured

☐

Update config/local-simple.yaml

subscriberId: bpp-network added for bppTxnCaller

☐

Update config/local-simple.yaml

routingConfig: ./config/local-simple-routing-BPPCaller.yaml configured

☐

Restart ONIX adapters

docker restart bap-onix-adapter bpp-onix-adapter completed successfully

☐

Verify ONIX adapters are running

docker ps shows both adapters in Up state

☐

Execute Search API

curl request returns HTTP 200/202

☐

Check BAP ONIX logs

docker logs -f bap-onix-adapter

☐

Verify request forwarding

Log contains "Forwarding request to URL: http://seeker-service:4030/on_search"

☐

Verify on_search request

HTTP POST sent to http://seeker-service:4030/on_search

☐

Verify catalog response

Response contains Mock Weather Advisory Catalog

Last updated