Queries and mutations for managing Recurrence Policies in the platform.

Queries

Query Recurrence Policies

QUERYrecurrencePolicies

Recurrence policies are managed and queried through the Recurrence Policy API and associated to a Price

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

Get Recurrence Policy

QUERYrecurrencePolicy

Recurrence policies are managed and queried through the Recurrence Policy API and associated to a Price

Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Mutations

Create Recurrence Policy

MUTATIONcreateRecurrencePolicy
Arguments
draft​

Update Recurrence Policy

MUTATIONupdateRecurrencePolicy
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Recurrence Policy

MUTATIONdeleteRecurrencePolicy
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Output types

RecurrencePolicy

Recurrence policies are managed and queried through the Recurrence Policy API and associated to a Price

id​
String​

Unique identifier of the RecurrencePolicy.

version​
Long​

Current version of the RecurrencePolicy.

key​
String​

User-defined unique identifier of the RecurrencePolicy.

name​
String​

Name of the RecurrencePolicy.

nameAllLocales​
Array of LocalizedString​

Name of the RecurrencePolicy.

description​
String​

Description of the RecurrencePolicy.

descriptionAllLocales​
Array of LocalizedString​

Description of the RecurrencePolicy.

schedule​

Schedule of the RecurrencePolicy.

minDaysBetweenOrders​
Int​
Minimum number of days that must pass since the last Order of a Recurring Order before the Request Order Now update action is allowed. If not set, there is no limit.
This value does not affect the recurrence schedule. For example, a weekly RecurrencePolicy with a value of 30 still creates Orders weekly. The time is measured in multiples of 24 hours from lastOrderAt of the Recurring Order, regardless of whether the last Order was created on schedule or early.

The limit applies to all Recurring Orders that use this RecurrencePolicy, and changes take effect immediately. It is ignored when the RecurrencePolicy is attached to a Price.

createdAt​

Date and time (UTC) the RecurrencePolicy was initially created.

lastModifiedAt​

Date and time (UTC) the RecurrencePolicy was last updated.

createdBy​

IDs and references that created the RecurrencePolicy.

lastModifiedBy​

IDs and references that last modified the RecurrencePolicy.

RecurrencePolicyQueryResult

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

RecurrencePolicySchedule

type​
String​

StandardSchedule

Schedule of a RecurringOrder that occurs at a fixed interval—for example, every two weeks or every month.
value​
Int​

Number of intervals between orders.

intervalUnit​

Interval of this schedule.

Can be Days, Weeks, or Months​
type​
String​

DayOfMonthSchedule

Schedule of a Recurring Order that occurs on a specific day of each month. This type is returned in the RecurrencePolicy for an active Recurring Order.
day​
Int​
The day of the month when the Recurring Order is created. If the value is greater than the number of days in a given month, the order is created on the last day of the month.
type​
String​

IntervalUnit

Days
Weeks
Months

Input types

RecurrencePolicyDraft

key​
String​

User-defined unique identifier for the RecurrencePolicy.

name​

Name of the RecurrencePolicy.

description​

Description of the RecurrencePolicy.

schedule​

Schedule where the recurrence is defined.

minDaysBetweenOrders​
Int​
Minimum number of days that must pass since the last Order of a Recurring Order before the Request Order Now update action is allowed. If not set, there is no limit.
This value does not affect the recurrence schedule. For example, a weekly RecurrencePolicy with a value of 30 still creates Orders weekly. The time is measured in multiples of 24 hours from lastOrderAt of the Recurring Order, regardless of whether the last Order was created on schedule or early.

The limit applies to all Recurring Orders that use this RecurrencePolicy, and changes take effect immediately. It is ignored when the RecurrencePolicy is attached to a Price.

RecurrencePolicyScheduleInput

standard​
dayOfMonth​

StandardScheduleInput

value​
Int​
intervalUnit​
Can be Days, Weeks, or Months​

DayOfMonthScheduleInput

day​
Int​

RecurrencePolicyUpdateAction

setDescription​
setKey​
setMinDaysBetweenOrders​
setName​
setSchedule​

Update actions

Set Description

description​

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

Set Key

key​
String​

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

Set Min Days Between Orders

The new value applies immediately to all Recurring Orders that use the RecurrencePolicy. It does not affect the recurrence schedule.
minDaysBetweenOrders​
Int​
Value to set. Must be greater than 0. If omitted, any existing value is removed and there is no limit.

Set Name

name​

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

Set Schedule

schedule​

Schedule where the recurrence is defined.