Pick the Preview Subscription Change action (under subscription_change).
Fill in the fields below, then reference the result from later steps as {{previewSubscriptionChange.response.data}}.
Request
Path parameters
subscription_idstringrequired
Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
Request body
Enter the body as JSON in the step's Body field.
timeframestring
The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`.
One ofbill_datenowrenewalterm_endDefault "now"
plan_idstring
If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
plan_codestring
If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
business_entity_idstring
The `business_entity_id` is the value that represents a specific business entity for an end customer. When `business_entity_id` is used to assign a business entity to the subscription, all future billing events for the subscription will bill to the specified business entity. Available when the `Multiple Business Entities` feature is enabled. If both `business_entity_id` and `business_entity_code` are present, `business_entity_id` will be used. Only allowed if the `timeframe` is not `now`.
business_entity_codestring
The `business_entity_code` is the value that represents a specific business entity for an end customer. When `business_entity_code` is used to assign a business entity to the subscription, all future billing events for the subscription will bill to the specified business entity. Available when the `Multiple Business Entities` feature is enabled. If both `business_entity_id` and `business_entity_code` are present, `business_entity_id` will be used. Only allowed if the `timeframe` is not `now`.
price_segment_idstring
The price segment ID, e.g. `e28zov4fw0v2`.
unit_amountnumber (float)
Optionally, sets custom pricing for the subscription, overriding the plan's default unit amount. The subscription's current currency will be used.
tax_inclusiveboolean
This field is deprecated. Please do not use it.
Default false
quantityinteger
Optionally override the default quantity of 1.
Default 1
shippingobject
Shipping addresses are tied to a customer's account. Each account can have up to 20 different shipping addresses, and if you have enabled multiple subscriptions per account, you can associate different shipping addresses to each subscription.
method_idstring
The id of the shipping method used to deliver the subscription. To remove shipping set this to `null` and the `amount=0`. If `method_id` and `method_code` are both present, `method_id` will be used.
method_codestring
The code of the shipping method used to deliver the subscription. To remove shipping set this to `null` and the `amount=0`. If `method_id` and `method_code` are both present, `method_id` will be used.
amountnumber (float)
address_idstring
Assign a shipping address from the account's existing shipping addresses. If this and address are both present, address will take precedence.
addressobject14 fields
coupon_codesarray<string>
A list of coupon_codes to be redeemed on the subscription during the change. Only allowed if timeframe is now and you change something about the subscription that creates an invoice.
add_onsarray<object>
If you provide a value for this field it will replace any
existing add-ons. So, when adding or modifying an add-on, you need to
include the existing subscription add-ons. Unchanged add-ons can be included
just using the subscription add-on''s ID: `{"id": "abc123"}`. If this
value is omitted your existing add-ons will be unaffected. To remove all
existing add-ons, this value should be an empty array.'
If a subscription add-on's `code` is supplied without the `id`,
`{"code": "def456"}`, the subscription add-on attributes will be set to the
current values of the plan add-on unless provided in the request.
- If an `id` is passed, any attributes not passed in will pull from the
existing subscription add-on
- If a `code` is passed, any attributes not passed in will pull from the
current values of the plan add-on
- Attributes passed in as part of the request will override either of the
above scenarios
idstring
When an id is provided, the existing subscription add-on attributes will
persist unless overridden in the request.
codestring
If a code is provided without an id, the subscription add-on attributes
will be set to the current value for those attributes on the plan add-on
unless provided in the request. If `add_on_source` is set to `plan_add_on`
or left blank, then plan's add-on `code` should be used. If `add_on_source`
is set to `item`, then the `code` from the associated item should be used.
add_on_sourcestring
Used to determine where the associated add-on data is pulled from. If this value is set to
`plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
`plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
the associated add-on data will be pulled from the site's item catalog.
One ofplan_add_onitemDefault "plan_add_on"
quantityinteger
unit_amountnumber (float)
Allows up to 2 decimal places. Optionally, override the add-on's default unit amount.
If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
unit_amount_decimalstring
Allows up to 9 decimal places. Optionally, override the add-on's default unit amount.
If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided.
If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
tiersarray<object>4 fields
If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount`.
There must be one tier without an `ending_quantity` value which represents the final tier.
percentage_tiersarray<object>2 fields
If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the
final tier. This feature is currently in development and requires approval and enablement, please contact support.
usage_percentagenumber (float)
The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
revenue_schedule_typestring
One ofat_range_endat_range_startevenlynever
collection_methodstring
One ofautomaticmanualDefault "automatic"
revenue_schedule_typestring
One ofat_range_endat_range_startevenlynever
custom_fieldsarray<object>
The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
namestringrequired
Fields must be created in the UI before values can be assigned to them.
valuestringrequired
Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
source_record_typestring
The type of record a custom field was automatically copied from.
One ofaccountplanproductsubscription
source_record_idstring
The UUID of the record this custom field was automatically copied from. Only present when the field was copied from another record.
po_numberstring
For manual invoicing, this identifies the PO number associated with the subscription.
net_termsinteger
Integer normally paired with `Net Terms Type` and representing the number of days past
the current date (for `net` Net Terms Type) or days after the last day of the current
month (for `eom` Net Terms Type) that the invoice will become past due. During a subscription
change, it's not necessary to provide both the `Net Terms Type` and `Net Terms` parameters.
For more information on how net terms work with `manual` collection visit our docs page (https://docs.recurly.com/docs/manual-payments#section-collection-terms)
or visit (https://docs.recurly.com/docs/automatic-invoicing-terms#section-collection-terms) for information about net terms using `automatic` collection.
Default 0
net_terms_typestring
Optionally supplied string that may be either `net` or `eom` (end-of-month).
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.
One ofneteomDefault "net"
transaction_typestring
An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
One ofmoto
billing_infoany
ramp_intervalsarray<object>
The new set of ramp intervals for the subscription.
starting_billing_cycleinteger
Represents the billing cycle where a ramp interval starts.
Default 1
unit_amountnumber (float)
Represents the price for the ramp interval.
proration_settingsobject
Allows you to control how any resulting charges and credits will be calculated and prorated.
chargestring
Determines how the amount charged is determined for this change
One offull_amountprorated_amountnoneDefault "prorated_amount"
creditstring
Determines how the amount credited is determined for this change
One offull_amountprorated_amountnoneDefault "prorated_amount"
next_bill_datestring (date-time)
If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). When combined with proration_settings, proration calculation should occur, only supported when timeframe is now.
Returns 200 with an object. Read it in later steps with {{previewSubscriptionChange.response.data.<field>}}.
idstring
The ID of the Subscription Change.
objectstring
subscription_idstring
The ID of the subscription that is going to be changed.
planobject
Just the important parts.
idstring
objectstring
codestring
Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
namestring
This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
add_onsarray<object>
These add-ons will be used when the subscription renews.
idstring
objectstring
subscription_idstring
add_onobject11 fields
Just the important parts.
add_on_sourcestring
Used to determine where the associated add-on data is pulled from. If this value is set to
`plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
`plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
the associated add-on data will be pulled from the site's item catalog.
One ofplan_add_onitemDefault "plan_add_on"
quantityinteger
unit_amountnumber (float)
Supports up to 2 decimal places.
unit_amount_decimalstring (decimal)
Supports up to 9 decimal places.
revenue_schedule_typestring
One ofat_range_endat_range_startevenlynever
tier_typestring
The pricing model for the add-on. For more information,
[click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our
[Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how
to configure quantity-based pricing models.
One offlattieredstairstepvolumeDefault "flat"
usage_calculation_typestring
The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used.
One ofcumulativelast_in_period
usage_timeframestring
The time at which usage totals are reset for billing purposes.
One ofbilling_periodsubscription_termDefault "billing_period"
tiersarray<object>4 fields
If tiers are provided in the request, all existing tiers on the Subscription Add-on will be
removed and replaced by the tiers in the request. If add_on.tier_type is tiered or volume and
add_on.usage_type is percentage use percentage_tiers instead.
There must be one tier without an `ending_quantity` value which represents the final tier.
percentage_tiersarray<object>2 fields
If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the final tier.
This feature is currently in development and requires approval and enablement, please contact support.
usage_percentagenumber (float)
The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
created_atstring (date-time)
updated_atstring (date-time)
expired_atstring (date-time)
unit_amountnumber (float)
tax_inclusiveboolean
This field is deprecated. Please do not use it.
Default false
quantityinteger
shippingobject
objectstring
addressobject19 fields
methodobject4 fields
amountnumber (float)
activate_atstring (date-time)
activatedboolean
Returns `true` if the subscription change is activated.
revenue_schedule_typestring
One ofat_range_endat_range_startevenlynever
invoice_collectionobject
objectstring
charge_invoiceobject40 fields
credit_invoicesarray<object>40 fields
verification_transactionsarray<object>40 fields
Verification transactions (used for free trial payment method validation)
business_entityobject
Business entity details
idstring
objectstring
codestring
The entity code of the business entity.
namestring
This name describes your business entity and will appear on the invoice.
custom_fieldsarray<object>
The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
namestringrequired
Fields must be created in the UI before values can be assigned to them.
valuestringrequired
Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
source_record_typestring
The type of record a custom field was automatically copied from.
One ofaccountplanproductsubscription
source_record_idstring
The UUID of the record this custom field was automatically copied from. Only present when the field was copied from another record.
created_atstring (date-time)
updated_atstring (date-time)
deleted_atstring (date-time)
billing_infoobject
Accept nested attributes for three_d_secure_action_result_token_id
three_d_secure_action_result_token_idstring
A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
ramp_intervalsarray<object>
The ramp intervals representing the pricing schedule for the subscription.
starting_billing_cycleinteger
Represents the billing cycle where a ramp interval starts.
remaining_billing_cyclesinteger
Represents how many billing cycles are left in a ramp interval.
starting_onstring (date-time)
ending_onstring (date-time)
unit_amountnumber (float)
Represents the price for the ramp interval.
next_bill_datestring (date-time)
If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). When combined with proration_settings, proration calculation should occur, only supported when timeframe is now.