Enterprise billing
Learn how to model enterprise billing use cases including negotiated contracts, volume discounts, and custom pricing.
Enterprise billing comes with unique challenges: negotiated contracts, volume discounts, custom pricing terms, multi-year commitments, and complex approval workflows. Lark provides the flexibility to handle all of these scenarios while keeping your billing logic maintainable.
What makes enterprise billing different
Section titled āWhat makes enterprise billing differentāEnterprise customers typically expect:
- Custom pricing: Negotiated rates that differ from your standard plans
- Volume discounts: Tiered pricing or percentage-based discounts based on commitment levels
- Contract terms: Annual or multi-year contracts with scheduled price changes
- Seat-based licensing: Per-user pricing with quantity commitments
- Usage commitments: Minimum spend or usage guarantees with overage billing
- Hybrid models: Combining flat fees with usage-based charges
Larkās concepts of rate cards, discounts, and scheduled changes makes it straightforward to implement all of these patterns.
Custom pricing with price multipliers
Section titled āCustom pricing with price multipliersāRather than creating a separate rate card for each enterprise customer, you can use a standard Enterprise rate card and apply rate_price_multipliers to give each customer their negotiated discounts. This keeps your rate card catalog manageable while supporting custom pricing.
First, create a standard Enterprise rate card with your list prices:
enterprise_rate_card = lark_client.rate_cards.create( name="Enterprise", description="Enterprise plan with annual billing.", billing_interval="yearly", fixed_rates=[ { "name": "Platform fee", "code": "platform_fee", "price": { "type": "flat", "amount": "500000", # $5,000/year list price "currency_code": "usd" } }, { "name": "Seats", "code": "seats", "price": { "type": "flat", "amount": "12000", # $120/year per seat list price "currency_code": "usd" } } ], usage_based_rates=[ { "name": "API requests", "code": "api_requests", "included_units": 1000000, # 1M requests included "price": { "type": "flat", "amount": "1", # $0.01 per request list price "currency_code": "usd" }, "pricing_metric_id": api_requests_metric.id } ],)- Go to the rate cards page and click āNew Rate Cardā.
- Fill in the details:
- Name:
Enterprise - Description:
Enterprise plan with annual billing. - Billing Interval:
Yearly
- Name:
- Add a fixed rate for the platform fee:
- Name:
Platform fee - Code:
platform_fee - Price:
$5,000.00
- Name:
- Add a fixed rate for seats:
- Name:
Seats - Code:
seats - Price:
$120.00
- Name:
- Add a usage-based rate for API requests:
- Name:
API requests - Code:
api_requests - Included Units:
1000000 - Price:
$0.01
- Name:
- Click āSaveā.
Then, when subscribing an enterprise customer, apply their negotiated discounts using rate_price_multipliers:
subscription = lark_client.subscriptions.create( subject_id="acme_corp", rate_card_id=enterprise_rate_card.id, fixed_rate_quantities={ "seats": 250, # 250 seats }, rate_price_multipliers=[ {"platform_fee": 0.85}, # 15% discount on platform fee {"seats": 0.80}, # 20% discount on seats {"api_requests": 0.70}, # 30% discount on API usage ],)- Go to the subjects page and click on the enterprise customer.
- Click on the āSubscriptionsā tab.
- Click āNew Subscriptionā.
- Select the
Enterpriserate card from the dropdown. - Set the seat quantity to
250. - Add price multipliers for each rate:
platform_fee:0.85(15% discount)seats:0.80(20% discount)api_requests:0.70(30% discount)
- Click āSaveā.
This approach lets you maintain a single Enterprise rate card while applying customer-specific discounts. Each customer gets their negotiated rates, and discounts are preserved when they upgrade seats or modify their subscription.
Seat-Based Enterprise Licensing
Section titled āSeat-Based Enterprise LicensingāMany enterprise contracts include a committed number of seats with the ability to add more as needed.
Setting initial seat quantities
Section titled āSetting initial seat quantitiesāsubscription = lark_client.subscriptions.create( subject_id="enterprise_customer", rate_card_id=enterprise_rate_card.id, fixed_rate_quantities={ "seats": 100, # Committed to 100 seats },)Usage commitments with overage billing
Section titled āUsage commitments with overage billingāEnterprise contracts often include usage commitments, a minimum amount of usage included in the base price, with additional charges for overages.
The included_units field on usage-based rates makes this straightforward:
enterprise_rate_card = lark_client.rate_cards.create( name="Enterprise with API Commitment", billing_interval="monthly", fixed_rates=[ { "name": "Platform access", "code": "platform_access", "price": { "type": "flat", "amount": "1000000", # $10,000/month includes usage commitment "currency_code": "usd" } } ], usage_based_rates=[ { "name": "API calls", "code": "api_calls", "included_units": 5000000, # 5M calls included in platform fee "price": { "type": "flat", "amount": "2", # $0.02 per call for overages "currency_code": "usd" }, "pricing_metric_id": api_calls_metric.id } ],)The customer pays $10,000/month and gets 5 million API calls included. Any usage beyond that is billed at $0.02 per call.
Dynamic included units
Section titled āDynamic included unitsāFor enterprise contracts where included usage scales with other quantities (like seats), you can use included_units_function to define a formula.
For example, to include 100 AI chat requests per seat:
enterprise_rate_card = lark_client.rate_cards.create( name="Enterprise per-seat", billing_interval="monthly", fixed_rates=[ { "name": "Seats", "code": "seats", "price": { "type": "flat", "amount": "10000", # $100/month per seat "currency_code": "usd" } } ], usage_based_rates=[ { "name": "AI chat requests", "code": "ai_chat_requests", "included_units_function": "{{fixed_rate_quantities.seats}} * 100" # 100 AI chat requests per seat "price": { "type": "flat", "amount": "50", # $0.50 per AI chat request for overages "currency_code": "usd" }, "pricing_metric_id": ai_chat_requests_metric.id, } ],)With this configuration, a customer with 10 seats gets 10 million API calls included. If they add more seats mid-cycle, their included usage automatically increases.
You can also override included_units_function at the subscription or contract phase level for customer-specific terms:
subscription = lark_client.subscriptions.create( subject_id="enterprise_customer", rate_card_id=enterprise_rate_card.id, fixed_rate_quantities={"seats": 50}, included_units_function={ "api_calls": "{{seats.quantity}} * 2000000" # 2M per seat for this customer })Multi-year contracts with scheduled changes
Section titled āMulti-year contracts with scheduled changesāEnterprise contracts often span multiple years with pricing that changes over time. The contracts API allows you to define multiple phases with different rate cards and price multipliers for each phase.
contract = lark_client.contracts.create( subject_id="subj_VyX6Q96h5avMho8O7QWlKeXE", phases=[ { # Phase 1: 50% discount during onboarding "period": { "start": "2025-01-01", "end": "2025-07-01" }, "rate_card_id": "rc_AJWMxR81jxoRlli6p13uf3JB", "rate_price_multipliers": { "base_fee": 0.5 } }, { # Phase 2: 25% discount "period": { "start": "2025-07-01", "end": "2025-10-01" }, "rate_card_id": "rc_AJWMxR81jxoRlli6p13uf3JB", "rate_price_multipliers": { "base_fee": 0.75 } }, { # Phase 3: Full price "period": { "start": "2025-10-01", "end": "2026-01-01" }, "rate_card_id": "rc_AJWMxR81jxoRlli6p13uf3JB", "rate_price_multipliers": { "base_fee": 1 } } ], metadata={ "salesforce_id": "1234567890" })Dimensional pricing for enterprise
Section titled āDimensional pricing for enterpriseāEnterprise customers with diverse workloads may need pricing that varies by dimensionāsuch as region, environment, or service tier.
First, create a dimensional pricing metric:
compute_metric = lark_client.pricing_metrics.create( name="Compute hours", event_name="compute_usage", aggregation={"aggregation_type": "sum", "field": "hours"}, dimensions=["region", "instance_tier"],)Then, when reporting usage, include the dimension values:
lark_client.usage_events.create( event_name="compute_usage", subject_id="enterprise_customer", timestamp=datetime.now(timezone.utc), idempotency_key="compute_job_12345", data={ "hours": "24.5", "region": "us-east-1", "instance_tier": "high-memory", },)This allows you to bill at different rates for different regions or instance types, which is common in infrastructure and cloud services.
Managing enterprise customers at scale
Section titled āManaging enterprise customers at scaleāOrganizing with subjects
Section titled āOrganizing with subjectsāCreate a subject for each enterprise customer with relevant metadata:
subject = lark_client.subjects.create( external_id="acme_corp_salesforce_id", name="Acme Corporation", email="billing@acme.com",)Subject hierarchies for teams and departments
Section titled āSubject hierarchies for teams and departmentsāFor large enterprises, you often need to track usage and pool credits at different organizational levelsāsuch as by team, department, or cost center.
Use parent_subject_id to create a hierarchy of subjects:
# Create the parent enterprise accountenterprise = lark_client.subjects.create( external_id="acme_corp", name="Acme Corporation",)
# Create departments under the enterpriseengineering = lark_client.subjects.create( external_id="engineering_dept", name="Engineering", parent_subject_id=enterprise.id,)
# Create teams under departmentsbackend_team = lark_client.subjects.create( external_id="team_123", name="Backend Team", parent_subject_id=engineering.id,)This hierarchy allows you to:
- Pool credits at different levels (enterprise, department, or team)
- Track spend/usage at each level
- Report usage rolled up by organizational structure
Customer portal for enterprise
Section titled āCustomer portal for enterpriseāEnterprise customers can manage their subscriptions, view invoices, and analyze usage through the hosted customer portal:
portal_session = lark_client.customer_portal.create_session( subject_id="acme_corp_salesforce_id", return_url="https://yourapp.com/billing",)
# Redirect customer to portal_session.urlTracking usage across the enterprise
Section titled āTracking usage across the enterpriseāFor use-cases beyond the scope of the standard customer portal, you can use pricing metric summaries to provide enterprise customers with detailed usage reports:
usage_summary = lark_client.pricing_metrics.create_summary( pricing_metric_id=api_calls_metric.id, subject_id="enterprise_customer", period_granularity="day", dimensions=["region", "instance_tier"], period={ "start": "2025-01-01", "end": "2025-02-01", },)Best practices
Section titled āBest practicesā-
Use consistent rate codes: When creating custom enterprise rate cards, use the same
codevalues across rate cards. This ensures quantities and discounts carry over when customers upgrade or change plans. -
Version your rate cards: Create new rate card versions for price changes. Lark automatically migrates customers to the latest version.