Change subscription order items

Changes subscription order items or quantities, and designates if or when pro-rata credits should be given.

SecurityAPI Key: SecretApiKey or HTTP: JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

query Parameters
expand
string

Expand a response to receive a full related object in the _embedded path.

To expand multiple objects, use a comma-separated list. Example: expand=recentInvoice,initialInvoice.

Available arguments are:

  • customer
  • leadSource
  • website
  • shippingRate
  • initialInvoice
  • recentInvoice
  • upcomingInvoice
  • paymentInstrument

For more information, see Expand to include embedded objects.

Request Body schema: application/json

Change items request.

required
Array of objects non-empty

Details of items in the order.

renewalPolicy
required
string

Specifies if the subscription retains its current renewalTime or resets it to a newly calculated renewalTime.

Enum: "reset" "retain"
prorated
required
boolean

Specifies whether to give a pro rata credit for the amount of time remaining between the effectiveTime and the end of the current period.

In addition, if the renewalTime is retained, by setting the renewalPolicy to retain, a pro rata debit occurs for the amount between the effectiveTime and the renewalTime as a percentage of the normal period size.

effectiveTime
string <date-time>

Date from which the renewal time for reset operations and proration calculations are made. If this field is omitted, this value defaults to the current time.

preview
boolean
Default: false

Specifies if changes to the subscription can be previewed. Subscriptions cannot be changed in preview.

keepTrial
boolean
Default: false

Specifies if the subscription order must retain its active trial. This field is only applicable if renewalPolicy is set to retain.

post
/subscriptions/{id}/change-items
Request samples
application/json
{ "items": [ ], "renewalPolicy": "reset", "prorated": true, "effectiveTime": "2019-08-24T14:15:22Z", "preview": false, "keepTrial": false }
Responses

201

Order changed.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

Response samples
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ ], "_embedded": { "recentInvoice": { }, "initialInvoice": { }, "customer": { }, "website": { }, "leadSource": { }, "shippingRate": { }, "paymentInstrument": { }, "upcomingInvoice": { } } }