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.
- Retrieve raw Shopify GraphQL response for a subscription contract
External APIs (0.0.1)
Request
Retrieves a paginated list of subscription contracts with powerful filtering capabilities. This endpoint enables complex queries to find specific subscriptions based on various criteria including dates, customer information, product details, and subscription characteristics.
Key Features:
- Comprehensive filtering across 20+ parameters
- Full pagination support with customizable page size
- Partial text matching for customer and order searches
- Date range filtering for multiple date fields
- Product and variant filtering within line items
- Order amount range filtering
- Plan type differentiation (prepaid vs pay-per-delivery)
Pagination:
- Uses Spring's Pageable format
- Default page size: 20 items
- Maximum page size: 2000 items (exceeding this limit will result in a 400 error)
- Returns total count in X-Total-Count header
- Provides navigation links in Link header
IMPORTANT - Sorting Limitations: Due to the use of native SQL queries, sort parameters MUST use database column names (snake_case) rather than Java field names (camelCase).
Common sorting examples:
sort=next_billing_date,asc(NOT nextBillingDate)sort=customer_name,desc(NOT customerName)sort=created_at,asc(NOT createdAt)sort=subscription_contract_id,desc(NOT subscriptionContractId)sort=order_amount,asc(NOT orderAmount)
Date Format: All date parameters use ISO 8601 format with timezone: yyyy-MM-dd'T'HH:mm:ssXXX Examples: 2024-03-15T10:30:00+00:00 or 2024-03-15T10:30:00Z
Date Range Filtering:
- For created, updated dates: Can use either 'from', 'to', or both
- For next billing date: Both 'from' and 'to' must be provided together (current limitation)
Text Search Behavior:
- Customer name searches both name and email fields
- Order name searches current and historical orders (in subscription_billing_attempt table)
- All text searches are case-insensitive
- Partial matches are supported (contains logic)
- Subscription contract ID search supports partial numeric matching
Plan Type Classification:
- prepaid: Billing interval > delivery interval
- non-prepaid: Billing interval = delivery interval
Performance Considerations:
- Complex filters (especially JSON searches and order amount calculations) may impact response time
- Use specific filters when possible
- Consider smaller page sizes for complex queries
- Product, variant, and selling plan searches use JSON_SEARCH which may be slow on large datasets
Authentication: Requires valid X-API-Key header (the deprecated 'api_key' query parameter is still accepted but not recommended)
Filter by subscriptions created on or after this date
Filter by subscriptions created on or before this date
Filter by subscriptions updated on or after this date
Filter by subscriptions updated on or before this date
Filter by subscriptions with next billing date on or after this date. Note: Both fromNextDate and toNextDate must be provided together
Filter by subscriptions with next billing date on or before this date. Note: Both fromNextDate and toNextDate must be provided together
Filter by subscription contract ID (partial match supported, case-insensitive)
Filter by customer name or email (partial match, case-insensitive). Searches both customer_name and customer_email fields
Filter by order number (searches current order_name and historical orders in subscription_billing_attempt table, partial match)
Filter by subscription status (case-insensitive)
Filter by delivery interval count (Note: This parameter name is misleading - it actually filters the delivery_policy_interval_count field)
Filter by delivery interval type (Note: This parameter name is misleading - it actually filters the delivery_policy_interval field)
Filter by plan type classification. 'prepaid' = billing interval count ≠ delivery interval count, 'non-prepaid' = billing interval count = delivery interval count
Filter by record type. 'imported' = has imported_id, 'nonImported' = no imported_id
Filter by product ID (searches within subscription line items JSON). Provide numeric ID only
Filter by variant ID (searches within subscription line items JSON). Provide numeric ID only
Filter by selling plan ID (searches within subscription line items JSON). Provide numeric ID only
Filter by minimum total order amount (calculated from sum of line items: quantity * currentPrice)
Filter by maximum total order amount (calculated from sum of line items: quantity * currentPrice)
Pagination and sorting parameters. IMPORTANT: Sort fields must use database column names (snake_case), not Java field names. Maximum page size is 2000.
- https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details?fromCreatedDate=2025-10-01T00%3A00%3A00%2B02%3A00&toCreatedDate=2025-10-31T23%3A59%3A59%2B02%3A00&fromUpdatedDate=2025-10-01T00%3A00%3A00%2B02%3A00&toUpdatedDate=2025-10-31T23%3A59%3A59%2B02%3A00&fromNextDate=2025-10-01T00%3A00%3A00%2B02%3A00&toNextDate=2025-10-31T23%3A59%3A59%2B02%3A00&subscriptionContractId=123456&customerName=john&orderName=SUB-1001&status=ACTIVE&billingPolicyIntervalCount=1&billingPolicyInterval=MONTH&planType=prepaid&recordType=imported&productId=7890123456&variantId=42549172011164&sellingPlanId=123456&minOrderAmount=50&maxOrderAmount=500&pageable=page%3D0%26size%3D20%26sort%3Dnext_billing_date%2Casc%26sort%3Did%2Cdesc&api_key=string' \
-H 'X-API-Key: sk_live_1234567890abcdef'Successfully retrieved subscription contracts
[ { "id": 1001, "subscriptionContractId": 123456789, "graphSubscriptionContractId": "gid://shopify/SubscriptionContract/123456789", "status": "active", "customerId": 987654321, "customerName": "John Doe", "customerEmail": "john.doe@example.com", "orderName": "#SUB-1001", "nextBillingDate": "2024-04-01T12:00:00.000+00:00", "billingPolicyInterval": "MONTH", "billingPolicyIntervalCount": 1, "deliveryPolicyInterval": "MONTH", "deliveryPolicyIntervalCount": 1, "totalPrice": 99.99, "currencyCode": "USD", "createdAt": "2024-01-15T08:00:00.000+00:00", "updatedAt": "2024-03-01T14:30:00.000+00:00", "contractDetailsJson": [ … ], "minCycles": 3, "maxCycles": null, "activatedOn": "2024-01-15T08:00:00.000+00:00", "pausedOn": null, "cancelledOn": null, "importedId": null }, { "id": 1002, "subscriptionContractId": 123456790, "status": "paused", "customerId": 987654322, "customerName": "Jane Smith", "customerEmail": "jane.smith@example.com", "orderName": "#SUB-1002", "nextBillingDate": "2024-05-01T12:00:00.000+00:00", "billingPolicyInterval": "MONTH", "billingPolicyIntervalCount": 3, "deliveryPolicyInterval": "MONTH", "deliveryPolicyIntervalCount": 1, "totalPrice": 149.97, "currencyCode": "USD", "createdAt": "2024-02-01T10:00:00.000+00:00", "updatedAt": "2024-03-10T16:45:00.000+00:00" } ]
Request
Fetches the complete, unprocessed JSON response directly from Shopify's GraphQL API for the specified subscription contract. This endpoint returns the full subscription data structure as provided by Shopify, including all nested objects and relationships.
Use Cases:
- Debugging subscription issues
- Accessing all available subscription data
- Understanding the complete data structure
- Building custom integrations
Response Structure: The response includes complete details about:
- Customer information (email, name, ID)
- Line items (products, quantities, pricing)
- Billing and delivery policies
- Payment method details
- Discounts and pricing policies
- Order history and billing attempts
- Custom attributes and notes
Note: This is a direct Shopify response with GraphQL type information (__typename fields)
Authentication: Requires valid X-API-Key header
- https://subscription-admin.appstle.com/api/external/v2/contract-raw-response
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://subscription-admin.appstle.com/api/external/v2/contract-raw-response?contractId=26833420451&api_key=string' \
-H 'X-API-Key: sk_live_1234567890abcdef'{ "subscriptionContract": { "__typename": "SubscriptionContract", "id": "gid://shopify/SubscriptionContract/26833420451", "createdAt": "2025-06-19T12:19:21Z", "updatedAt": "2025-06-19T12:19:25Z", "nextBillingDate": "2025-07-19T12:00:00Z", "status": "ACTIVE", "deliveryPrice": { … }, "lastPaymentStatus": null, "billingPolicy": { … }, "deliveryPolicy": { … }, "lines": { … }, "customerPaymentMethod": { … }, "customer": { … }, "originOrder": { … }, "note": null, "customAttributes": [], "discounts": { … } } }
Request
Cancels an existing subscription contract. This operation terminates all future billing and delivery cycles for the subscription. The cancellation takes effect immediately.
Important Notes:
- Any pending/scheduled orders will be cancelled
- The customer will receive a cancellation confirmation email if SUBSCRIPTION_CANCELLED email template is enabled
- Cancellation feedback and notes are stored for analytics and reporting
- Minimum cycle requirements ARE enforced via API (unlike internal cancellations)
- If the subscription is under a free trial period, minimum cycles are not enforced
Validation Rules:
- Contract must exist and belong to the authenticated shop
- Contract must not already be cancelled
- Must have completed minimum required billing cycles (unless in trial)
Post-Cancellation:
- Status changes to 'cancelled' (lowercase)
- Any pause settings are cleared
- Cancellation feedback and notes are saved
- Activity log entry is created
- Cancellation email is sent (if enabled)
- Any invalid discount codes are automatically removed
Authentication: Requires valid X-API-Key header
Optional feedback from the customer about why they are cancelling. This information is valuable for understanding cancellation reasons and improving retention. Common values include: 'Too expensive', 'No longer needed', 'Found alternative', 'Quality issues', 'Delivery issues', 'Customer service', 'Product not as expected', etc. This field is stored permanently with the contract for analytics.
Optional internal note for recording additional cancellation context. This field is for internal use and not visible to customers. Can be used to track special circumstances, support ticket references, competitor information, or other relevant details about why the customer cancelled. This note is stored permanently with the contract.
- https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{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-contracts/123456789?cancellationFeedback=Too+expensive&cancellationNote=Customer+switching+to+competitor+X+due+to+pricing.+Support+ticket+%2312345'No content