Skip to content

External APIs (0.0.1)

Comprehensive API documentation for managing subscriptions, payments, and related operations. These APIs allow you to programmatically manage subscription lifecycles, handle payments, configure products, and integrate subscription functionality into your applications.

Languages
Servers
https://subscription-admin.appstle.com

Subscription Management

Core APIs for managing the complete subscription lifecycle including creation, updates, pausing, resuming, and cancellation of subscriptions.

Operations

Subscription Payments

APIs for managing subscription payment methods, processing payments, handling payment retries, and updating billing information.

Operations

Subscription Contracts

APIs for managing subscription contracts including delivery schedules, pricing, order notes, billing cycles, and shipping addresses.

Operations

Subscription Products

APIs for managing products within subscriptions including adding, removing, updating quantities, and swapping products.

Operations

Billing & Payments

APIs for handling billing operations, payment processing, and financial transactions related to subscriptions.

Operations

Subscription Discounts

APIs for managing discounts and promotional codes applied to subscriptions.

Operations

Subscription One-Time Products

APIs for managing one-time add-on products that can be purchased alongside recurring subscription items.

Operations

Subscription Plans

APIs for managing subscription plans, pricing tiers, and plan configurations.

Operations

Build-a-Box & Bundles

APIs for managing customizable product boxes and bundles where customers can select multiple items.

Operations

Generate discount code for bundle

Request

Generates a discount code for a subscription bundle. This endpoint creates a Shopify discount code that can be applied to bundle subscriptions, typically used during the checkout process.

Discount Code Generation:

  • Creates a unique discount code in Shopify
  • Associates the discount with the bundle
  • Configures discount rules and limitations
  • Sets expiration dates if specified
  • Applies usage limits if configured

Discount Configuration Options:

  • Discount type (percentage, fixed amount, or free shipping)
  • Discount value/amount
  • Minimum purchase requirements
  • Maximum usage count
  • Expiration date
  • Customer eligibility rules

Use Cases:

  • Promotional campaigns for bundles
  • Welcome discounts for new subscribers
  • Loyalty rewards for existing customers
  • Special offers and limited-time promotions
  • Partner/affiliate discount codes

Important Notes:

  • Discount codes are created in Shopify and follow Shopify's discount rules
  • Codes can be single-use or multi-use depending on configuration
  • Expired or depleted codes cannot be reused

Authentication: Requires valid X-API-Key header

Path
tokenstringrequired

Token

Query
api_keystring

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

Headers
X-API-Keystring
Bodyapplication/jsonrequired
cartobject(Cart)
curl -i -X PUT \
  'https://subscription-admin.appstle.com/api/external/v2/subscription-bundlings/discount/{token}?api_key=string' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "cart": {
      "token": "string",
      "note": {},
      "attributes": {},
      "original_total_price": 0,
      "total_price": 0,
      "total_discount": 0,
      "total_weight": 0,
      "item_count": 0,
      "items": [
        {
          "id": 0,
          "properties": {},
          "quantity": 0,
          "variant_id": 0,
          "key": "string",
          "title": "string",
          "price": 0,
          "original_price": 0,
          "discounted_price": 0,
          "line_price": 0,
          "original_line_price": 0,
          "total_discount": 0,
          "discounts": [
            {}
          ],
          "sku": "string",
          "grams": 0,
          "vendor": "string",
          "taxable": true,
          "product_id": 0,
          "product_has_only_default_variant": true,
          "gift_card": true,
          "final_price": 0,
          "final_line_price": 0,
          "url": "string",
          "featured_image": {
            "aspect_ratio": 0,
            "alt": "string",
            "height": 0,
            "url": "string",
            "width": 0
          },
          "image": "string",
          "handle": "string",
          "requires_shipping": true,
          "product_type": "string",
          "product_title": "string",
          "product_description": "string",
          "variant_title": {},
          "variant_options": [
            "string"
          ],
          "options_with_values": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "line_level_discount_allocations": [
            {}
          ],
          "line_level_total_discount": 0
        }
      ],
      "requires_shipping": true,
      "currency": "string",
      "items_subtotal_price": 0,
      "cart_level_discount_applications": [
        {}
      ]
    }
  }'

Responses

Discount code successfully generated

