Skip to main content

Tutorial: Apply contract rules

This tutorial provides a step-by-step analysis for distributor/reseller users to understand the Application order of billing rules, price books, and custom line items during the data recalculation of an end customer.

Contracts setup

Tier-1 contract

The Tier-1 contract defines a billing rule that excludes the following charge categories: DistributorDiscount, EdpDiscount, Tax, SppDiscount.

Tier-1 contract - billing rule

Tier-2 contract

In this tutorial there is no Tier-2 contract, meaning no specific pricing and service agreements for the reseller.

Tier-3 contract

A Tier-3 contract is created for an end customer called Demo Customer. This contract defines one price book and two custom line items for all management accounts of the end customer.

The price book defines four rules:

  • Rule 1: 7% discount. Does not include credits in the calculation. Condition: Service is Amazon Elastic Compute Cloud. Stored as a separate line item.

  • Rule 2: 3% discount. Does not include credits in the calculation. Condition: Service is Amazon Relational Database Service.

  • Rule 3: Fixed rate, $0.01. Condition: SKU Meter is TimedStorage-SIA-ByteHrs AND Service is Amazon Simple Storage Service.

  • Rule 4: Fixed rate, $0.01. Condition: SKU Meter is CAN1-TimedStorage-SIA-ByteHrs AND Service is Amazon Simple Storage Service.

Tier-3 contract - price book

Recalculation process

Step 1: Apply Tier-1 billing rules

This step is visible only to Distributor users.

In the report below:

  • Billed Cost: The raw payer data.

  • Resold Cost: The amount the distributor charges the reseller, after applying the billing rule to exclude the charge categories DistributorDiscount, EdpDiscount, Tax, and SppDiscount.

Resold Cost starts at Billed Cost. Each excluded row’s amount is subtracted from the running total. Credits appear as negative amounts in the report, so excluding a credit subtracts a negative value and increases Resold Cost.

In this example: $98,171.26 − (-$8,098.17) − $11,297.74 = $94,971.70

Contract rule application - Tier-1 billing rule

Step 2: Apply Tier-3 price book

Each rule is applied based on the result of the previous rule.

Because Rule 1 doesn't include credits, the EC2 Credit row is excluded from the discount base.

Contract rule application - Tier-3 base cost

Applying the 7% discount: $52,962.04 × 7% = $3,707.34. The result is stored as a separate line item.

Contract rule application - Price book rule 1

Running total: $94,971.70$3,707.34 = $91,264.36.

Step 3: Apply Tier-3 custom line items

Custom line items run sequentially, in the order configured.

Applies a flat $100 fixed-rate charge and is stored as a separate line item Service Fee for Platform usage.

Running total: $90,807.45 + $100 = $90,907.45.

Final invoice total

StepChangeRunning total
List price (raw payer)-$98,171.26
T1 BR (cost-type filter)-$3,199.56$94,971.70
PB · EC2 7% (separate line)-$3,707.34$91,264.36
PB · RDS 3% (in-line)-$290.97$90,973.39
PB · TimedStorage-SIA $0.01-$14.47$90,958.92
PB · CAN1-TimedStorage-SIA $0.01-$151.47$90,807.45
CLI · Service Fee+$100.00$90,907.45
CLI · VAT 17%+$15,004.39$105,911.84