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.
External APIs (0.0.1)
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
- https://subscription-admin.appstle.com/api/external/v2/subscription-bundlings/discount/{token}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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": [
{}
]
}
}'{ "discountCode": "BUNDLE10", "discountId": "gid://shopify/DiscountCodeNode/123456", "discountType": "PERCENTAGE", "discountValue": 10, "expiresAt": "2024-12-31T23:59:59Z", "usageLimit": 100, "currentUsageCount": 0, "active": true }
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
- https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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
]
}
]
}
]'{ "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 }
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:
- Add/Remove Products: Update the available product pool
- Adjust Pricing: Change discount percentages or pricing models
- Modify Limits: Update minimum/maximum product selection rules
- Change Frequencies: Add or remove subscription interval options
- Update Content: Modify bundle name, description, or images
- Toggle Status: Activate or deactivate bundle availability
- 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)
- https://subscription-admin.appstle.com/api/external/v2/build-a-box
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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
}'{ "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" }