Loyalty-Based Pricing API Reference
This page documents the API for the loyalty-based pricing module in Pypulate.
calculate_loyalty_price(base_price, customer_tenure, loyalty_tiers, additional_benefits={})
Calculate price with loyalty discounts and benefits.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_price
|
float
|
Base price before loyalty benefits |
required |
customer_tenure
|
int
|
Customer's tenure in months |
required |
loyalty_tiers
|
dict
|
Discount rates for different tenure levels |
required |
additional_benefits
|
dict
|
Additional benefits for loyal customers |
{}
|
Returns:
Type | Description |
---|---|
dict
|
Dictionary containing: - loyalty_price: final price after discount - loyalty_tier: the applicable tier - loyalty_discount: discount amount - additional_benefits: benefits dictionary |