Pricing & Business Layer

How the Polycrate API manages products, pricing rules and sales history natively: Product kinds, OrganizationProduct, support auto-assignment, region default products and computed costs.

Pricing & Business Layer

Overview

The Polycrate API manages products, pricing rules and sales history natively – without external systems such as Baserow. This business layer forms the foundation for billing, support assignment and resource costs.

graph TB
    Product[Product] --> OrgProduct[OrganizationProduct]
    Product --> PricingRule[PricingRule]
    OrgProduct --> CostStatement[CostStatement]
    S3Bucket[S3 Bucket] --> OrgProduct
    LBI[Loadbalancer Instance] --> OrgProduct

Core Concepts

Product

A Product is a sellable good with a price and optional features:

Product Kind Usage
support Support packages (Basic, Premium, Priority) – controls e.g. RocketChat channel entitlement
object-storage S3 bucket billing
loadbalancer Loadbalancer instance billing
host Dedicated servers / VMs
k8scluster Kubernetes clusters
k8sapp Kubernetes apps
block-storage PersistentVolumes (since API 0.15.0) – see K8s Volumes
dns-zone-internal Internal DNS zones (ayedo-managed, since API 0.15.0)
dns-zone-external External DNS zones (customer provider, since API 0.15.0)

OrganizationProduct

OrganizationProduct links an organization to a Product – including the period and the agreed price:

  • What: Which product
  • To whom: Which organization
  • At what price: agreed_price
  • From when / until when: active_from, active_until

Support Product & Auto-Assignment

Organizations can be assigned a support product (e.g. Premium Support). When this is configured:

  • Auto-assignment: Via SystemConfig.default_support_product, an organization can automatically receive a support product if none is assigned
  • Feature flags: Products carry config.features – e.g. rocketchat_channel: true for the RocketChat integration
  • Condition: If a support product is missing where one is expected, ORGANIZATION_SUPPORT_PRODUCT_MISSING can be set

Region Default Products

S3 buckets and loadbalancer instances can be assigned to a Product automatically:

S3 Cluster

  • Default Product: An S3 cluster can have a default_product (kind=object-storage)
  • New buckets: Automatically receive this product when created
  • Backfill: Existing buckets without a product receive the cluster default during reconciliation
  • SystemConfig: default_s3_product as a suggestion for new clusters

Loadbalancer Instances

  • SystemConfig: default_loadbalancer_product – automatically assigned to all loadbalancer instances
  • Calculation: During reconciliation and on manual assignment

Computed Costs

  • S3 Bucket: computed_cost – usage-based (KB → GB × price/GB)
  • Loadbalancer Instance: computed_cost – flat rate (1 instance × monthly price)
  • Host: Assignable via the match_host_products command
  • K8sVolume (since 0.15.0): computed_cost – usage-based (capacity_bytes → GB × price/GB). Default assignment via SystemConfig.default_k8svolume_product
  • DNSZone (since 0.15.0): Flat rate per zone and month. The price differs by zone scope:
    • scope=internal → default product from SystemConfig.default_dns_zone_internal_product
    • scope=external → default product from SystemConfig.default_dns_zone_external_product
    • External zones are usually more expensive (provider integration, higher maintenance effort)

New in 0.15.0: Productized Models

Several new object types have been "productized": they inherit ProductizedModelMixin and can compute costs:

Model Product Kind(s) Default via
K8sVolume block-storage SystemConfig.default_k8svolume_product
DNSZone (internal) dns-zone-internal SystemConfig.default_dns_zone_internal_product
DNSZone (external) dns-zone-external SystemConfig.default_dns_zone_external_product

Where to Find What

Task Location in the Web UI
Manage products Administration → Products
Assign organization products Open organization → Products section
Set system defaults System Config → Default Products
Set S3 cluster default Edit S3 cluster → Default Product
View costs In the detail views (Bucket, Loadbalancer Instance)

Benefits for IT Leaders

  • Cost overview: Which resources cause which costs?
  • Support tiers: Which organizations have which support level?
  • Billing basis: Sales history and cost statements for billing processes