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

Retrieve a Build-A-Box bundle by ID

Request

Fetches the complete configuration and details of a specific Build-A-Box subscription bundle using its unique identifier. This endpoint returns all bundle settings including products, pricing, rules, and delivery options.

What You'll Receive:

  • Complete Bundle Configuration: All settings and properties
  • Product Information: Full list of available products with details
  • Pricing Structure: Discount rules, pricing type, and promotional settings
  • Delivery Options: Subscription frequencies and delivery intervals
  • Business Rules: Product limits, combination rules, and restrictions
  • Status Information: Active/inactive state and timestamps
  • Customization Settings: Allow one-time purchases, product swaps, etc.

Use Cases:

  1. Bundle Management: Retrieve current bundle settings for review or editing
  2. Integration Sync: Synchronize bundle data with external systems
  3. Customer Portal: Display bundle options and configurations
  4. Audit & Reporting: Track bundle configurations over time
  5. Validation: Verify bundle setup before making changes
  6. Cloning: Retrieve settings to duplicate a successful bundle
  7. Troubleshooting: Debug subscription issues by reviewing bundle config

Response Details: The response includes comprehensive information about the bundle:

  • Bundle Metadata: ID, shop, name, handle, unique reference
  • Product Pool: All products available for customer selection
  • Selection Rules: Min/max product counts, quantity limits
  • Pricing Configuration: Discount percentages, pricing models
  • Subscription Options: Available delivery frequencies
  • Display Settings: Product view styles, custom HTML, button text
  • Advanced Features: Third-party rules, inventory tracking, selection types
  • Timestamps: Creation and last update dates

Authorization:

  • You can only retrieve bundles that belong to your authenticated shop
  • The system verifies shop ownership before returning bundle data
  • Returns 404 if bundle doesn't exist or doesn't belong to your shop

Integration Tips:

  • Cache bundle data to reduce API calls for frequently accessed bundles
  • Use this endpoint to verify bundle existence before creating subscriptions
  • Combine with update endpoint for edit workflows (get → modify → update)
  • Check the active field to determine if the bundle is available to customers
  • Review availableProducts array to ensure product inventory availability

Performance Considerations:

  • Response size varies based on number of products in the bundle
  • Bundles with extensive custom HTML or large product pools return more data
  • Consider requesting only necessary fields if partial data is sufficient
  • Use batch operations if retrieving multiple bundles

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

Path
idinteger(int64)required
Query
api_keystring

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

Headers
X-API-Keystring
curl -i -X GET \
  'https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}?api_key=string' \
  -H 'X-API-Key: string'

Responses

Build-A-Box bundle successfully retrieved

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", "bundleHandle": "premium-coffee-selection", "uniqueRef": "bab_abc123xyz", "description": "Choose your favorite coffee blends for monthly delivery", "buildABoxType": "SINGLE_PRODUCT", "buildBoxVersion": "V2", "minProductCount": 2, "maxProductCount": 5, "minOrderAmount": 25, "pricingType": "PER_PRODUCT", "discount": 10, "discountType": "PERCENTAGE", "allowOneTimePurchase": true, "thirdPartyRule": false, "trackInventory": true, "active": true, "productViewStyle": "GRID", "proceedToCheckoutButtonText": "Complete Your Subscription", "chooseProductsText": "Build Your Perfect Coffee Box", "availableProducts": [ {}, {} ], "frequencies": [ {}, {} ], "createdAt": "2024-03-15T10:30:00Z", "updatedAt": "2024-03-20T14:45:00Z" }

Delete a Build-A-Box subscription bundle

Request

Permanently removes a Build-A-Box subscription bundle from your shop. This operation is irreversible and will prevent new customers from subscribing to this bundle. However, existing subscriptions using this bundle will remain active.