Bodyapplication/json
Response
application/json
{ "discountCode": "BUNDLE10", "discountId": "gid://shopify/DiscountCodeNode/123456", "discountType": "PERCENTAGE", "discountValue": 10, "expiresAt": "2024-12-31T23:59:59Z", "usageLimit": 100, "currentUsageCount": 0, "active": true }

Update subscription bundling configuration

Request

Updates the configuration for one or more subscription bundles (Build-a-Box). This endpoint allows bulk updates to bundle product selections, quantities, and configurations.

Subscription Bundling/Build-a-Box: Subscription bundling allows customers to create custom product bundles that are delivered on a recurring basis. Customers can select multiple products to be included in each delivery, creating a personalized subscription box.

Update Capabilities:

  • Modify product selections within a bundle
  • Update product quantities
  • Change bundle configuration settings
  • Bulk update multiple bundles at once

Use Cases:

  • Customer updates their bundle product selections
  • Swap products in an existing bundle
  • Adjust quantities for products in the bundle
  • Programmatically manage bundle configurations

Important Notes:

  • Updates are identified by bundle handle (unique identifier)
  • Only active bundles can be updated
  • Product availability is validated before update

Authentication: Requires valid X-API-Key header

Headers
X-API-Keystring
Bodyapplication/jsonrequiredArray [
babHandlestring
sourceProductsArray of objects(SourceProductDTO)
]
curl -i -X PUT \
  https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '[
    {
      "babHandle": "string",
      "sourceProducts": [
        {
          "sourceProductId": 0,
          "addSubProductIds": [
            0
          ],
          "addSubVariantIds": [
            0
          ],
          "deleteSubProductIds": [
            0
          ],
          "deleteSubVariantIds": [
            0
          ]
        }
      ]
    }
  ]'

Responses

Subscription bundling successfully updated

Bodyapplication/json
idinteger(int64)
shopstringrequired
subscriptionBundlingEnabledboolean
subscriptionIdinteger(int64)
minProductCountinteger(int32)
maxProductCountinteger(int32)
discountnumber(double)
uniqueRefstring
groupNamestring
subscriptionBundleLinkstring
bundleRedirectstring
Enum"CART""CHECKOUT""CUSTOM""NONE"
customRedirectURLstring
minOrderAmountnumber(double)
tieredDiscountstring
productViewStylestring
Enum"QUICK_ADD""VIEW_DETAILS"
buildABoxTypestring
Enum"CLASSIC""SINGLE_PRODUCT""MIX_AND_MATCH""INFINITE""CUSTOMIZE_BUNDLE""CLASSIC_BUILD_A_BOX""SINGLE_PRODUCT_BUILD_A_BOX""VOLUME_DISCOUNT""DISCOUNTED_PRICING""SHIPPING_DISCOUNT"
singleProductSettingsstring
subscriptionGroupstring
bundleTopHtmlstring
bundleBottomHtmlstring
proceedToCheckoutButtonTextstring
chooseProductsTextstring
namestring
trackInventoryboolean
allowOneTimePurchaseboolean
thirdPartyRuleboolean
selectionTypestring
Enum"FIXED""FLEXIBLE"
variantsstring
discountedVariantsstring
sectionsstring
appliesOnstring
Enum"PRODUCT""COLLECTION""BOTH""ONE_TIME""SUBSCRIPTION"
productDiscountTypestring
Enum"SELECTED_PRODUCT""EACH_PRODUCT"
collectionDatastring
productSelectionTypestring
Enum"PRODUCT""COLLECTION"
sellingPlanIdsstring
minUniqueProductCheckboolean
Response
application/json
{ "id": 12345, "shop": "example-shop.myshopify.com", "token": "abc123xyz", "bundleName": "My Custom Coffee Bundle", "bundleHandle": "custom-coffee-bundle-123", "products": [ {}, {} ], "frequency": "MONTH", "frequencyCount": 1, "active": true }

Update an existing Build-A-Box subscription bundle

Request

Updates an existing Build-A-Box subscription bundle with new configuration settings, product selections, pricing rules, or other bundle attributes. This endpoint allows you to modify any aspect of a previously created bundle while maintaining its unique identifier and shop association.

