This repository contains a simple FASTAPI server that facilitates the ONDC (Open Network for Digital Commerce) VLookup service. The VLookup service allows you to perform lookups in the ONDC registry and obtain relevant information based on specified parameters.
- Python installed on your machine
- Clone this repository to your local machine.
- Navigate to the project directory in the terminal.
- Run
pip install -r requirements.txtto install the required dependencies.
- Start the server by running
python -m uvicorn main:app --reloadin the terminal. - The server will run on http://localhost:8000.
Perform a VLookup operation by sending a POST request to http://localhost:9900/vlookup. The payload should be in the following format:
{
"senderSubscriberId": "your_subscriber_id",
"privateKey": "your_private_key",
//search parameters of the NP whose details need to be fetched from registry
"domain": "ONDC:RET10",
"subscriberId": "subscriber_id", // subscriber_id you want to lookup
"country": "IND", // country
"type": "buyerApp", //buyerApp, sellerApp, gateway
"city": "std:022", // city code
"env": "staging" //staging,preprod,prod
}Make sure to replace the sample private key with your actual private key.
- pybase64
- datetime
- uuid
- requests
- PyNaCl
- fastapi
- uvicorn
- pydantic
Feel free to contribute to the development of this project by submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.