Anchor to subscriptionBillingCycleEditDeletesubscription
subscriptionBillingCycleEditDelete
mutation
Requires access scope. Also: The user must have manage_orders_information permission.
Delete the schedule and contract edits of the selected subscription billing cycle.
Anchor to Arguments
Arguments
- Anchor to billingCycleInputbilling•
Cycle Input SubscriptionBilling requiredCycle Input! Input object used to select and use billing cycles.
Was this section helpful?
Anchor to SubscriptionBillingCycleEditDeletePayload returnsSubscriptionBillingCycleEditDeletePayload returns
- Anchor to billingCyclesbilling•
Cycles The list of updated billing cycles.
- Anchor to userErrorsuser•
Errors The list of errors that occurred from executing the mutation.
Was this section helpful?
- Deletes the edits on a future billing cycle
- subscriptionBillingCycleEditDelete reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation subscriptionBillingCycleEditDelete($contractId: ID!, $index: Int!) {
subscriptionBillingCycleEditDelete(billingCycleInput: {contractId: $contractId, selector: {index: $index}}) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}`,
{
variables: {
"contractId": "gid://shopify/SubscriptionContract/398475269",
"index": 1
},
},
);
const data = await response.json();
mutation subscriptionBillingCycleEditDelete($contractId: ID!, $index: Int!) {
subscriptionBillingCycleEditDelete(billingCycleInput: {contractId: $contractId, selector: {index: $index}}) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation subscriptionBillingCycleEditDelete($contractId: ID!, $index: Int!) { subscriptionBillingCycleEditDelete(billingCycleInput: {contractId: $contractId, selector: {index: $index}}) { billingCycles { cycleStartAt cycleEndAt cycleIndex } userErrors { field message } } }",
"variables": {
"contractId": "gid://shopify/SubscriptionContract/398475269",
"index": 1
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation subscriptionBillingCycleEditDelete($contractId: ID!, $index: Int!) {
subscriptionBillingCycleEditDelete(billingCycleInput: {contractId: $contractId, selector: {index: $index}}) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}`,
{
variables: {
"contractId": "gid://shopify/SubscriptionContract/398475269",
"index": 1
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation subscriptionBillingCycleEditDelete($contractId: ID!, $index: Int!) {
subscriptionBillingCycleEditDelete(billingCycleInput: {contractId: $contractId, selector: {index: $index}}) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}`,
"variables": {
"contractId": "gid://shopify/SubscriptionContract/398475269",
"index": 1
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation subscriptionBillingCycleEditDelete($contractId: ID!, $index: Int!) {
subscriptionBillingCycleEditDelete(billingCycleInput: {contractId: $contractId, selector: {index: $index}}) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"contractId": "gid://shopify/SubscriptionContract/398475269",
"index": 1
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"contractId": "gid://shopify/SubscriptionContract/398475269",
"index": 1
}
Response
JSON{
"subscriptionBillingCycleEditDelete": {
"billingCycles": [
{
"cycleStartAt": "2021-12-15T15:33:01Z",
"cycleEndAt": "2022-01-01T12:00:00Z",
"cycleIndex": 1
}
],
"userErrors": []
}
}