Returns a Selling Plan Group resource by ID.


Anchor to id
id
required

The ID of the SellingPlanGroup to return.


Was this section helpful?

Anchor to SellingPlanGroup
SellingPlanGroup
Access requirements

Represents a selling method (for example, "Subscribe and save" or "Pre-paid"). Selling plan groups and associated records (selling plans and policies) are deleted 48 hours after a merchant uninstalls their subscriptions app. We recommend backing up these records if you need to restore them later.


Was this section helpful?
Retrieve information about a selling plan group
Hide code
Copy
query sellingPlanGroups {
  sellingPlanGroup(id: "gid://shopify/SellingPlanGroup/1") {
    id,
    name,
    merchantCode,
    appId,
    description,
    options,
    position,
    createdAt,
    sellingPlans(first: 1) {
      edges {
        node {
          id
        }
      }
    }
    productVariants(first: 1) {
      edges {
        node {
          id
        }
      }
    }
    productVariantCount,
    summary,
    products(first: 1) {
      edges {
        node {
          id
        }
      }
    }
    productCount,
    appliesToProduct(productId: "gid://shopify/Product/1"),
    appliesToProductVariant(productVariantId: "gid://shopify/ProductVariant/1")
    app {
      id
    }
  }
}
Hide code
Response
JSON
{
  "sellingPlanGroup": {
    "id": "gid://shopify/SellingPlanGroup/1",
    "name": "Subscribe & Save",
    "merchantCode": "sub-n-save",
    "appId": "gid://shopify/App/1",
    "description": null,
    "options": [
      "Delivery every"
    ],
    "position": null,
    "createdAt": "2023-07-16T19:21:25Z",
    "sellingPlans": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/SellingPlan/1"
          }
        }
      ]
    },
    "productVariants": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/ProductVariant/1"
          }
        }
      ]
    },
    "productVariantCount": 1,
    "summary": "1 delivery frequency, 25-26% discount",
    "products": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Product/1"
          }
        }
      ]
    },
    "productCount": 1,
    "appliesToProduct": true,
    "appliesToProductVariant": true,
    "app": {
      "id": "gid://shopify/App/1"
    }
  }
}