What Can Be Updated:

  • Bundle Information: Name, description, handle, and display settings
  • Product Configuration: Available products, product pool, and selection rules
  • Quantity Limits: Minimum and maximum product counts per box
  • Pricing Settings: Pricing type, discount rules, and promotional offers
  • Delivery Options: Subscription frequencies and delivery intervals
  • Business Rules: Product combination rules, category restrictions
  • Status: Active/inactive state for customer visibility
  • Customization Options: Allow product swaps, one-time purchases

Update Behavior:

  • The bundle ID must be provided in the request body
  • Shop ownership is verified - you can only update bundles belonging to your shop
  • All fields in the request body will update the corresponding bundle properties
  • Partial updates are supported - only include fields you want to change
  • The update is atomic - either all changes succeed or none are applied
  • Existing subscriptions using this bundle are not automatically affected

Impact on Active Subscriptions:

  • Changes to product availability affect future customer selections
  • Pricing updates apply to new subscriptions but not existing ones by default
  • Quantity limit changes are enforced on next customer modification
  • Frequency changes only affect new subscriptions
  • Deactivating a bundle prevents new subscriptions but maintains existing ones

Common Update Scenarios:

  1. Add/Remove Products: Update the available product pool
  2. Adjust Pricing: Change discount percentages or pricing models
  3. Modify Limits: Update minimum/maximum product selection rules
  4. Change Frequencies: Add or remove subscription interval options
  5. Update Content: Modify bundle name, description, or images
  6. Toggle Status: Activate or deactivate bundle availability
  7. Refine Rules: Adjust product combination or category restrictions

Best Practices:

  • Verify product availability before adding to the bundle
  • Test pricing changes with sample calculations
  • Communicate bundle changes to existing subscribers
  • Use inactive status for testing changes before making them live
  • Keep bundle handles consistent for external integrations
  • Document major changes for customer support reference
  • Consider seasonal or promotional updates to keep offerings fresh

Validation Rules:

  • Bundle ID is required and must exist
  • Shop must match the authenticated shop (cannot transfer bundles)
  • All referenced products must be valid and available
  • Minimum product count cannot exceed maximum product count
  • Pricing values must be non-negative
  • Bundle handle should remain unique across all bundles

Authentication: Requires valid X-API-Key header or api_key parameter (deprecated)

Query
api_keystring

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

Headers
X-API-Keystring
Bodyapplication/jsonrequired
idinteger(int64)
shopstringrequired
subscriptionBundlingEnabledboolean
subscriptionIdinteger(int64)
minProductCountinteger(int32)
maxProductCountinteger(int32)
discountnumber(double)
uniqueRefstring
groupNamestring
subscriptionBundleLinkstring
bundleRedirectstring
Enum"CART""CHECKOUT""CUSTOM""NONE"
customRedirectURLstring
minOrderAmountnumber(double)
tieredDiscountstring
productViewStylestring
Enum"QUICK_ADD""VIEW_DETAILS"
buildABoxTypestring
Enum"CLASSIC""SINGLE_PRODUCT""MIX_AND_MATCH""INFINITE""CUSTOMIZE_BUNDLE""CLASSIC_BUILD_A_BOX""SINGLE_PRODUCT_BUILD_A_BOX""VOLUME_DISCOUNT""DISCOUNTED_PRICING""SHIPPING_DISCOUNT"
singleProductSettingsstring
subscriptionGroupstring
bundleTopHtmlstring
bundleBottomHtmlstring
proceedToCheckoutButtonTextstring
chooseProductsTextstring
namestring
trackInventoryboolean
allowOneTimePurchaseboolean
thirdPartyRuleboolean
selectionTypestring
Enum"FIXED""FLEXIBLE"
variantsstring
discountedVariantsstring
sectionsstring
appliesOnstring
Enum"PRODUCT""COLLECTION""BOTH""ONE_TIME""SUBSCRIPTION"
productDiscountTypestring
Enum"SELECTED_PRODUCT""EACH_PRODUCT"
collectionDatastring
productSelectionTypestring
Enum"PRODUCT""COLLECTION"
sellingPlanIdsstring
minUniqueProductCheckboolean
curl -i -X PUT \
  'https://subscription-admin.appstle.com/api/external/v2/build-a-box?api_key=string' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "id": 0,
    "shop": "string",
    "subscriptionBundlingEnabled": true,
    "subscriptionId": 0,
    "minProductCount": 0,
    "maxProductCount": 0,
    "discount": 0.1,
    "uniqueRef": "string",
    "groupName": "string",
    "subscriptionBundleLink": "string",
    "bundleRedirect": "CART",
    "customRedirectURL": "string",
    "minOrderAmount": 0.1,
    "tieredDiscount": "string",
    "productViewStyle": "QUICK_ADD",
    "buildABoxType": "CLASSIC",
    "singleProductSettings": "string",
    "subscriptionGroup": "string",
    "bundleTopHtml": "string",
    "bundleBottomHtml": "string",
    "proceedToCheckoutButtonText": "string",
    "chooseProductsText": "string",
    "name": "string",
    "trackInventory": true,
    "allowOneTimePurchase": true,
    "thirdPartyRule": true,
    "selectionType": "FIXED",
    "variants": "string",
    "discountedVariants": "string",
    "sections": "string",
    "appliesOn": "PRODUCT",
    "productDiscountType": "SELECTED_PRODUCT",
    "collectionData": "string",
    "productSelectionType": "PRODUCT",
    "sellingPlanIds": "string",
    "minUniqueProductCheck": true
  }'

