BizKitHub
DocsAPI ReferenceProduct/bff/product/pricelist-preview
postProductAdmin BFF

/bff/product/pricelist-preview

Evaluates an in-memory rule set against the live base price + cost of (product, variant) at the given instant. Echoes back the winning rule, the resolved price, and a flag if the rule was clamped up to cost to keep margin non-negative.

ProductpostBffProductPricelist-preview

Parameters

JSON body

Request body

application/json
productCodestringRequired

Product code to preview for.

Examplemy-product
variantCodestring | nullOptional

Variant code, or null for product-level preview.

One of 2:
Variant 1
string
Variant 2
null
atstringOptional

ISO datetime at which to evaluate the rules. Defaults to now.

Example2026-06-20T15:30:00Z
rulesany[]Required

In-flight rule set to evaluate — typically the current admin form state. Letting the caller send the rules makes the preview work before the rules are saved.

Response schema

1 status code documented

200Success
basePricenumberRequired

Static product/variant price used as fallback.

costnumberRequired

Internal cost in the organisation default currency.

resolvedPricenumberRequired

Final price after rules + margin clamp.

marginAbsnumberRequired

resolvedPrice - cost; guaranteed >= 0.

matchedRuleIdstring | nullRequired

ID of the winning rule, or null if base price was used.

One of 2:
Variant 1
string
Variant 2
null
matchedRuleNamestring | nullRequired

Name of the winning rule for display.

One of 2:
Variant 1
string
Variant 2
null
clampedToCostbooleanRequired

True when the winning rule was under cost and pulled up to cost.

Response example

application/json
{
  "basePrice": 0,
  "cost": 0,
  "resolvedPrice": 0,
  "marginAbs": 0,
  "clampedToCost": false
}

Request example

POST /bff/product/pricelist-preview

post
curl -X POST "https://api.bizkithub.com/bff/product/pricelist-preview" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "productCode": "my-product",
  "at": "2026-06-20T15:30:00Z",
  "rules": []
}'

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key