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.
- Cancel a subscription contract
External APIs (0.0.1)
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