Responses

Build-A-Box subscription bundle successfully updated

Bodyapplication/json
idinteger(int64)
shopstringrequired
subscriptionBundlingEnabledboolean
subscriptionIdinteger(int64)
minProductCountinteger(int32)
maxProductCountinteger(int32)
discountnumber(double)
uniqueRefstring
groupNamestring
subscriptionBundleLinkstring
bundleRedirectstring
Enum"CART""CHECKOUT""CUSTOM""NONE"
customRedirectURLstring
minOrderAmountnumber(double)
tieredDiscountstring
productViewStylestring
Enum"QUICK_ADD""VIEW_DETAILS"
buildABoxTypestring
Enum"CLASSIC""SINGLE_PRODUCT""MIX_AND_MATCH""INFINITE""CUSTOMIZE_BUNDLE""CLASSIC_BUILD_A_BOX""SINGLE_PRODUCT_BUILD_A_BOX""VOLUME_DISCOUNT""DISCOUNTED_PRICING""SHIPPING_DISCOUNT"
singleProductSettingsstring
subscriptionGroupstring
bundleTopHtmlstring
bundleBottomHtmlstring
proceedToCheckoutButtonTextstring
chooseProductsTextstring
namestring
trackInventoryboolean
allowOneTimePurchaseboolean
thirdPartyRuleboolean
selectionTypestring
Enum"FIXED""FLEXIBLE"
variantsstring
discountedVariantsstring
sectionsstring
appliesOnstring
Enum"PRODUCT""COLLECTION""BOTH""ONE_TIME""SUBSCRIPTION"
productDiscountTypestring
Enum"SELECTED_PRODUCT""EACH_PRODUCT"
collectionDatastring
productSelectionTypestring
Enum"PRODUCT""COLLECTION"
sellingPlanIdsstring
minUniqueProductCheckboolean
Response
application/json
{ "id": 45678, "shop": "example-shop.myshopify.com", "bundleName": "Premium Coffee Selection - Updated", "bundleHandle": "premium-coffee-selection", "uniqueRef": "bab_abc123xyz", "description": "Choose from our expanded selection of artisan coffee blends", "buildABoxType": "SINGLE_PRODUCT", "buildBoxVersion": "V2", "minProductCount": 3, "maxProductCount": 6, "pricingType": "PER_PRODUCT", "discount": 15, "discountType": "PERCENTAGE", "allowOneTimePurchase": true, "active": true, "availableProducts": [ {}, {}, {} ], "frequencies": [ {}, {} ], "createdAt": "2024-03-15T10:30:00Z", "updatedAt": "2024-03-20T14:45:00Z" }

Product Catalog

APIs for managing the product catalog including product information, variants, and inventory.

Operations

Operations & Settings

APIs for managing operational settings, configurations, and administrative functions.

Operations

Customer Portal

APIs powering the customer-facing portal where subscribers can manage their own subscriptions.

Operations

Customers

APIs for managing customer information, profiles, and account details.

Operations