Skip to main content
GET
/
api
/
external
/
v2
/
subscription-groups
Get all subscription groups
curl --request GET \
  --url https://subscription-admin.appstle.com/api/external/v2/subscription-groups \
  --header 'X-API-Key: <x-api-key>'
import requests

url = "https://subscription-admin.appstle.com/api/external/v2/subscription-groups"

headers = {"X-API-Key": "<x-api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};

fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-groups';
const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://subscription-admin.appstle.com/api/external/v2/subscription-groups"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<x-api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "groupName": "Monthly Coffee Subscription",
    "id": 123456789,
    "productCount": 10,
    "productIds": "[{\"id\":987654321,\"title\":\"Premium Coffee Blend\",\"status\":\"ACTIVE\"}]",
    "productVariantCount": 35,
    "subscriptionPlans": [
      {
        "afterCycle1": 0,
        "billingFrequencyCount": 1,
        "billingFrequencyInterval": "MONTH",
        "discountEnabled": true,
        "discountOffer": 10,
        "discountType": "PERCENTAGE",
        "frequencyCount": 1,
        "frequencyDescription": "Save 10% on monthly deliveries",
        "frequencyInterval": "MONTH",
        "frequencyName": "Delivered Monthly",
        "id": "gid://shopify/SellingPlan/111111",
        "inventoryPolicyReserve": "ON_SALE",
        "minCycles": 3,
        "planType": "PAY_AS_YOU_GO"
      }
    ],
    "variantIds": "[]"
  },
  {
    "groupName": "Premium Tea Collection",
    "id": 123456790,
    "productCount": 15,
    "productIds": "[{\"id\":987654324,\"title\":\"Organic Green Tea\"},{\"id\":987654325,\"title\":\"Earl Grey Premium\"}]",
    "productVariantCount": 45,
    "subscriptionPlans": [
      {
        "afterCycle1": 0,
        "discountEnabled": true,
        "discountOffer": 15,
        "discountType": "PERCENTAGE",
        "frequencyCount": 1,
        "frequencyDescription": "Fresh tea every week with 15% savings",
        "frequencyInterval": "WEEK",
        "frequencyName": "Weekly Tea Box",
        "id": "gid://shopify/SellingPlan/222222",
        "planType": "PAY_AS_YOU_GO"
      },
      {
        "afterCycle1": 0,
        "discountEnabled": true,
        "discountOffer": 10,
        "discountType": "PERCENTAGE",
        "frequencyCount": 1,
        "frequencyDescription": "Monthly delivery with 10% discount",
        "frequencyInterval": "MONTH",
        "frequencyName": "Monthly Tea Box",
        "id": "gid://shopify/SellingPlan/333333",
        "planType": "PAY_AS_YOU_GO"
      }
    ],
    "variantIds": "[]"
  }
]
{
"detail": "Invalid or missing API key",
"status": 401,
"title": "Unauthorized",
"type": "https://example.com/errors/unauthorized"
}
[
{
"accessoryProductIds": "<string>",
"deleteProducts": {
"allProduct": true,
"collectionId": "<string>",
"deleteAllProduct": true,
"productDetails": "<string>",
"productIds": [
123
],
"variantDetails": "<string>",
"variantIds": [
123
]
},
"groupName": "<string>",
"id": 123,
"productCount": 123,
"productId": "<string>",
"productIds": "<string>",
"productVariantCount": 123,
"subscriptionPlans": [
{
"afterCycle1": 123,
"afterCycle2": 123,
"appstleCycles": [
{
"afterCycle": 3,
"discountType": "PERCENTAGE",
"freeProductHandle": "free-gift-product",
"freeProductTitle": "Ceramic Mug",
"freeVariantId": 42549172011164,
"preventDuplicationFreeProduct": true,
"repeatingCycle": true,
"repeatingNumberOfCycle": 6,
"value": 10
}
],
"billingFrequencyCount": 123,
"cutOff": 123,
"defaultSelectedPlan": true,
"discountEnabled": true,
"discountEnabled2": true,
"discountEnabled2Masked": true,
"discountEnabledMasked": true,
"discountOffer": 123,
"discountOffer2": 123,
"fixedBillingDates": [
{
"day": 123,
"month": 123
}
],
"formFieldJson": "<string>",
"freeTrialCount": 123,
"freeTrialEnabled": true,
"frequencyCount": 123,
"frequencyDescription": "<string>",
"frequencyName": "<string>",
"frequencyNameTranslations": {},
"frequencySequence": 123,
"groupId": 123,
"groupName": "<string>",
"id": "<string>",
"idNew": "<string>",
"keepOriginalNextBillingDateAfterTrial": true,
"maxCycles": 123,
"memberExclusiveTags": "<string>",
"memberInclusiveTags": "<string>",
"memberOnly": true,
"minCycles": 123,
"nonMemberOnly": true,
"payAsYouGoPrepaidBillingFrequencyCount": 123,
"prepaidFlag": "<string>",
"repeatingCycle": true,
"repeatingNumberOfCycle": 123,
"specificDayEnabled": true,
"specificDayValue": 123,
"specificMonthValue": 123,
"upcomingOrderEmailBuffer": 123
}
],
"translations": "<string>",
"updateProducts": {
"allProduct": true,
"collectionId": "<string>",
"deleteAllProduct": true,
"productDetails": "<string>",
"productIds": [
123
],
"variantDetails": "<string>",
"variantIds": [
123
]
},
"variantIds": "<string>"
}
]
{
"detail": "Error retrieving subscription groups from Shopify",
"status": 500,
"title": "Internal Server Error",
"type": "https://example.com/errors/internal-server-error"
}

Headers

X-API-Key
string
required

API Key for authentication

Query Parameters

api_key
string

API Key (Deprecated - Use X-API-Key header instead)

Response

Successfully retrieved all subscription groups

accessoryProductIds
string
deleteProducts
object
groupName
string
id
integer<int64>
productCount
integer<int64>
productId
string
productIds
string
productVariantCount
integer<int64>
subscriptionPlans
object[]
translations
string
updateProducts
object
variantIds
string