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.
- Add one-time product to subscription order
External APIs (0.0.1)
Request
Adds a one-time product (add-on) to a specific subscription order. The product will be included only in the specified billing attempt and will not recur in future orders. This endpoint is idempotent - attempting to add the same product to the same billing attempt will return success without creating duplicates.
Important Behaviors:
- If the specified billingAttemptId is not valid or not QUEUED, the system will automatically add the product to the next upcoming order
- The system prevents duplicate products (same variantId) in the same billing attempt
- Products are automatically removed after the associated order is processed
- Activity logs are created for audit trails
Validation Rules:
- Contract must belong to the authenticated shop
- Contract must not be frozen (minimum cycles restriction)
- At least one QUEUED billing attempt must exist
- Variant must be a valid Shopify product variant
Use Cases:
- Allow customers to add special items to their next delivery
- Enable upselling opportunities in customer portals
- Programmatically add promotional or seasonal items
- Implement "try before you subscribe" features
Authentication: Requires valid X-API-Key header that identifies the shop
The unique identifier of the subscription contract
The billing attempt ID to add the product to. If invalid or not QUEUED, the system will automatically use the next upcoming order.
The Shopify product variant ID to add as a one-time purchase
The handle/slug of the product variant for URL-friendly identification
The quantity of the product to add. Defaults to 1 if not specified.
- https://subscription-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id
- 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-contract-one-offs-by-contractId-and-billing-attempt-id?contractId=98765&billingAttemptId=54321&variantId=42549172011164&variantHandle=premium-coffee-blend-500g&quantity=2&api_key=sk_live_1234567890abcdef' \
-H 'X-API-Key: sk_live_1234567890abcdef'Successfully added one-time product or product already exists. Returns all one-time products for the contract.
The Shopify store domain that owns this subscription
The billing attempt ID this one-time product is associated with. This determines which upcoming order will include this product.
The subscription contract ID this one-time product belongs to
The Shopify product variant ID for this one-time product
The handle/slug of the product variant for URL-friendly identification
The price per unit of this product in the shop's base currency. This may include any applicable discounts.
[ { "id": 12345, "shop": "example-store.myshopify.com", "subscriptionContractId": 98765, "billingAttemptId": 54321, "variantId": 42549172011164, "variantHandle": "premium-coffee-blend-500g", "quantity": 2, "price": 19.99 }, { "id": 12350, "shop": "example-store.myshopify.com", "subscriptionContractId": 98765, "billingAttemptId": 54321, "variantId": 42549172011167, "variantHandle": "coffee-sampler-pack", "quantity": 1, "price": 29.99 } ]
Request
Removes a previously added one-time product from a specific subscription order. This permanently deletes the one-time product from the specified billing attempt. The operation is idempotent - attempting to delete a non-existent product will succeed without error.
Important Notes:
- Only removes the product from the specified billing attempt
- Cannot remove products from billing attempts that are already processed
- Activity logs are created for audit trails
- Returns the updated list of all one-time products for the contract
Use Cases:
- Allow customers to remove unwanted add-ons before order processing
- Clean up cart-like functionality in customer portals
- Programmatically manage one-time product selections
- Implement "undo" functionality for product additions
Business Rules:
- Contract must belong to the authenticated shop
- The specific combination of contractId + billingAttemptId + variantId identifies the product to remove
- No error is thrown if the product doesn't exist (idempotent operation)
Authentication: Requires valid X-API-Key header that identifies the shop
- https://subscription-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://subscription-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id?contractId=98765&billingAttemptId=54321&variantId=42549172011164&api_key=sk_live_1234567890abcdef' \
-H 'X-API-Key: sk_live_1234567890abcdef'Successfully removed the one-time product or product didn't exist. Returns all remaining one-time products for the contract.
The Shopify store domain that owns this subscription
The billing attempt ID this one-time product is associated with. This determines which upcoming order will include this product.
The subscription contract ID this one-time product belongs to
The Shopify product variant ID for this one-time product
The handle/slug of the product variant for URL-friendly identification
The price per unit of this product in the shop's base currency. This may include any applicable discounts.
[ { "id": 12345, "shop": "example-store.myshopify.com", "subscriptionContractId": 98765, "billingAttemptId": 54321, "variantId": 42549172011164, "variantHandle": "premium-coffee-blend-500g", "quantity": 2, "price": 19.99 } ]
Request
Retrieves one-time products that will be included in the next scheduled order for a subscription contract. This endpoint specifically returns products associated with the earliest queued billing attempt, making it ideal for showing customers what additional items will be in their next delivery.
Key Differences from /subscription-contract-one-offs-by-contractId:
- Returns ONLY products for the next upcoming order (not all future orders)
- Finds the earliest QUEUED billing attempt by date
- Returns empty array if no queued billing attempts exist
- Useful for "Your Next Order" previews in customer portals
Use Cases:
- Display a preview of the next order including one-time add-ons
- Calculate the total cost of the upcoming delivery
- Show customers their next delivery date with associated one-time items
- Allow last-minute modifications before order processing
Business Logic:
- Searches for billing attempts with status = QUEUED
- Selects the one with the earliest billing date
- Returns all one-time products for that specific billing attempt
- Returns empty array if no queued orders exist (e.g., subscription paused/cancelled)
Authentication: Requires valid X-API-Key header that identifies the shop
- https://subscription-admin.appstle.com/api/external/v2/upcoming-subscription-contract-one-offs-by-contractId
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://subscription-admin.appstle.com/api/external/v2/upcoming-subscription-contract-one-offs-by-contractId?contractId=98765&api_key=sk_live_1234567890abcdef' \
-H 'X-API-Key: sk_live_1234567890abcdef'Successfully retrieved next order one-time products
The Shopify store domain that owns this subscription
The billing attempt ID this one-time product is associated with. This determines which upcoming order will include this product.
The subscription contract ID this one-time product belongs to
The Shopify product variant ID for this one-time product
The handle/slug of the product variant for URL-friendly identification
The price per unit of this product in the shop's base currency. This may include any applicable discounts.
[ { "id": 12345, "shop": "example-shop.myshopify.com", "contractId": 67890, "billingAttemptId": 11111, "variantId": 22222, "quantity": 2, "productTitle": "Coffee Filters - Pack of 100", "variantTitle": "Standard Size", "image": "https://cdn.shopify.com/s/files/1/0000/0000/products/filter.jpg", "price": "9.99", "currencyCode": "USD" } ]