POST /purchases/estimate
Deprecated
The purchase
resource and its associated operations on this page are deprecated. Avoid using them in your integrations. The ability to purchase multiple plans in a single subscription will be supported through the Subscriptions API in the future.
Returns an estimate for creating a purchase
resource. The operation works exactly like Create a purchase, except that only an estimate resource is returned without an actual purchase
resource being created.
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
Request headers
Name | Type | Required | Description |
---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Possible values:
|
chargebee-business-entity-id |
String | No |
If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation. |
chargebee-event-actions |
String | No |
skip all actions to be done on the events Possible values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header |
chargebee-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
client_profile_id |
String | No |
Indicates the Client profile id for the customer. This is applicable only if you use Chargebee's AvaTax for Communications integration. |
customer_id |
String | No |
The unique identifier of the customer that made this purchase. |
discounts |
Object | No |
Parameters for discounts |
discounts.included_in_mrr[] |
Array | No |
For manual discounts, set this to
See also: Applying discounts |
discounts.percentage[] |
Array | No |
The percentage of the discount. Applicable only for manual discounts. For any given array index Applying discounts |
discounts.amount[] |
Array | No |
The absolute value of the discount. The currency units in which this value is expressed depends on the type of currency. Applicable only for manual discounts. For any given array index Applying discounts |
discounts.coupon_id[] |
Array | No |
The unique ID of a coupon to be applied to the group. Alternatively, you may provide a coupon code. Applicable only for . Applying discounts |
discounts.index[] |
Array | No |
The index or identifier of the group to which this discount or coupon information belongs. This must be a value from the Applying discounts |
customer |
Object | No |
Parameters for customer |
customer.taxability |
String | No |
Specifies if the customer is liable for tax * exempt -
* taxable - Computes tax for the customer based on the site configuration. In some cases, depending on the region, shipping_address is needed. If not provided, then billing_address is used to compute tax. If that's not available either, the tax is taken as zero. Possible values:
Default value: "taxable" |
customer.entity_code |
String | No |
The exemption category of the customer, for USA and Canada. Applicable if you use Chargebee's AvaTax for Sales integration. * med2 - US Medical Device Excise Tax with taxable sales tax * med1 - US Medical Device Excise Tax with exempt sales tax * b - State government * c - Tribe/Status Indian/Indian Band * a - Federal government * f - Religious organization * g - Resale * d - Foreign diplomat * e - Charitable or benevolent organization * j - Direct pay permit * k - Direct mail * h - Commercial agricultural production * i - Industrial production/manufacturer * n - Local government * l - Other or custom * m - Educational organization * r - Non-resident * p - Commercial aquaculture * q - Commercial Fishery Possible values:
|
customer.exempt_number |
String | No |
Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable if you use Chargebee's AvaTax for Sales integration. |
customer.vat_number_prefix |
String | No |
An overridden value for the first two characters of the full VAT
number. Only applicable specifically for customers with billing_address When you have enabled EU VAT in 2021 or have manually
enabled the Brexit configuration, you have the option of setting billing_address |
customer.exemption_details[] |
Array | No |
Indicates the exemption information. You can customize customer exemption based on specific Location, Tax level (Federal, State, County and Local), Category of Tax or specific Tax Name. This is applicable only if you use Chargebee's AvaTax for Communications integration. |
customer.customer_type |
String | No |
Indicates the type of the customer. This is applicable only if you use Chargebee's AvaTax for Communications integration. * business - When the purchase is made at a place of business * residential - When the purchase is made by a customer for home use * industrial - When the purchase is made by an industrial business * senior_citizen - When the purchase is made by a customer who meets the jurisdiction requirements to be considered a senior citizen and qualifies for senior citizen tax breaks Possible values:
|
customer.vat_number |
String | No |
VAT number of this customer. If not provided then taxes are not calculated for the estimate. Applicable only when taxes are configured for the EU or UK region. VAT validation is not done for this. |
customer.registered_for_gst |
Boolean | No |
Confirms that a customer is registered under GST. If set to |
subscription_info |
Object | No |
Parameters for subscription_info |
subscription_info.index[] |
Array | Yes |
The index or identifier of the group to which this subscription information belongs. This must be a value from the |
subscription_info.contract_term_billing_cycle_on_renewal[] |
Array | No |
Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as |
subscription_info.subscription_id[] |
Array | No |
When specifying a subscription group, this is the unique identifier of the subscription to be created. This value must be unique for each subscription group. |
subscription_info.billing_cycles[] |
Array | No |
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. |
item_tiers |
Object | No |
Parameters for item_tiers |
item_tiers.starting_unit_in_decimal[] |
Array | No |
The decimal representation of the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as |
item_tiers.price_in_decimal[] |
Array | No |
The decimal representation of the per-unit price for the tier when the |
item_tiers.price[] |
Array | No |
The per-unit price for the tier when the |
item_tiers.ending_unit[] |
Array | No |
The highest value of quantity in this tier. For all other tiers,it must be equal to the |
item_tiers.item_price_id[] |
Array | No |
The unique ID of the item price to which this tier information belongs. This must be a value from the |
item_tiers.index[] |
Array | Yes |
The index or identifier of the group to which this tier information belongs. This must be a value from the |
item_tiers.starting_unit[] |
Array | No |
The lowest value of quantity in this tier; this is zero for the lowest tier. For all other tiers, it is the same as |
item_tiers.ending_unit_in_decimal[] |
Array | No |
The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the |
purchase_items |
Object | No |
Parameters for purchase_items |
purchase_items.unit_amount[] |
Array | No |
The price or per unit price of the item. You may provide this only when price overriding is enabled for the site. |
purchase_items.item_price_id[] |
Array | Yes |
The unique identifier of the item price to be added to the group. |
purchase_items.quantity[] |
Array | No |
The quantity of the item price. Applicable only when the pricing model of the item price is anything other than |
purchase_items.quantity_in_decimal[] |
Array | No |
The decimal representation of the quantity of the item purchased. By default multi-decimal pricing is enabled for purchase API, it is recommended to use the |
purchase_items.index[] |
Array | Yes |
The index or identifier of the group to which the item price belongs. The item prices assigned the same index belong to the same group. |
purchase_items.unit_amount_in_decimal[] |
Array | No |
The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when multi-decimal pricing is enabled. |
shipping_addresses |
Object | No |
Parameters for shipping_addresses |
shipping_addresses.first_name[] |
Array | No |
The first name of the contact. This parameter is |
shipping_addresses.state[] |
Array | No |
The state/province name. |
shipping_addresses.city[] |
Array | No |
The name of the city. This parameter is |
shipping_addresses.validation_status[] |
Array | No | |
shipping_addresses.line2[] |
Array | No |
Address line 2 |
shipping_addresses.line1[] |
Array | No |
Address line 1. This parameter is |
shipping_addresses.email[] |
Array | No |
The email address. |
shipping_addresses.last_name[] |
Array | No |
The last name of the contact. This parameter is |
shipping_addresses.company[] |
Array | No |
The company name. |
shipping_addresses.line3[] |
Array | No |
Address line 3 |
shipping_addresses.state_code[] |
Array | No |
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set |
shipping_addresses.zip[] |
Array | No |
Zip or postal code. The number of characters is validated according to the rules specified here. This parameter is |
shipping_addresses.phone[] |
Array | No |
The phone number. |
shipping_addresses.country[] |
Array | No |
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code. This parameter is 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 |
contract_terms |
Object | No |
Parameters for contract_terms |
contract_terms.action_at_term_end[] |
Array | No | |
contract_terms.index[] |
Array | Yes |
The index number of the subscription/one-time group to which the item price is added. Provide a unique number between |
contract_terms.cancellation_cutoff_period[] |
Array | No |
The number of days before |
billing_address |
Object | No |
Parameters for billing_address |
billing_address.line2 |
String | No |
Address line 2 |
billing_address.line1 |
String | No |
Address line 1 |
billing_address.line3 |
String | No |
Address line 3 |
billing_address.state_code |
String | No |
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set |
billing_address.zip |
String | No |
Zip or postal code. The number of characters is validated according to the rules specified here. |
billing_address.country |
String | No |
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 |
billing_address.city |
String | No |
The name of the city. |
billing_address.validation_status |
String | No |
The address verification status. * valid - Address was validated successfully. * partially_valid - The address is valid for taxability but has not been validated for shipping. * invalid - Address is invalid. * not_validated - Address is not yet validated. Possible values:
Default value: "not_validated" |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.