Product Structure
Products in Vayu contracts have a specific structure that defines their scheduling, pricing, and metadata. This section details the different valid structures products can have.Basic Product Properties
Every product must have the following required properties:- displayName (string): The display name of the product
- scheduling (object): Defines the billing schedule for the product
- pricing (object): Defines the pricing model for the product
- description (string, nullable): A description of the product
- catalogProductId (string, nullable): Reference to a catalog product
- productErpId (string, nullable): ERP system identifier for the product
Scheduling Structure
Thescheduling
object defines when and how often the product is billed. The first billing schedule starts when the contract starts (unless using the more advanced installments feature).
Properties
- billingDay (integer, required): The day of the month that the product is billed (1-31)
Note: The billing day should almost always start at the contract start date to ensure proper billing alignment and avoid proration issues.
- duration (object, required): The duration of the product
- unit (string, required): Time unit -
DAY
,WEEK
,MONTH
, orYEAR
- value (integer, required): Number of units (0-1000)
- unit (string, required): Time unit -
Pricing Models
Products support multiple pricing models defined in thepricing
object. These are divided into two main categories:
Fixed Products
Fixed products have predetermined pricing that doesn’t depend on usage.1. One-Time Payment
- type:
"ONE_TIME"
- price (number, required): The one-time price (minimum 0)
Note: One-time payment products can only have a scheduling duration of 1 day.
2. Subscription
- type:
"SUBSCRIPTION"
- price (number, required): Price per subscription period (minimum 0)
- subscriptionCadence (object, required): How many times the subscription charges accumulate within the billing period
- unit (string, required): Time unit -
DAY
,WEEK
,MONTH
, orYEAR
- value (integer, required): Number of units (0-1000)
- unit (string, required): Time unit -
3. Contract Terms
- type:
"CONTRACT_TERMS"
- price (number, required): Total contract fee for the lifetime of the contract (minimum 0)
- installments (array, optional): Array of installment objects to split the contract fee
- installmentDate (string, required): ISO 8601 date-time of the installment
- amount (number, required): Amount for this installment (minimum 0)
Usage Products
Usage products have pricing that depends on actual consumption or usage metrics.
Important: Usage products must have a catalogProductId
because that is where the usage metering is defined.
4. Tiered Pricing
Tiered pricing offers different rates or fees based on usage volume.- type:
"TIERED"
- tiers (array, required): Array of pricing tiers
- fromInclusive (number, required): Starting quantity for this tier (minimum 0)
- toExclusive (number, optional): Ending quantity for this tier (null for unlimited)
- rate (number, optional): Rate per unit in this tier (minimum 0)
- flatFee (number, optional): Flat fee for this tier (minimum 0). Defaults to 0 if not specified.
- packageSize (number, optional): Package size for this tier (minimum 0). Defaults to 1 if not specified.
- subscriptionCadence (object, optional): How many times the subscription charges accumulate within the billing period
- autoUpgrade (boolean, optional): Whether to automatically upgrade to higher tiers in the next billing period
- prorate (boolean, optional): Whether to prorate flat fees based on when the user crossed the tier
5. Per-Unit Pricing
Per-unit pricing is a simple pay-as-you-go model where customers are charged based on their actual usage.- type:
"PER_UNIT"
- price (number, required): Price per unit (minimum 0)
- chunkSize (number, required): Number of units per chunk (minimum 0, exclusive)