Queries and mutations for managing Recurring Orders in the platform.

Queries

Query Recurring Orders

QUERYrecurringOrders
Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​

Get Recurring Order

QUERYrecurringOrder
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Mutations

Create Recurring Order

MUTATIONcreateRecurringOrder
Arguments
draft​

Update Recurring Order

MUTATIONupdateRecurringOrder
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Recurring Order

MUTATIONdeleteRecurringOrder
Arguments
version​
Long​
personalDataErasure​
Boolean​
Default: false​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Output types

RecurringOrder

key​
String​

User-defined unique identifier of the RecurringOrder.

recurringOrderState​

Current state of the RecurringOrder.

Can be Active, Canceled, Expired, Failed, or Paused​
cartRef​
Reference to the Cart for a RecurringOrder. The referenced Cart will have the RecurringOrder CartOrigin.
cart​
Cart​
Reference to the Cart for a RecurringOrder. The referenced Cart will have the RecurringOrder CartOrigin.
startsAt​

Date and time (UTC) when the RecurringOrder starts creating new Orders.

resumesAt​

Date and time (UTC) when the RecurringOrder resumes creating Orders after being unpaused.

expiresAt​

Date and time (UTC) when the RecurringOrder expires.

lastOrderAt​

Date and time (UTC) when the last Order was created from this RecurringOrder.

nextOrderAt​

Date and time (UTC) when the next Order will be created from this RecurringOrder.

skipConfiguration​

Information about current and future skips for this RecurringOrder.

businessUnit​
Reference to the Business Unit that the RecurringOrder belongs to.
businessUnitRef​
Reference to the Business Unit that the RecurringOrder belongs to.
custom​

Custom Fields of the RecurringOrder.

stateRef​
State of the RecurringOrder in a custom workflow.
state​
State of the RecurringOrder in a custom workflow.
originOrderRef​
Reference to the original Order that generated this RecurringOrder. This field is automatically populated when the RecurringOrder is created via the Create Order from Cart endpoint and the Cart contains Line Items with defined recurrenceInfo. When the RecurringOrder is created directly via the Create RecurringOrder endpoint, this field remains empty.
originOrder​
Reference to the original Order that generated this RecurringOrder. This field is automatically populated when the RecurringOrder is created via the Create Order from Cart endpoint and the Cart contains Line Items with defined recurrenceInfo. When the RecurringOrder is created directly via the Create RecurringOrder endpoint, this field remains empty.
schedule​

Schedule of the RecurringOrder.

customerRef​
The Customer that the RecurringOrder belongs to.
customer​
The Customer that the RecurringOrder belongs to.
customerEmail​
String​

Email address of the Customer that the RecurringOrder belongs to.

storeRef​
Reference to a Store.
store​
Reference to a Store.
id​
String​

Unique identifier of the RecurringOrder.

version​
Long​

Current version of the RecurringOrder.

createdAt​

Date and time (UTC) when the RecurringOrder was created.

lastModifiedAt​

Date and time (UTC) when the RecurringOrder was last updated.

createdBy​

IDs and references that created the RecurringOrder.

lastModifiedBy​

IDs and references that last modified the RecurringOrder.

RecurringOrderQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​
Array of RecurringOrder​

RecurringOrderState

Active
Canceled
Expired
Failed
Paused

SkipConfiguration

type​
String​

Counter

Configuration to track skips for a RecurringOrder.
totalToSkip​
Int​

Number of Orders that will be skipped.

skipped​
Int​

Number of Orders that were already skipped.

lastSkippedAt​

Date and time (UTC) when the last Order creation was skipped.

type​
String​

RecurringOrderScope

BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies​

RecurringOrderScopeType

AnyOrder
NonRecurringOrdersOnly
RecurringOrdersOnly
ApplicableRecurrencePolicies

AnyOrder

BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies​

RecurringOrderScopeType

AnyOrder
NonRecurringOrdersOnly
RecurringOrdersOnly
ApplicableRecurrencePolicies

NonRecurringOrdersOnly

BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies​

RecurringOrderScopeType

AnyOrder
NonRecurringOrdersOnly
RecurringOrdersOnly
ApplicableRecurrencePolicies

RecurringOrdersOnly

BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies​

RecurringOrderScopeType

AnyOrder
NonRecurringOrdersOnly
RecurringOrdersOnly
ApplicableRecurrencePolicies

