Skip to main content
POST
/
subscriptions
/
cp
/
api
/
product-swaps-by-variant-groups
/
{contractId}
Get product swap variant groups for a contract
curl --request POST \
  --url https://www.myshop.com/apps/subscriptions/cp/api/product-swaps-by-variant-groups/{contractId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "variantQuantityList": [
    {
      "variantId": 123,
      "quantity": 123,
      "title": "<string>",
      "image": "<string>",
      "productTitle": "<string>",
      "productId": "<string>",
      "variantTitle": "<string>",
      "swapId": 123
    }
  ]
}
'
[
  [
    {
      "variantId": 12345,
      "quantity": 2,
      "title": "Medium Roast - 12oz",
      "image": "https://cdn.shopify.com/files/1/0000/0000/products/medium-roast.jpg",
      "productTitle": "House Blend Coffee",
      "productId": "gid://shopify/Product/98765",
      "variantTitle": "House Blend Coffee - Medium Roast - 12oz",
      "swapId": 1001
    },
    {
      "variantId": 12346,
      "quantity": 1,
      "title": "Light Roast - 8oz",
      "image": "https://cdn.shopify.com/files/1/0000/0000/products/light-roast.jpg",
      "productTitle": "Morning Blend Coffee",
      "productId": "gid://shopify/Product/98766",
      "variantTitle": "Morning Blend Coffee - Light Roast - 8oz",
      "swapId": 1001
    }
  ],
  [
    {
      "variantId": 67890,
      "quantity": 2,
      "title": "Dark Roast - 12oz",
      "image": "https://cdn.shopify.com/files/1/0000/0000/products/dark-roast.jpg",
      "productTitle": "Bold Blend Coffee",
      "productId": "gid://shopify/Product/88765",
      "variantTitle": "Bold Blend Coffee - Dark Roast - 12oz",
      "swapId": 1002
    }
  ]
]

Documentation Index

Fetch the complete documentation index at: https://appstleinc-aeca3e0a.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

contractId
integer<int64>
required

Body

application/json
variantQuantityList
object[]

Response

Product swap variant groups returned successfully - Returns swappable variants for the next 10 billing cycles. Each element in the outer array represents the variants that will be swapped to for a specific billing cycle.