Estimates, as the name implies, can be used to find out the estimate for performing an operation as against performing the operation itself. i.e Say you want to create a new subscription or update an existing one, using the estimate API one can deduce the details like how much money the customer needs to be charged for this operation, when it should be collected, the state the subscription would be in etc. Note:
{
"amount": 895,
"amount_due": 895,
"collect_now": true,
"created_at": 1517506678,
"credits_applied": 0,
"line_items": [
{
"amount": 895,
"date_from": 1517506678,
"date_to": 1519925878,
"description": "No Trial",
"entity_id": "no_trial",
"entity_type": "plan",
"is_taxed": false,
"object": "line_item",
"quantity": 1,
"tax": 0,
"type": "charge",
"unit_amount": 895
}
],
"object": "estimate",
"price_type": "tax_exclusive",
"recurring": true,
"sub_total": 895,
"subscription_status": "active",
"term_ends_at": 1519925878
}Generates an estimate for the 'create subscription' operation. This input will be similar to the Create Subscription API but no subscription will be created, but just an estimate will be generated. Note:
Create a subscription for the existing estimate of a customer.
Generates an estimate for the 'update subscription' operation. The input will be similar to the Update Subscription API but subscription will not be updated, but just an estimate will be generated.
In case 'update subscription' operation will not create an invoice immediately, the estimate generated will be for the 'end of term' invoice. Some of the cases where the invoice will not be generated immediately are
Note:
true: Prorated credits or charges are created as applicable for this change.false: The subscription is changed without creating any credits or charges.For further changes within the same billing term, when prorate is set to true, credits are not created when all the conditions below hold true:
An immediate previous change was made
prorate set to false andThis returns an estimate of the amount that will be charged when the subscription renews. The estimate is calculated based on the items present in the subscription. This includes the plan, addons and coupons(if any) of the subscription. This API is not supported for "Cancelled" subscriptions.
You can also specify whether you need the estimate to include delayed charges.
For "Non Renewing" subscriptions, only delayed charges(one time charges and non renewing addons) that may have been added to the subscription to be charged at the end of the current term will be included. Plan, addons and coupons(if any) of the subscription will not be included.
This API will not generate a renewal invoice if an advance invoice is already present for the subscription.
Generates an estimate for the 'create an invoice' operation. This is similar to the Create an invoice API, but the invoice will not be generated. Only an estimate for this operation is created.