Upgrade/downgrade a subscription
POST/api/v3/package/:package_id/_action/upgrade
When you want to change how the services one of your customers is billing for, you’ll go through the upgrade/downgrade process.
The upgrade/downgrade process allows you to:
- Change a customer’s product to a different product
- Change the amount a customer is charged each month
- Add or remove products that are charged each month
Example of upgrading a package, changing a specific line item to a different product/service type: When you want to change how the services one of your customers is billing for, you’ll go through the upgrade/downgrade process.
The upgrade/downgrade process allows you to:
- Change a customer’s product to a different product
- Change the amount a customer is charged each month
- Add or remove products that are charged each month
This example shows how to change a customer's subscription to a different product type, AND how to create a prorated invoice for the new amount / credit back the unused portion of the old product to the customer. When you want to change how the services one of your customers is billing for, you’ll go through the upgrade/downgrade process.
The upgrade/downgrade process allows you to:
- Change a customer’s product to a different product
- Change the amount a customer is charged each month
- Add or remove products that are charged each month
This example shows how to add a line item to a customer's subscription AND how to create a prorated invoice for the new amount.
- The
subscribe_prorate_from_datetime
andsubscribe_prorate_to_datetime
fields are optional -- if you don't specify dates, ChargeOver will assume the current date until the end of the current billing cycle - The
subscribe_prorate_cycle
options are:"now"
(generate an invoice for the prorated amount right now) or"next"
(add the prorated charge to the next invoice that will be generated at the end of the billing cycle)
It is also possible to cancel a specific line item on a subscription so that the customer will no longer be billed for it on future invoices.
The example to the right shows how to cancel a line item on a subscription using the line_item_id
of
the line item(s) you want to cancel.
If you cancel all the lines on the subscription, the default behavior is to leave the subscription itself
active (but with no line items). If you want to cancel the subscription itself when all the line items are
cancelled, you can also specify: "cancel_package_if_last_line_item": true
Changing a subscription price is accomplished by going through the upgrade/downgrade REST API call.
The example to the right shows how to change the pricing on a subscription.
Request
- application/json
Body
line_items
object
0
object
tierset
object
tiers
object
0
object
Responses
- 200
- 400
- 401
Action completed successfully
- application/json
- Schema
- Example (from schema)
- Example 1
Schema
{
"code": 0,
"status": "string",
"message": "string",
"details": {},
"response": true
}
{
"code": 200,
"status": "OK",
"message": "",
"details": {},
"response": true
}
Bad request
- application/json
- Schema
- Example (from schema)
- Example 1
Schema
{
"code": 0,
"status": "string",
"message": "string",
"details": {},
"response": true
}
{
"code": 400,
"status": "Error",
"message": "Missing or invalid parameter.",
"details": {},
"response": false
}
Authentication error
- application/json
- Schema
- Example (from schema)
- Example 1
Schema
{
"code": 0,
"status": "string",
"message": "string",
"details": {},
"response": true
}
{
"code": 401,
"status": "Error",
"message": "Invalid or incorrect authorization [Missing (basic) authorization header.]",
"details": {},
"response": false
}