For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pricing

The Pricing API evaluates the tenant's pricing-rule engine for a given product + buyer context and returns the resolved unit price along with a transparent breakdown of which rules fired. It is the single source of truth for "what should we charge this customer right now"; checkout flows, quoting tools, and the Preview endpoints all defer to it.

The engine combines:

  • catalog list price (from the product's plan / charge),

  • targeting rules in pricing_rules (segment / locale / partner / quantity / journey),

  • tier tables for volume pricing,

  • partner-specific overrides via partner_rules.

Reads require the read scope. The endpoint is read-only and side-effect free; safe to call from a browser.

Endpoints

GET /api/v1/pricing/resolve

Resolve the effective price for a product given customer context (segment, locale, partner, quantity). Returns the resolved price with a breakdown of pricing rules applied.

get
/pricing/resolve
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Query parameters
productIdstringRequired
segmentstringOptional
localestringOptional
partnerstringOptional
quantityintegerOptionalDefault: 1
Responses
200

Resolved pricing

application/json

Resolved effective price after applying pricing tiers, quantity, and offer discounts

productIdstringOptional
productNamestringOptional
basePriceCentsintegerOptional

Price before offer discounts

resolvedPriceCentsintegerOptional

Final price after all rules and discounts

currencystringOptional
quantityintegerOptional
contextobjectOptional

Customer context used for resolution

availableOffersobject[]Optional
get/pricing/resolve

Resolves the effective unit price for productId given the supplied buyer context. Pass any subset of the optional discriminators — segment, locale, partner, quantity — and the engine narrows the rule set accordingly.

The response includes:

  • price — the resolved unit price in cents.

  • currency — the currency the price is denominated in (driven by the locale match, falling back to the product default).

  • breakdown — an ordered list of { ruleId, ruleType, adjustment } entries showing which pricing_rules rows fired and what each contributed.

  • tier (when applicable) — the matched row from the rule's tier_table for volume pricing.

Returns 404 when the product is not found in the tenant's catalog. Cache aggressively client-side: the response is deterministic for a given (productId, segment, locale, partner, quantity) tuple until the tenant edits a rule.

Requires the read scope.

Last updated

Was this helpful?