This documentation site is deprecated. The latest up-to-date API reference is available at https://reference.chargify.com.
This site will remain available for historical reference until June 1, 2017

API: Renewal Preview

Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal.

URIs

Resource/URI POST
/subscriptions/<subscription_id>/renewals/preview Create new renewal preview

Input Attributes

The Chargify API allows you to preview a renewal by posting JSON or XML that includes:

  • subscription_id: Integer, the id for the subscription that is to be previewed.

Methods

format may be either ‘xml’ or ‘json’.

Create/Request

URL: https://<subdomain>.chargify.com/subscriptions/<subscription_id>/renewals/preview.json
Method: POST (with no side effects)
Required Parameters: susbcription_id
Response: A renewal preview object

Output


{
	"renewal_preview": {
		"next_assessment_at": "2016-10-04T14:00:00-04:00",
		"subtotal_in_cents": 8499,
		"total_tax_in_cents": 0,
		"total_discount_in_cents": 0,
		"total_in_cents": 8499,
		"existing_balance_in_cents": 15530,
		"total_amount_due_in_cents": 24029,
		"uncalculated_taxes": false,
		"line_items": [{
			"transaction_type": "charge",
			"kind": "baseline",
			"amount_in_cents": 3999,
			"memo": "Initial Fee without Trial (10/04/2016 - 10/05/2016)",
			"discount_amount_in_cents": 0,
			"taxable_amount_in_cents": 0
		}, {
			"transaction_type": "charge",
			"kind": "on_off_component",
			"amount_in_cents": 4500,
			"memo": "$45 component",
			"discount_amount_in_cents": 0,
			"taxable_amount_in_cents": 0
		}]
	}
}

An array of allocation objects with the following fields:

next_assessment_at The timestamp for the subscription’s next renewal
existing_balance_in_cents An integer representing the amount of the subscription’s current balance
subtotal_in_cents An integer representing the amount of the total pre-tax, pre-discount charges that will be assessed at the next renewal
total_discount_in_cents An integer representing the amount of the coupon discounts that will be applied to the next renewal
total_tax_in_cents An integer representing the total tax charges that will be assessed at the next renewal
total_in_cents An integer representing the total amount owed, less any discounts, that will be assessed at the next renewal
total_amount_due_in_cents An integer representing the existing_balance_in_cents plus the total_in_cents
uncalculated_taxes A boolean indicating whether or not additional taxes will be calculated at the time of renewal. This will be true if you are using Avalara and the address of the subscription is in one of your defined taxable regions.
line_items An array of objects representing the individual transactions that will be created at the next renewal