Important Deletion Rules:

  1. Active Subscriptions Check: The system prevents deletion if there are active subscriptions using this bundle
  2. Alternative Approach: If active subscriptions exist, you must first deactivate the bundle instead of deleting it
  3. Shop Ownership: You can only delete bundles that belong to your authenticated shop
  4. Irreversible: Once deleted, the bundle configuration cannot be recovered
  5. Clean Deletion: Only bundles with zero associated subscriptions can be permanently removed

Deletion Workflow:

1. Request deletion of bundle with ID
2. System checks for shop ownership
3. System counts active subscriptions using this bundle
4. If subscriptions exist → Returns error with subscription count
5. If no subscriptions → Deletes bundle permanently
6. Returns success (204 No Content)

When Deletion is Blocked: The system will prevent deletion and return a 400 error if:

  • One or more active subscriptions are using this bundle
  • The error message will include the exact count of active subscriptions
  • Example: "Deleting Build-A-Box is not possible, 47 subscriptions found. You may deactivate the Build-A-Box."

Recommended Workflow for Active Bundles: If you want to stop offering a bundle that has active subscribers:

  1. Update the bundle to set active: false (this prevents new subscriptions)
  2. Monitor existing subscriptions until they naturally expire or are cancelled
  3. Migrate customers to a different bundle if needed
  4. Delete the bundle once all subscriptions have been resolved

Use Cases:

  • Testing Cleanup: Remove test bundles created during development
  • Failed Configurations: Delete bundles that were incorrectly set up
  • Seasonal Offerings: Remove time-limited bundles after the season ends (if no subscriptions)
  • Product Discontinuation: Clean up bundles for discontinued product lines
  • Duplicate Bundles: Remove accidentally created duplicate configurations

Best Practices:

  • Check Before Deleting: Always verify no active subscriptions exist
  • Use Deactivation First: Set bundles to inactive before attempting deletion
  • Document Changes: Keep records of when and why bundles were deleted
  • Backup Configuration: Save bundle settings before deletion for potential recreation
  • Communicate Changes: Inform team members about bundle removals
  • Consider Archiving: For historical reference, deactivate rather than delete when possible

What Happens After Deletion:

  • Bundle configuration is permanently removed from the database
  • Bundle ID becomes available for reuse (though not recommended)
  • Bundle handle becomes available for new bundles
  • External integrations referencing this bundle will receive 404 errors
  • Analytics and historical data may reference the deleted bundle ID

Error Prevention: Before attempting deletion, you can:

  1. Query active subscriptions to check for bundle usage
  2. Set the bundle to inactive status first
  3. Wait for all subscriptions to complete or migrate customers
  4. Then proceed with deletion

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

Path
idinteger(int64)required
Query
api_keystring

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

Headers
X-API-Keystring
curl -i -X DELETE \
  'https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}?api_key=string' \
  -H 'X-API-Key: string'

Responses

Build-A-Box bundle successfully deleted. No content returned.

Bodyapplication/json
Response
application/json
null

Retrieve Build-A-Box bundle details by handle for customer storefront

Request

Fetches comprehensive Build-A-Box bundle configuration using a user-friendly handle (URL slug) instead of numeric ID. This endpoint is specifically designed for customer-facing storefronts and integration scenarios where you want to reference bundles by their human-readable handles rather than database IDs.

Key Differences from GET /{id}:

  • Lookup Method: Uses bundle handle (e.g., 'premium-coffee-box') instead of numeric ID (e.g., 12345)
  • Response Format: Returns SubscriptionBundlingResponseV3 with enhanced structure
  • Customer Focus: Optimized for storefront display and customer selection workflows
  • Bundle + Subscription: Returns both bundle details AND associated subscription plan information
  • Public Access: Designed for integration in customer-facing applications

What is a Bundle Handle? A handle is a URL-friendly identifier for a bundle:

  • Format: lowercase letters, numbers, and hyphens only
  • Example: premium-coffee-selection, monthly-snack-box, beauty-essentials
  • Stable: Unlike IDs, handles remain consistent across environments
  • SEO-Friendly: Can be used in customer-facing URLs
  • Human-Readable: Easy to remember and communicate

Response Structure (SubscriptionBundlingResponseV3):

