Retrieve order changes

Request

Retrieves a list of order changes. To find the pending change of an order, use filter=orderId:{orderId};status:pending.

Security
SecretApiKey or JWT
Query
limitinteger, [ 0 .. 1000 ]

Limit the number of collection items to be returned. Use 0 to return an empty collection and still receive the count of matching items in Pagination-Total.

offsetinteger, [ 0 .. 1000 ]

Specifies the starting point within the collection of items to be returned.

filterstring

Criteria for filtering collection items. This field requires a special format. Use , to specify multiple allowed values. Use ; to specify multiple fields.

For more information, see Search filters.

sortArray of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -. Multiple fields can be sorted by separating each with ,.

curl -i -X GET \
  'https://www.rebilly.com/_mock/catalog/all/order-changes?limit=0&offset=0&filter=string&sort=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'

Responses

List of order changes retrieved.

Headers
Pagination-Totalinteger

Total number of items that match the request. The value is independent of limit, including when limit is 0.

Example:332
Pagination-Limitinteger

Maximum number of items per page.

Example:100
Pagination-Offsetinteger

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

Example:2
Bodyapplication/json
Array [
idstring, <= 50 charactersread-only

ID of the order change.

Example:"ord_chg_0YV7DES3WPC5J8JD8QTVNZBZQ8"
orderIdstring, <= 50 charactersrequired

ID of the order.

Example:"ord_01HRF27SATGE4Z6PBJE6PD8328"
statusstringread-only

Status of the order change.

Enum ValueDescription
pending

Scheduled to apply at the next renewal.

applied

Items of the order are replaced.

canceled

Canceled before the change is applied.

superseded

Replaced by a later change for the same order.

applyAtstring

Time when the new items are applied.

  • now: The items change immediately. renewalPolicy, prorated, and effectiveTime apply.
  • nextRenewal: The current items stay until the next renewal. The new items are billed on the next renewal invoice. renewalPolicy, prorated, and effectiveTime are not allowed. A later change for the same order supersedes the pending change. The pending change is locked once the next renewal invoice is issued. To remove a pending change, use the DELETE /order-changes/{id} operation. The new items must differ from the current items. One-time sale items that are already on the order remain. A one-time sale item cannot be added with nextRenewal.
Default:"now"
Enum:"now""nextRenewal"
effectiveTimestring, (date-time)

Date and time when the change is applied. If applyAt is set to now, this value is the date from which the renewal time for resetToRecurring and the proration are calculated. If this field is omitted, this value defaults to the current time. If applyAt is set to nextRenewal, this value is read-only and equals the renewal time of the order.

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

Date and time when the items of a pending change are billed. After this time, the change is locked and cannot be modified until the renewal.

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

Date and time when the items of the order are replaced.

quoteIdstring or null, <= 50 charactersread-only

ID of the quote that is used to create the change. This value is null if the change is not created from a quote.

itemsArray of objects, non-emptyrequired

New items for the order. To remove an item, include the items array and exclude the items you want to remove.

renewalPolicystring

How the service periods and trial state of the order are managed when its items change now. Required when applyAt is now. Not allowed when applyAt is nextRenewal.

Enum ValueDescription
resetToRecurring

Resets the service periods, ends any trial, and converts trial-only items to recurring.

retainRecurring

Retains the current service periods, ends any trial, and converts trial-only items to recurring.

retainTrialThenRecurring

Retains the trial until it ends, then converts the item to recurring. Returns a validation error if the order has no trial.

retainTrialOnly

Retains the trial and keeps the item as trial-only. Returns a validation error if the order is not trial-only.

proratedboolean

Specifies whether to give a pro rata credit for the amount of time remaining between the effectiveTime and the end of the current period. Required when applyAt is now. Not allowed when applyAt is nextRenewal.

If renewalTime is retained by setting renewalPolicy to retainRecurring, retainTrialThenRecurring, or retainTrialOnly, a pro rata debit is also applied for the time between effectiveTime and renewalTime, as a percentage of the normal period size.

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.

]
Response
[ { "id": "ord_chg_0YV7DES3WPC5J8JD8QTVNZBZQ8", "orderId": "ord_01HRF27SATGE4Z6PBJE6PD8328", "status": "pending", "applyAt": "now", "effectiveTime": "2019-08-24T14:15:22Z", "lockedTime": "2019-08-24T14:15:22Z", "appliedTime": "2019-08-24T14:15:22Z", "quoteId": "string", "items": [ … ], "renewalPolicy": "resetToRecurring", "prorated": true, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ … ] } ]