Sales orders represent the contractual agreement and commitment for services between a seller and a buyer. They act as a seamless interface connecting any sales system (such as CPQ, CRM, or Customer Portal) with Chargebee Billing. The sales order captures the following essential components
{}The unique identifier of the original sales order from which this order was renewed. This field is used to track renewal orders and link them to their previous sales transactions.
Indicates the timestamp at which this sales order was last updated.
Timestamp indicating sales order created.
Buyer's purchase order reference number.
A set of key-value pairs stored as additional information for the subscription. Learn more .
Primary quote id for which the order was placed.
Effective start date of the order signifies when the contract is signed and becomes legally binding.
The date when the order is considered completed, cancelled, or no longer valid.
The unique ID of the business entity of this sales order.
The unique ID of the customer to which this sales order belongs.
The currency code (ISO 4217 format) of the sales order.
The unique identifiers of the subscriptions that are bundled as part of this sales order.
Status of the sales order.
active
completedcompleted
Line items of this sales order
External identifier of the sales order line item.
A reference of line item to associate with other entities like line item tiers.
Defines billing period for the subscription item
Defines billing period unit in association with the billing period.
A period of 24 hours.
weekA period of 7 days.
monthA period of 1 calendar month.
yearA period of 1 calendar year.
The service period of the item in days from the day of charge.
When charge_on_option
option is set to on_event
, this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items.
the time of creation of the subscription.
subscription_trial_startthe time when the trial period of the subscription begins.
plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.
subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.
Indicates if the charge-item is to be charged only once or each time the charge_on_event
occurs. This parameter only applies to charge-items.
Number of billing cycles for which this line item remains valid.
Billing type of the item.
Item gets billed at regular intervals
one_timeItem gets billed once
event_basedItem gets billed on specific events
End date of the line item.
The date/time when the trial period of the item ends.
Billing address for a customer.
The first name of the billing contact.
The last name of the billing contact.
The ISO 3166-2 state/province code
without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code .
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom - Northern Ireland) is available as an option.
Zip or postal code. The number of characters is validated according to the rules specified here .
The address verification status.
Address is not yet validated.
validAddress was validated successfully.
partially_validThe address is valid for taxability but has not been validated for shipping.
invalidAddress is invalid.
List of discounts for this subscription
An immutable code for the discount. It is always auto-generated.
The name of the discount as it should appear on customer-facing pages and documents such as invoices
and hosted pages.
This is auto-generated based on the type
, amount
, and currency_code
of the discount. For example, it can be 10% off
or 10$ off
.
The type of discount. Possible value are:
The specified amount will be given as discount.
percentageThe specified percentage will be given as discount.
offer_quantityThe amount on the invoice to which the discount is applied.
The discount is applied to the invoice sub_total
.
The discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
Specifies the time duration for which this discount is attached to the subscription.
The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.
foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed .
limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
.
The percentage of the original amount that should be deducted from it. Only applicable when discount.type
is percentage.
The value of the discount. The format of this value
depends on the kind of currency. This is only applicable when discount.type
is fixed_amount.
ID/code of the coupon to be applied.
The duration of time for which the discount is attached to the subscription, in period_units.
Applicable only when duration_type
is limited_period.
The unit of time for period.
Applicable only when duration_type
is limited_period.
A period of 24 hours.
weekA period of 7 days.
monthA period of 1 calendar month.
yearA period of 1 calendar year.
The id of the item price
in the subscription to which the discount is to be applied. Relevant only when apply_on
= specific_item_price.
End date of the discount.
Shipping address for the subscription.
The first name of the contact.
The last name of the contact.
The ISO 3166-2 state/province code
without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code .
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom - Northern Ireland) is available as an option.
Zip or postal code. The number of characters is validated according to the rules specified here .
The address verification status.
Address is not yet validated.
validAddress was validated successfully.
partially_validThe address is valid for taxability but has not been validated for shipping.
invalidAddress is invalid.
The pricing details of line_items
which have pricing_model
as tiered
, volume
or stairstep.
Learn more
about pricing models.
The highest value in the quantity tier.
The per-unit price for the tier when the pricing_model
is tiered
or volume.
The total cost for the item price when the pricing_model
is stairstep.
The value is in the minor unit of the currency.
Pricing type for the tier.
Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).
flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep
pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.
Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Package size for the tier when pricing type is package.
Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
Association id of line item tho whom this line item tiers belongs.
Payment configuration of this sales order
Auto collection status.
on
offoff
Identifier of the payment source for which this transaction is made
Identifier for PaymentIntent generated by Chargebee.js. Applicable only when you are using Chargebee.js for completing the 3DS flow. The PaymentIntent should be in 'authorized' state while passing it here. You need not pass other PaymentIntent parameters if this is passed.
The preferred offline payment method for the sales order.
No Preference
cashCash
checkCheck
bank_transferBank Transfer
Configurations controlling billing behavior and invoice generation workflows.
Indicates if pending invoices should be created.
Indicates whether the invoices for this order are generated with a pending status.This attribute is set to true automatically when the subscription has item prices that belong to metered items.
Indicates if you want to bill the usages from the previous billing cycle. This creates a pending invoice immediately on subscription creation.
Setting this attribute to true would invoice the overages for the metered item during subscription changes
The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date.
The number of billing cycles to be invoiced in advance for this order. If not specified, the invoice will be generated for the first billing cycle by default.
Override the billing alignment mode for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site.
Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..
delayedSubscription period will be aligned with the configured billing date at the next renewal.
Renewal term for this sales order.
The action at end of contract term
renewal_billing_cycles.end_of_term_action for the new contract term is set to renew.Contract term completes and subscription is canceled.
evergreenContract term completes and the subscription renews.
The number of days before contract_end, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure.
Specifies the number of billing cycles for which the contract will be renewed.
The unique identifier of the original sales order from which this order was renewed. This field is used to track renewal orders and link them to their previous sales transactions.
Indicates the timestamp at which this sales order was last updated.
Timestamp indicating sales order created.
Buyer's purchase order reference number.
A set of key-value pairs stored as additional information for the subscription. Learn more .
Primary quote id for which the order was placed.
Effective start date of the order signifies when the contract is signed and becomes legally binding.
The date when the order is considered completed, cancelled, or no longer valid.
The unique ID of the business entity of this sales order.
The unique ID of the customer to which this sales order belongs.
The currency code (ISO 4217 format) of the sales order.
The unique identifiers of the subscriptions that are bundled as part of this sales order.
Status of the sales order.
active
completedcompleted
Billing address for a customer.
List of discounts for this subscription
Shipping address for the subscription.
The pricing details of line_items
which have pricing_model
as tiered
, volume
or stairstep.
Learn more
about pricing models.
Payment configuration of this sales order
Configurations controlling billing behavior and invoice generation workflows.