ApplicableRecurrencePolicies

BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
recurrencePolicies​
Array of RecurrencePolicy​

Recurrence Policies for which the Cart Discount is valid.

Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies​
recurrencePoliciesRef​
Array of Reference​

Recurrence Policies for which the Cart Discount is valid.

RecurringOrderScopeType

AnyOrder
NonRecurringOrdersOnly
RecurringOrdersOnly
ApplicableRecurrencePolicies

PriceSelectionMode

Dynamic
Every time a new order is created from this recurring order, we will update to the latest price available
Fixed
The price will stay the same until the recurring order expires or is cancelled

Input types

RecurringOrderDraft

Recurring Orders are automatically assigned the Store and/or Business Unit from the associated Cart.

key​
String​
User-defined unique identifier of the RecurringOrder.
custom​

Custom Fields for the RecurringOrder.

ResourceIdentifier to the Cart from which the RecurringOrder is created.
cartVersion​
Long​
Current version of the referenced Cart.
startsAt​

Date and time (UTC) when the RecurringOrder will start. When specified, the date and time must be in the future. If not specified, the recurring order will start immediately.

expiresAt​

Date and time (UTC) when the RecurringOrder will expire.

State for the RecurringOrder in a custom workflow.

recurringOrderState​
Can be Active, Canceled, Expired, Failed, or Paused​

RecurringOrderStateDraft

active​
paused​
canceled​
expired​

RecurringOrderActiveInput

resumesAt​

RecurringOrderPausedInput

dummy​
String​

RecurringOrderExpiredInput

dummy​
String​

RecurringOrderCanceledInput

reason​
String​

SkipConfigurationInputDraft

Counter​

CounterInputDraft

totalToSkip​
Int​

RecurringOrderScopeInput

AnyOrder​
RecurringOrdersOnly​
NonRecurringOrdersOnly​
ApplicableRecurrencePolicies​

AnyOrderInput

dummy​
String​

NonRecurringOrdersOnlyInput

dummy​
String​

RecurringOrdersOnlyInput

dummy​
String​

ApplicableRecurrencePoliciesInput

recurrencePolicies​

RecurringOrderUpdateAction

setExpiresAt​
setKey​
setOrderSkipConfiguration​
setCustomField​
setCustomType​
setRecurringOrderState​
setSchedule​
setStartsAt​
transitionState​
requestOrderNow​

Update actions

Set Expires At

Setting the expiration date and time generates the RecurringOrderExpiresAtSet Message.
expiresAt​

Date and time (UTC) the Recurring Order should expire. If omitted, any existing value is removed.

If the date or time is extended or removed when the RecurringOrderState is Expired, the state will be updated to Active.

Set Key

This update action generates the RecurringOrderKeySet Message.
key​
String​

Value to set. If omitted, any existing key is removed.

Set Order Skip Configuration

skipConfigurationInputDraft​
Configuration for skipping future orders of the Recurring Order.
updatedExpiresAt​

Date and time (UTC) the Recurring Order will expire and stop generating new orders.

Set Custom Field

Adding a Custom Field to a Recurring Order generates the RecurringOrderCustomFieldAdded Message, removing one generates the RecurringOrderCustomFieldRemoved Message, and updating an existing one generates the RecurringOrderCustomFieldChanged Message.
name​
String​
Name of the Custom Field.
value​
String​
If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Set Custom Type

fields​
Array of CustomFieldInput​
typeKey​
String​
typeId​
String​

Set Recurring Order State

Setting the RecurringOrderState generates the RecurringOrderStateChanged Message.
recurringOrderState​

New state of the RecurringOrder.

Set Schedule

To set the schedule, the Recurring Order must be active, with no active Skip Configuration and with available prices for all Cart items for the new schedule. Setting the schedule generates the RecurringOrderScheduleSet Message.
recurrencePolicy​

Value to set.

Set Starts At

To set the start date and time, the Recurring Order must not have been started yet. Setting the start date and time generates the RecurringOrderStartsAtSet Message.
startsAt​
Date and time (UTC) the Recurring Order should be started. The date and time must be in the future.

Transition State

If the existing State has set transitions, there must be a direct transition to the new State. If transitions is not set, no validation is performed.
This update action produces the Recurring Order State Transition Message.

Value to set. If there is no State yet, the new State must be an initial State.

force​
Boolean​

Whether to turn off validation.

Default: false​

Request Order Now

reason​
String​