Broadleaf Microservices
  • v1.0.0-latest-prod

Pricing Services Data Model

Data Model

The following data model images show the key tables used by the Pricing Service.

Pricing Data Model
Fee 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

CURRENCY

The currency to which this price list applies.

TYPE

One of STANDARD, SALE, CONTRACT, ADJUSTMENT (Since 2.2.0) or COST (Since 2.2.0).

ADJUSTMENT_PHASE

The adjustment phase this price list applies in, if any.

Tip
Since 2.2.0

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

PRICE_MODIFIER_CRITERIA

Rule determining when this price modifier applies

PRICE_MODIFIER_FIELD

The specific field to modify when using a price modifier

USE_TARGETS

Indicator if this price list is using user targets

PRIORITY

Lower priority within a type wins (nulls last)

VENDOR_REF

Reference to the vendor associated with this price list.

ALLOW_VENDOR_PRICEDATA

Whether vendors are allowed to view this price list or add vendor price data to it. Default is false.

PRICE_CAT_AMT_OVERRIDE

Price modification factors associated with pricing category keys.

Tip
Since 2.2.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.

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_TARGET_CONTEXT_ID

The id for the item being priced

VENDOR_REF

Reference to the vendor of the target being priced.

NAME

The name for this price data.

DESCRIPTION

The description for this price data.

SPECIFY_UPFRONT_PRICE

Whether this price data specifies an upfront price. This is only relevant for price data with PREPAID and POSTPAID strategies.

PRICE

The price for this record

ADJUST_OPERATION_TYPE

Indicates the type of operation to use when isForMarkup() is true.

ADJUST_AMOUNT

The amount to adjust a price. Only valid for an ADJUSTMENT type price list.

ADJUST_PRICE_LIST_RELATION

For PriceData’s whose isForMarkup() is true, indicates how the markup relates to a PriceList markup. By default, only the PriceData markup will be used but this value can be used to run both the PriceList and PriceData markups from the same PriceList.

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

STARTING_QUANTITY

The starting quantity before the beginning of flash sale for the item with a limited quantity

Since Pricing Service 2.0.5.

AVAILABLE_QUANTITY

The actual quantity available for this price data as the flash sale progresses

Since Pricing Service 2.0.5.

PAYMENT_STRATEGY

The payment strategy of the price data, e.g. ONE_TIME, PREPAID, POSTPAID.

Since Pricing Service 2.1.0.

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.

CHARACTERISTICS

Attributes to use to filter price data by. Evaluated against a target’s characteristics.

Since Pricing Service 2.1.0.

ATTRIBUTES

Additional miscellaneous attributes to store about this price data.

Since Pricing Service 2.1.0.

TIER_PRICING_STRATEGY

The strategy used to determine tier pricing.

Since Pricing Service 2.2.0.

TIER_ATTRIBUTE_NAME

The name of the attribute used for two-tier pricing.

Since Pricing Service 2.2.0.

CANCELLATION_POLICY_REF

A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData’s subscription would be cancelled.

Since Pricing Service 2.2.0.

Price Data Usage Details

Details of PriceData usage to record for auditing limited pricing usage.

BLC_PRICE_DATA_USAGE_DETAIL

Field Description

ID

Unique Id for the Price Data Usage Detail.

PRICE_DATA_ID

Reference to the containing PriceData.

CUSTOMER_TYPE

The customer type this audit is for e.g. BLC_CUSTOMER.

CUSTOMER_ID

The ID of the customer this audit is for.

TRANSACTION_TYPE

The transaction type this audit is for e.g. BLC_CART.

TRANSACTION_ID

The ID of the transaction this audit is for e.g. cartId.

USAGE_QUANTITY

The quantity of the item used for this audit.

USAGE_DATE

The usage date for this audit.

REVERTIBLE

The revertible flag, if true indicates that this record is eligible for rolling back by PricingDetailTimeoutRollbackJobListener job.

ARCHIVAL_REASON

The reason for the archival of this audit.

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.

Fees

Tip
Since Pricing Service 2.2.0, Release Train 2.3.0

A Fee entity represents a simple fee to that can be applied to a cart. This can be used to represent fees such as Service Fees or Processing Fees.

BLC_FEE

Field Description

CONTEXT_ID

Unique and logical ID of the fee.

LABEL

Label of this fee.

FEE_CODE

Unique code for the fee.

ACTIVE_START_DATE

Start date this fee is active.

ACTIVE_END_DATE

End date this fee is active.

FEE_CALCULATION_METHOD

Where to get the basis for calculating the fee during cart pricing. Currently only CART_SUBTOTAL.

FEE_CALCULATION_OPERATION

How to calculate the fee to be applied onto the cart. One of FIXED_AMOUNT, or RATE.

FIXED_AMOUNT

Amount to be applied as a fee. Only populated if FEE_CALCULATION_OPERATION is FIXED_AMOUNT.

RATE

Percentage of the FEE_CALCULATION_METHOD to be used to determine the fee to be applied. Only populated if FEE_CALCULATION_OPERATION is RATE.

TAX_CODE

Tax code ID for the fee.

PRIORITY

Determines how to prioritize applying fees of the same fee code.

APPLY_BEFORE_DISCOUNTS

Whether to apply the fee before or after offers are applied onto the cart.

IS_FEE_REFUNDABLE

Whether the fee is refundable.

Broadleaf Common Data Features

Fee entities are Application Trackable - fees are only found at the application level, and are not sandboxable, so any changes are deployed straight to production.