Menu
subscriptionBillingCycles
Returns subscription billing cycles for a contract ID.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the subscriptionBillingCycles action (under Subscription).
- Fill in the fields below, then reference the result from later steps as
{{subscriptionbillingcycles.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query SubscriptionBillingCycles($contractId: ID!, $billingCyclesDateRangeSelector: SubscriptionBillingCyclesDateRangeSelector, $billingCyclesIndexRangeSelector: SubscriptionBillingCyclesIndexRangeSelector, $first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $sortKey: SubscriptionBillingCyclesSortKeys) {
subscriptionBillingCycles(
contractId: $contractId
billingCyclesDateRangeSelector: $billingCyclesDateRangeSelector
billingCyclesIndexRangeSelector: $billingCyclesIndexRangeSelector
first: $first
after: $after
last: $last
before: $before
reverse: $reverse
sortKey: $sortKey
) {
edges {
cursor
node {
billingAttemptExpectedDate
cycleEndAt
cycleIndex
cycleStartAt
edited
editedContract
skipped
sourceContract
status
}
}
nodes {
billingAttemptExpectedDate
cycleEndAt
cycleIndex
cycleStartAt
edited
editedContract {
app
appAdminUrl
createdAt
currencyCode
customAttributes
customer
deliveryMethod
deliveryPrice
lineCount
linesCount
note
updatedAt
}
skipped
sourceContract {
app
appAdminUrl
billingPolicy
createdAt
currencyCode
customAttributes
customer
deliveryMethod
deliveryPolicy
deliveryPrice
id
lastBillingAttemptErrorType
lastPaymentStatus
lineCount
linesCount
nextBillingDate
note
originOrder
revisionId
status
updatedAt
}
status
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"contractId": "string",
"billingCyclesDateRangeSelector": {
"startDate": "string",
"endDate": "string"
},
"billingCyclesIndexRangeSelector": {
"startIndex": 0,
"endIndex": 0
},
"first": 0,
"after": "string",
"last": 0,
"before": "string",
"reverse": false,
"sortKey": "CYCLE_INDEX"
}
Response
Read the result with {{subscriptionbillingcycles.response.data.data.subscriptionBillingCycles}}. If the API returns errors, the step fails and they are at {{subscriptionbillingcycles.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?