This API is available at:
POST https://www.promptbox.cn/api/price.phpThe API calculates sales and pricing scenarios for business decision-making. Two modes are supported:
Requests must be sent with Content-Type: application/json.
| Parameter | Type | Required | Description |
|---|---|---|---|
mode |
string | Yes | "NP" (Low Price Justification) or "NB" (New Business Pricing) |
ef |
number | Yes | Existing Forecast (pcs) |
ep |
number | Yes | Existing Price |
c |
number | Yes | Product Cost |
mode = "NP"| Parameter | Type | Required | Description |
|---|---|---|---|
lp |
number | Yes | New (lower) Price |
mode = "NB"| Parameter | Type | Required | Description |
|---|---|---|---|
nb |
number | Yes | Expected new business sales (pcs) |
po |
number | Yes | Business overlap percentage (0–100) |
Responses are returned in JSON.
{
"mode": "NP",
"minimum_additional_sales": 250,
"message": "Minimum additional sales needed to justify this price: 250 pcs"
}
{
"mode": "NB",
"lowest_price": 8.735,
"additional_sales_threshold": 400,
"message": "Lowest price to equalize profit: $8.735. If you can't get more than 400 additional, non-overlap, sales with this price, don't lower your price."
}
{
"error": "Missing required fields: ef, ep, c"
}
POST https://www.promptbox.cn/api/price.php
Content-Type: application/json
{
"mode": "NP",
"ef": 1000,
"ep": 12,
"c": 7,
"lp": 9
}
POST https://www.promptbox.cn/api/price.php
Content-Type: application/json
{
"mode": "NB",
"ef": 1000,
"ep": 12,
"c": 7,
"nb": 500,
"po": 20
}
po must be supplied as a percentage (e.g., 20 for 20%).