Skip to main content

Pricing & Offers API

The Pricing & Offers API provides programmatic access to deterministic cost calculations, 5-axis manufacturing calibration, Q* digital-vs-offset crossover points, and competitive print house offers generated by the PrintPrice OS Book Pricing Engine (BPE).

Implementation Traceability
  • Real-Time 5-Axis BPE & Q* Estimate: Implemented at POST /api/pricing/book-estimate (src/api/routes/pricingRoutes.js in ppos-control-plane), accepting pp_test_* and pp_live_* developer keys with pricing:read scope.
  • Marketplace Ranked Offers: Implemented in src/api/routes/marketplacePublic.js:16 (ppos-control-plane) and served under /api/marketplace/offers.

Interactive Console: Real-Time BPE Book Estimate (POST /api/pricing/book-estimate)​

Test the 5-Axis Book Pricing Engine and Q* crossover calculator directly in your browser using a pp_test_* or pp_live_* API key:

INTERACTIVE API CONSOLENO KEY SET
POSThttps://control.printprice.pro/api/pricing/book-estimatescope: pricing:read

Calculates deterministic book manufacturing cost curves across 5 industrial axes (Substrate, Press & Ink, CTP & Plates, Binding & Finishing, Waste & Logistics) and resolves the exact Q* digital-to-offset crossover point.

LIVE RESPONSE
Ready to Execute Live Call

1. Paste your pp_test_* or pp_live_* key above (or test without a key to inspect the 401 handshake).
2. Click SEND REQUEST ▶ to inspect the live response payload, latency, and rate-limit headers.


1. Request Offers (POST /api/marketplace/offers)​

Evaluates the physical specifications of a book and returns ranked offers from eligible print facilities.

BPE Calculation Pipeline​

HTTP Headers​

HeaderValueDescription
Content-Typeapplication/jsonMandatory payload format.
x-trace-idstring (optional)Unique trace ID for request correlation across services.

Request Body (JSON)​

FieldTypeRequiredDescription
copiesInteger / StringYesQuantity of copies to print. Current controller checks presence/truthiness (!payload.copies); strict type: integer, minimum: 1 is a target proposal ([PROPOSAL DEV-02]).
interior_pagesInteger / StringYesTotal interior page count. Current controller checks presence/truthiness (!payload.interior_pages); strict type: integer, minimum: 1 is a target proposal ([PROPOSAL DEV-02]).
formatStringNoStandard format code ("148x210", "A5"). Current BPE processes strings only. Object dimensions {width, height, unit} represent a separate contract proposal ([PROPOSAL DEV-02]).
paper_innerStringNoInterior paper specification (e.g., "offset_white_90").
paper_coverStringNoCover paper specification (e.g., "couche_gloss_250").
binding_methodStringNoBinding method normalized by pricingEngineClient.js:283 ("perfect_bound" → "perfect bound", "hard_cover" → "hardcover").
finishing_optionsStringNoSurface finishings normalized by pricingEngineClient.js:287 ("matt_lam_scratch", "gloss_lam", "soft_touch_lam").
colors_innerStringNoInterior color channels (e.g., "1/1", "4/4").
colors_coverStringNoCover color channels (e.g., "4/0").
delivery_countryStringNoDestination ISO 3166-1 alpha-2 country code (e.g., "ES").

Example Request (cURL)​

curl -X POST "https://api.printprice.pro/api/marketplace/offers" \
-H "Content-Type: application/json" \
-H "x-trace-id: trace_demo_12345" \
-d '{
"copies": 500,
"interior_pages": 192,
"format": "148x210",
"paper_inner": "offset_white_90",
"paper_cover": "couche_gloss_250",
"binding_method": "perfect_bound",
"finishing_options": "matt_lam_scratch",
"colors_inner": "1/1",
"colors_cover": "4/0",
"delivery_country": "ES"
}'

Example Request (Node.js fetch)​

const response = await fetch("https://api.printprice.pro/api/marketplace/offers", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-trace-id": "trace_demo_12345"
},
body: JSON.stringify({
copies: 500,
interior_pages: 192,
format: "148x210",
paper_inner: "offset_white_90",
paper_cover: "couche_gloss_250",
binding_method: "perfect_bound",
finishing_options: "matt_lam_scratch",
colors_inner: "1/1",
colors_cover: "4/0",
delivery_country: "ES"
})
});
const data = await response.json();
console.log(data);

2. Response Structure​

200 OK — Successful Calculation​

Returns a structured array of print offers sorted with recommended flags (note that recommended_offer_id and raw_recommended_offer_id can be null if no offer is recommended):

{
"success": true,
"offers": [
{
"id": "off_01j7b9e84k2",
"offer_id": "off_01j7b9e84k2",
"house_id": "ph_valencia_01",
"printer_id": "ph_valencia_01",
"print_house_id": "ph_valencia_01",
"print_house": "Levante Graphic Press",
"total_cost": 1240.50,
"total_price": 1650.00,
"currency": "EUR",
"margin": 409.50,
"margin_percent": 24.82,
"estimated_delivery_time": "5-7 business days",
"lead_time_days": 6,
"breakdown": [
{ "label": "Interior book block paper", "amount": 420.00 },
{ "label": "Printing and CTP plates", "amount": 380.50 },
{ "label": "Softcover PUR binding", "amount": 310.00 },
{ "label": "Packaging and EPAL palletization", "amount": 130.00 }
],
"recommended": true,
"checkout_allowed": true,
"source": "BPE_MARKETPLACE_NATIVE"
}
],
"recommended_offer_id": "off_01j7b9e84k2",
"raw_recommended_offer_id": "ph_valencia_01",
"trace_id": "trace_demo_12345"
}

200 OK (Graceful Fallback) — Pricing Engine Unavailable​

When the BPE is offline or fails to generate quotes, the API returns HTTP 200 with an explicit failure state:

{
"success": false,
"offers": [],
"message": "Pricing Engine unavailable.",
"error_code": "BPE_UNAVAILABLE"
}

400 Bad Request — Missing Mandatory Fields​

If copies or interior_pages is omitted:

{
"success": false,
"message": "Missing required parameters: copies and interior_pages are mandatory.",
"error_code": "INVALID_PAYLOAD"
}

3. Economic Separation​

In accordance with PrintPrice OS financial governance:

  • total_cost: The direct manufacturing expense computed from print house machine rates, setup time, and raw paper ODS matrix.
  • total_price: The suggested commercial price including platform margin rules.
  • breakdown: Transparent itemized cost lines ensuring complete explainability for publisher accounting.

4. Contract Specification​

Download the formal OpenAPI 3.1 specification for this domain: