ChargebeeAPI

Estimate for creating a subscription

Try in API Explorer

Generates an estimate without creating a subscription. This endpoint can be called when you want to preview details of a new subscription before actually creating one.

The following conditions must be met or tax calculation is ignored:

  • The taxability attribute for the customer is true.
  • shipping_address is passed when needed for tax calculation.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/customers/{customer-id}/create_subscription_for_items_estimate

Input Parameters

use_existing_balances
optional, boolean, default=true

The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter use_existing_balances .

invoice_immediately
optional, boolean

If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings .

Note: invoice_immediately only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.

.

billing_cycles
optional, integer, min=0

The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan-item price is used.

mandatory_items_to_remove
optional, string

Item ids of mandatorily attached addons that are to be removed from the subscription.

terms_to_charge
optional, integer, min=1

The number of subscription billing cycles (including the first one) to invoice in advance .

billing_alignment_mode
optional, enumerated string

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.

Possible Enum Values
immediate

Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..

delayed

Subscription period will be aligned with the configured billing date at the next renewal.

invoice_date
optional, timestamp(UTC) in seconds

The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. taxes and line_item_taxes are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.

coupon_ids
optional, string

List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.

subscription
optional, string

Parameters for subscription

shipping_address
optional, string

Parameters for shipping_address

billing_address
optional, string

Parameters for billing_address

contract_term
optional, enumerated string

Parameters for contract_term

billing_override
optional, long

Parameters for billing_override

subscription_items
optional, string

Parameters for subscription_items

discounts
optional, enumerated string

Parameters for discounts

item_tiers
optional, string

Parameters for item_tiers

Returns

estimateEstimate object

Resource object representing estimate