Queries and mutations for managing Recurring Orders in the platform.
Queries
Query Recurring Orders
| Arguments | |
|---|---|
whereString | |
sortArray of String | |
limitInt | |
offsetInt | |
Get Recurring Order
| Arguments | |
|---|---|
idString | Queries with specified ID |
keyString | Queries with specified key |
Mutations
Create Recurring Order
Update Recurring Order
| Arguments | |
|---|---|
versionLong | |
actionsArray of RecurringOrderUpdateAction | |
idString | Queries with specified ID |
keyString | Queries with specified key |
Delete Recurring Order
| Arguments | |
|---|---|
versionLong | |
personalDataErasureBoolean | Default: false |
idString | Queries with specified ID |
keyString | Queries with specified key |
Output types
RecurringOrder
keyString | User-defined unique identifier of the RecurringOrder. |
recurringOrderState | Current state of the RecurringOrder. Can beActive, Canceled, Expired, Failed, or Paused |
cartRef | Reference to the Cart for a RecurringOrder.
The referenced Cart will have the RecurringOrder CartOrigin. |
cartCart | 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. |
customerEmailString | Email address of the Customer that the RecurringOrder belongs to. |
storeRef | Reference to a Store. |
store | Reference to a Store. |
idString | Unique identifier of the RecurringOrder. |
versionLong | 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
offsetInt | |
countInt | |
totalLong | |
existsBoolean | |
resultsArray of RecurringOrder |
RecurringOrderState
ActiveCanceledExpiredFailedPaused
SkipConfiguration
typeString |
Counter
totalToSkipInt | Number of Orders that will be skipped. |
skippedInt | Number of Orders that were already skipped. |
lastSkippedAt | Date and time (UTC) when the last Order creation was skipped. |
typeString |
RecurringOrderScope
type | Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies |
RecurringOrderScopeType
AnyOrderNonRecurringOrdersOnlyRecurringOrdersOnlyApplicableRecurrencePolicies
AnyOrder
type | Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies |
RecurringOrderScopeType
AnyOrderNonRecurringOrdersOnlyRecurringOrdersOnlyApplicableRecurrencePolicies
NonRecurringOrdersOnly
type | Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies |
RecurringOrderScopeType
AnyOrderNonRecurringOrdersOnlyRecurringOrdersOnlyApplicableRecurrencePolicies
RecurringOrdersOnly
type | Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies |
RecurringOrderScopeType
AnyOrderNonRecurringOrdersOnlyRecurringOrdersOnlyApplicableRecurrencePolicies
ApplicableRecurrencePolicies
recurrencePoliciesArray of RecurrencePolicy | Recurrence Policies for which the Cart Discount is valid. |
type | Can be AnyOrder, NonRecurringOrdersOnly, RecurringOrdersOnly, or ApplicableRecurrencePolicies |
recurrencePoliciesRefArray of Reference | Recurrence Policies for which the Cart Discount is valid. |
RecurringOrderScopeType
AnyOrderNonRecurringOrdersOnlyRecurringOrdersOnlyApplicableRecurrencePolicies
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.
keyString | User-defined unique identifier of the RecurringOrder. |
custom | Custom Fields for the RecurringOrder. |
cart | ResourceIdentifier to the Cart from which the RecurringOrder is created. |
cartVersionLong | 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 | 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
dummyString |
RecurringOrderExpiredInput
dummyString |
RecurringOrderCanceledInput
reasonString |
SkipConfigurationInputDraft
Counter |
CounterInputDraft
totalToSkipInt |
RecurringOrderScopeInput
AnyOrder | |
RecurringOrdersOnly | |
NonRecurringOrdersOnly | |
ApplicableRecurrencePolicies |
AnyOrderInput
dummyString |
NonRecurringOrdersOnlyInput
dummyString |
RecurringOrdersOnlyInput
dummyString |
ApplicableRecurrencePoliciesInput
recurrencePoliciesArray of ResourceIdentifierInput |
RecurringOrderUpdateAction
setExpiresAt | |
setKey | |
setOrderSkipConfiguration | |
setCustomField | |
setCustomType | |
setRecurringOrderState | |
setSchedule | |
setStartsAt | |
transitionState | |
requestOrderNow |
Update actions
Set Expires At
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
keyString | 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
nameString | Name of the Custom Field. |
valueString | 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
fieldsArray of CustomFieldInput | |
type | |
typeKeyString | |
typeIdString |
Set Recurring Order State
recurringOrderState | New state of the RecurringOrder. |
Set Schedule
recurrencePolicy | Value to set. |
Set Starts At
startsAt | Date and time (UTC) the Recurring Order should be started. The date and time must be in the future. |
Transition State
transitions, there must be a direct transition to the new State.
If transitions is not set, no validation is performed.state | Value to set. If there is no State yet, the new State must be an initial State. |
forceBoolean | Whether to turn off validation. Default:false |
Request Order Now
reasonString |