External Pricing Engine
Last updated
Last updated
This document provides detailed instructions for Node Providers to integrate the external pricing engine into their system. The external pricing engine is designed to automate the pricing process for customer requests received via the Data3 Console or Node Provider service.
The purpose of integrating the external pricing engine is to streamline the pricing process for Node Providers by automating the calculation and submission of bids for customer requests.
The external pricing engine operates as a REST API/service that accepts customer request information in JSON format, calculates the price based on this information, and then triggers a webhook in the Node Provider service with the bid price. This allows Node Providers to automate their bidding process without manual intervention.
Node Providers can implement the external pricing engine in any platform or stack they have expertise in. However, a sample NodeJS application is provided as a reference implementation (below).
rspAddress
is the unique address / identifier for the customer's deployment request (from the input)
price
is the calculated price for this deployment
To achieve this automated pricing easily, we have provided a sample NodeJS application that you can leverage to implement your own pricing engine.
Program your pricing logic in the calculatePrice
function within the pricing.js
file of the sample application. This function should accept customer request information as input and return the calculated price.
Set up environment variables as specified in the env.sh
file of the sample application. Specifically, configure the WEBHOOK_URL
variable to point to the webhook endpoint in the Node Provider service where bid prices will be submitted.
Install dependencies and start the sample application by executing the following commands within the sample application directory:
This will start this sample NodeJS REST application at http://localhost:3080 and will publish an endpoint at http://localhost:3080/price
Once the sample application is running, test the integration by configuring the Node Provider Service's environment variable EXTERNAL_API_ENDPOINT to point to this sample pricing endpoint at http://localhost:3080/price sample and ensuring that customer requests are sent to the external pricing engine and verify that bid prices are submitted to the Node Provider service via the Data3 Console.
Review the provided sample NodeJS application hosted on GitHub: . This application serves as a reference for implementing the external pricing engine.
For more details, please refer to the file of the sample application.
Sample NodeJS Application:
README.md: