Change subscription items
Experimental

Request

Creates a quote for requested changes to items and quantities. This operation applies the requested changes to the subscription when the quote is accepted.

Security
CustomerJWT
Path
idstring, <= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/jsonrequired

Change items request.

effectiveTimestring

Effective time when changes are applied.

Default:"now"
Enum ValueDescription
now

Apply changes immediately.

next-service-period

Apply changes at the beginning of next service period.

auto

Apply changes at the beginning of next service period in case of a downgrade, and immediately in case of an upgrade.

itemsArray of objects, non-empty

Details of items in the subscription.

previewboolean

Specifies if the quote must be previewed before it is created. Subscriptions cannot be changed in the preview.

Default:false
Example:true
keepTrialboolean

Specifies whether an active trial remains in the trial state or is upgraded to a paid subscription. If this field is set to false, the trial is converted to a paid subscription.

Note: This field applies only to subscriptions that are currently in trial.

Default:true
Example:true
autopayboolean

Specifies if payment attempts for the related subscription are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default:false
Example:true
includeNextPeriodboolean

Specifies if next service period amount must be included in the quote. This is applicable only for trial-only active subscriptions.

Default:true
Example:true
curl -i -X POST \
  'https://www.rebilly.com/_mock/catalog/all/storefront/subscriptions/{id}/change-items' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "effectiveTime": "now",
    "items": [
      {
        "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
        "quantity": 0,
        "quantityFilled": 5.125,
        "usageLimits": {
          "softLimit": {
            "quantity": 0
          },
          "hardLimit": {
            "quantity": 0
          },
          "trialLimit": 20.725
        }
      }
    ],
    "preview": true,
    "keepTrial": true,
    "autopay": true,
    "includeNextPeriod": true
  }'

Responses

Quote for requested changes to items and quantities is created and issued.

Headers
Locationstring, (uri)

Location of the related resource.

Example:"https://api.rebilly.com/example"
X-RateLimit-Limitinteger

Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.

Example:3600
X-RateLimit-Remaininginteger

Remaining number of rate limit tokens for this request within the rate limit period. For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.

Example:3600
Bodyapplication/json
idstring, <= 50 charactersread-only

ID of the quote.

Example:"qt_01HXBZMEGPETPHJZH6V4RHBMA8"
typestring

Type of the quote. When a quote is accepted, quote items and settings are applied to the related order. Change quotes can only be created for orders with active or trial-ended status. For trial-ended orders, use this quote type to convert a trial-only order to a regular recurring order.

Value:"change"
Example:"change"
acceptanceFulfillmentArray of objectsread-only

List of acceptanceConditions with fulfillment status.

invoiceIdstring, <= 50 charactersread-only

ID of the payment invoice.

Example:"in_0YVF9605RKC62BP14NE2R7V2XT"
statusstringread-only

Status of the quote.

Enum ValueDescription
draft

Quote can be edited. This quote cannot be sent to a customer.

issued

Quote cannot be edited. This quote can be sent to a customer.

accepted

Customer accepted the quote. Quote items and settings are applied to the order.

rejected

Customer rejected the quote.

canceled

Organization or customer canceled the quote.

expired

Expired before customer or organization interaction.

websiteIdstring, <= 50 characters(WebsiteId)

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

Example:"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"
customerIdstring, <= 50 characters(CustomerId)

ID of the customer resource.

Example:"cus_0YV7DDSDD1C8DA64KHH2W33CPF"
orderobject

Properties of the related order.

invoicePreviewobjectread-only

Preview of the quote invoices.

paymentTermsstring

Payment terms for the customer which are displayed on the quote.

expirationTimestring or null, (date-time)

Date and time when the quote expires. The default expiration time is one month from the time the quote is issued. In a draft state, this field may be null.

issuedTimestring or null, (date-time)read-only

Date and time when the quote is issued.

acceptedTimestring or null, (date-time)read-only

Date and time when the quote is accepted.

rejectedTimestring or null, (date-time)read-only

Date and time when the quote is rejected.

canceledTimestring or null, (date-time)read-only

Date and time when the quote is canceled.

createdTimestring, (date-time)(CreatedTime)read-only

Date and time when the resource is created. This value is set automatically when the resource is created.

updatedTimestring, (date-time)(UpdatedTime)read-only

Date and time when the resource is updated. This value is set automatically when the resource is updated.

redirectUrlstring, (uri), <= 2083 characters

URL to redirect the customer to when a quote is rejected. The default value is the website URL.

signatureobject

Written signature and printed organization name.

taxobject(Taxes)
_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
{ "id": "qt_01HXBZMEGPETPHJZH6V4RHBMA8", "type": "change", "acceptanceFulfillment": [ {} ], "invoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "status": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "order": { "id": "ord_01HVKA5975PJBSQ1SX72G3MSZC", "items": [], "renewalPolicy": "resetToRecurring", "prorated": true, "effectiveTime": "2019-08-24T14:15:22Z", "keepTrial": false, "interimOnly": true, "usageSettings": [], "autopay": true, "shipping": {}, "deliveryAddress": {}, "billingAddress": {} }, "invoicePreview": { "currency": "USD", "initialAmounts": {}, "recurringAmounts": {}, "items": [] }, "paymentTerms": "string", "expirationTime": "2019-08-24T14:15:22Z", "issuedTime": "2019-08-24T14:15:22Z", "acceptedTime": "2019-08-24T14:15:22Z", "rejectedTime": "2019-08-24T14:15:22Z", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "redirectUrl": "http://example.com", "signature": { "showWrittenSignatureLines": false, "organizationPrintedName": null }, "tax": { "calculator": "manual", "amount": 0.1, "items": [] }, "_links": [ {} ], "_embedded": { "customer": {}, "creditMemos": [], "website": {}, "order": {}, "invoice": {} } }