Anchor to subscriptionBillingCycleEditsDeletesubscription
subscriptionBillingCycleEditsDelete
mutation
Requires access scope. Also: The user must have manage_orders_information permission.
Delete the current and future schedule and contract edits of a list of subscription billing cycles.
Anchor to Arguments
Arguments
- Anchor to contractIdcontract•
Id ID!required The globally-unique identifier of the subscription contract that the billing cycle belongs to.
- Anchor to targetSelectiontarget•
Selection Select billing cycles to be deleted.
Was this section helpful?
Anchor to SubscriptionBillingCycleEditsDeletePayload returnsSubscriptionBillingCycleEditsDeletePayload 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?
- Delete the edits on the current and all future billing cycles
- subscriptionBillingCycleEditsDelete reference
Examples
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation subscriptionBillingCycleEditsDelete($contractId: ID!) {6 subscriptionBillingCycleEditsDelete(contractId: $contractId, targetSelection: ALL) {7 billingCycles {8 cycleStartAt9 cycleEndAt10 cycleIndex11 }12 userErrors {13 field14 message15 }16 }17 }`,18 {19 variables: {20 "contractId": "gid://shopify/SubscriptionContract/398475269"21 },22 },23);2425const data = await response.json();26
mutation subscriptionBillingCycleEditsDelete($contractId: ID!) {
subscriptionBillingCycleEditsDelete(contractId: $contractId, targetSelection: ALL) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation subscriptionBillingCycleEditsDelete($contractId: ID!) { subscriptionBillingCycleEditsDelete(contractId: $contractId, targetSelection: ALL) { billingCycles { cycleStartAt cycleEndAt cycleIndex } userErrors { field message } } }",
"variables": {
"contractId": "gid://shopify/SubscriptionContract/398475269"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation subscriptionBillingCycleEditsDelete($contractId: ID!) {
subscriptionBillingCycleEditsDelete(contractId: $contractId, targetSelection: ALL) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}`,
{
variables: {
"contractId": "gid://shopify/SubscriptionContract/398475269"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation subscriptionBillingCycleEditsDelete($contractId: ID!) {
subscriptionBillingCycleEditsDelete(contractId: $contractId, targetSelection: ALL) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}`,
"variables": {
"contractId": "gid://shopify/SubscriptionContract/398475269"
},
},
});
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 subscriptionBillingCycleEditsDelete($contractId: ID!) {
subscriptionBillingCycleEditsDelete(contractId: $contractId, targetSelection: ALL) {
billingCycles {
cycleStartAt
cycleEndAt
cycleIndex
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"contractId": "gid://shopify/SubscriptionContract/398475269"
}
response = client.query(query: query, variables: variables)
Input variables
JSON1{2 "contractId": "gid://shopify/SubscriptionContract/398475269"3}
Response
JSON1{2 "subscriptionBillingCycleEditsDelete": {3 "billingCycles": [4 {5 "cycleStartAt": "2021-12-15T15:33:01Z",6 "cycleEndAt": "2022-01-01T12:00:00Z",7 "cycleIndex": 18 }9 ],10 "userErrors": []11 }12}