{
  "bundle": {           // Complete bundle configuration
    "id": 45678,
    "bundleName": "Premium Coffee Selection",
    "bundleHandle": "premium-coffee-selection",
    "description": "...",
    "products": [...],
    "pricing": {...},
    "active": true
  },
  "subscription": {     // Associated subscription plan details
    "planId": 98765,
    "frequencies": [...],
    "deliveryOptions": {...},
    "sellingPlan": {...}
  }
}

Primary Use Cases:

  1. Storefront Integration: Display bundle details on product pages
  2. Customer Portal: Allow customers to browse available bundles
  3. Landing Pages: Create dedicated pages for specific bundles using handles
  4. Marketing Campaigns: Link directly to bundles with memorable URLs
  5. Cross-Platform Sync: Use stable handles for multi-platform integrations
  6. Mobile Apps: Retrieve bundle data using consistent identifiers
  7. External Integrations: Third-party systems can reference bundles by handle

When to Use Handle vs ID:

  • Use Handle when:

    • Building customer-facing features
    • Creating shareable URLs
    • Syncing across environments (dev → staging → prod)
    • External systems need stable references
    • SEO and user experience are priorities
  • Use ID when:

    • You already have the numeric ID from another API response
    • Performing administrative operations
    • Internal system integration
    • Optimizing for query performance

Availability Validation: The endpoint validates that:

  • Bundle exists and belongs to the specified shop
  • Bundle has an associated subscription configuration
  • If validation fails, returns 404 Not Found
  • Both bundle AND subscription must be present for success response

Integration Examples: Storefront Display:

// Fetch bundle for display on product page
const handle = 'premium-coffee-selection';
const response = await fetch(
  `/api/external/v2/build-a-box/${handle}`,
  { headers: { 'X-API-Key': 'your-api-key' } }
);
const { bundle, subscription } = await response.json();
displayBundleOptions(bundle, subscription);

Best Practices:

  • Handle Naming: Use descriptive, SEO-friendly handles
  • Caching: Cache bundle data with handle as key for better performance
  • Error Handling: Always check for 404 - bundle may be deleted or deactivated
  • Environment Sync: Use handles to maintain consistency across environments
  • URL Structure: Incorporate handles into clean, readable URLs
  • Documentation: Document handle conventions for your team

Performance Considerations:

  • Handle lookups may be slightly slower than ID lookups
  • Response includes full bundle + subscription data (larger payload)
  • Consider caching for frequently accessed bundles
  • Returns complete product catalog for the bundle

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

Path
handlestringrequired

Bundle Handle

Query
api_keystring

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

Headers
X-API-Keystring
curl -i -X GET \
  'https://subscription-admin.appstle.com/api/external/v2/build-a-box/{handle}?api_key=string' \
  -H 'X-API-Key: string'

Responses

Bundle and subscription details successfully retrieved

Bodyapplication/json
bundleobject(SubscriptionBundling)
subscriptionPlanProductInfoMapobject
subscriptionPlanVariantMapobject
subscriptionGroupPlansArray of objects(SubscriptionGroupPlan)
subscriptionobject(SubscriptionGroupPlan)
productsArray of objects(ProductInfo)
variantsArray of strings
Response
application/json
{ "bundle": { "id": 45678, "shop": "example-shop.myshopify.com", "bundleName": "Premium Coffee Selection", "bundleHandle": "premium-coffee-selection", "uniqueRef": "bab_abc123xyz", "description": "Choose your favorite coffee blends for monthly delivery", "buildABoxType": "SINGLE_PRODUCT", "buildBoxVersion": "V2", "minProductCount": 2, "maxProductCount": 5, "discount": 10, "discountType": "PERCENTAGE", "allowOneTimePurchase": true, "active": true, "products": [] }, "subscription": { "subscriptionPlanId": 98765, "sellingPlanGroupId": "gid://shopify/SellingPlanGroup/123456", "frequencies": [], "deliveryPolicy": {} }, "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