Broadleaf Microservices
  • v1.0.0-latest-prod

Pricing Services Data Model

Data Model

The following data shows the key tables used by the Pricing Service.

Pricing Data Model

Price Lists

A Price List is the primary entity in the pricing service. It defines the key attributes and context rules for pricing.

BLC_PRICE_LIST

Field Description

ID

Unique row ID.

CONTEXT_ID

Logical id of the price list shared between records being modified in sandboxes

NAME

Name of this price list

ACTIVE_START_DATE

Start date this price list is active

ACTIVE_END_DATE

End date this price list is active

TYPE

One of STANDARD, SALE, or CONTRACT

PRICE_CONTEXT_CRITERIA

Rule determining when this price list applies

USE_MODIFIER

Indicator if this Price List uses price modifiers

PRICE_MODIFIER_AMOUNT

Numeric operator when using price modifier

PRICE_MODIFIER_TYPE

One of PERCENTAGE, MULTIPLICATION, ADDITION, or SUBTRACTION

USE_TARGETS

Indicator if this price list is using user targets

PRIORITY

Lower priority within a type wins (nulls last)

Broadleaf Common Data Features

Price list entities are Application Trackable and Sandbox Trackable - to allow application specific price lists and the ability to modify price lists using the preview and approval workflows.

Price Data

When a price list contains separate entries for each SKU (or other price target) the values are stored in the BLC_PRICE_DATA table.

BLC_PRICE_DATA

Field Description

ID

Unique Id for the Price Data

CONTEXT_ID

Unique row ID.

PRICE_LIST_ID

Ref to the containing price list

PRICE_LIST_NAME

Possibly stale copy of PriceList name for convenient display in admin grids

PRICEABLE_TARGET_TYPE

The type of target being priced (typically SKU)

PRICEABLE_CONTEXT_ID

The id for the item being priced

PRICE

The price for this record

ACTIVE_START_DATE

Start date this price data is active, blank is active

ACTIVE_END_DATE

End date this price data is active, blank is active

PRICE_DATA_TIERS

Structure to allow price based on quantity tiers

RECURRING_PRICE

The amount of the recurring price. Optional. Requires RECUR_PERIOD_FREQUENCY and RECUR_PERIOD_TYPE to define how often the price is billed.

Since Pricing Service 2.1.0.

USAGE_PRICE

The amount of the usage price, meaning the amount to charge for using a usage-based product like a phone plan. Optional. Requires USAGE_AMOUNT and USAGE_UNITS.

Since Pricing Service 2.1.0.

USAGE_AMOUNT

The amount of usage to charge the USAGE_PRICE for, e.g., 1 for a minutes plan would indicate to the billing engine to charge for every minute of usage.

Since Pricing Service 2.1.0.

USAGE_UNITS

The type of units used for the usage price, e.g., MINUTES, TEXTS, GB.

Since Pricing Service 2.1.0.

RECUR_PERIOD_TYPE

The type of billing period for a RECURRING_PRICE, e.g., MONTHLY, QUARTERLY, ANNUALLY.

Since Pricing Service 2.1.0.

RECUR_PERIOD_FREQUENCY

The frequency (per period type) to charge the RECURRING_PRICE, e.g., 3 with a monthly recurring price would indicate that the price should be charged every 3 months, the same as a value of 1 with quarterly billing.

Since Pricing Service 2.1.0.

RECUR_PERIOD_LIMIT

The maximum number of periods to charge the RECURRING_PRICE. Only applicable for non-standard price lists, e.g., for sales, where a discount may be applied for the first 'n' periods after which the price reverts to a standard price list’s price.

Since Pricing Service 2.1.0.

TERM_DURATION_TYPE

The duration type for the recurring price’s terms, e.g. DAYS, WEEKS, MONTHS, YEARS.

Since Pricing Service 2.1.0.

TERM_DURATION_LENGTH

The length of the recurring price’s terms, e.g., 36 for a 36-month contract. This can be matched against a Product’s Terms.

Since Pricing Service 2.1.0.

PRIORITY

The priority of this price data. This helps determine which the best price data is when multiple can apply to a target.

Since Pricing Service 2.1.0.

Broadleaf Common Data Features

Price list entities are Application Trackable and Sandbox Trackable - to allow application specific price lists and the ability to modify price lists using the preview and approval workflows.

User Targets

Stores relationships between a price lists and specific qualifying user segments or accounts.

BLC_PRICE_USER_TARGET

Field Description

PRICE_LIST_ID

Key to parent price list. Part of the primary key.

TARGET_VALE

Reference to the user target (typically id). Part of the primary key.

TARGET_TYPE

Type of user target (CUSTOMER or CUSTOMER_SEGMENT). Part of the primary key.