APIs for managing Shopify delivery profiles, shipping rates, zones, and free shipping configuration for subscription memberships
- Apply discount code to subscription
External (0.0.1)
Request
Removes a discount from a subscription contract. This endpoint allows you to remove previously applied discounts, restoring the subscription to full price.
Discount Removal Process:
- Identify Discount: Uses discount ID to locate specific discount on contract
- Remove From Contract: Removes discount allocation from subscription
- Recalculate Pricing: Updates subscription pricing to remove discount
- Activity Logging: Records discount removal event
- Immediate Effect: Changes apply to next billing cycle
Key Features:
- Selective Removal: Remove specific discounts by ID
- Price Restoration: Returns subscription to original or remaining discount pricing
- Multiple Discount Support: Works with subscriptions having multiple discounts
- Activity Tracking: Logs removal for audit trail
Finding Discount ID:
- Retrieve subscription contract details to see applied discounts
- Each discount has a unique Shopify GraphQL ID
- Format:
gid://shopify/SubscriptionManualDiscount/[ID]
Use Cases:
- End limited-time promotional discounts
- Remove expired retention offers
- Customer service discount adjustments
- Clean up incorrectly applied discounts
- Remove trial period pricing
- End referral program bonuses
Returns: Updated subscription contract object with discount removed
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
- https://membership-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount?contractId=123456789&api_key=string&discountId=gid%3A%2F%2Fshopify%2FSubscriptionManualDiscount%2F123456789' \
-H 'X-API-Key: string'{ "get__typename": "string", "id": "string", "createdAt": {}, "updatedAt": {}, "nextBillingDate": {}, "status": "ACTIVE", "deliveryPrice": { "get__typename": "string", "amount": {}, "currencyCode": "USD" }, "lastPaymentStatus": "SUCCEEDED", "billingPolicy": { "get__typename": "string", "interval": "DAY", "intervalCount": 0, "anchors": [ … ], "maxCycles": 0, "minCycles": 0 }, "deliveryPolicy": { "get__typename": "string", "interval": "DAY", "intervalCount": 0, "anchors": [ … ] }, "lines": { "get__typename": "string", "nodes": [ … ], "pageInfo": { … } }, "customerPaymentMethod": { "get__typename": "string", "id": "string", "instrument": { … }, "revokedAt": {}, "revokedReason": "AUTHORIZE_NET_GATEWAY_NOT_ENABLED" }, "deliveryMethod": { "get__typename": "string", "id": "string", "methodType": "SHIPPING", "serviceCode": "string", "minDeliveryDateTime": {}, "maxDeliveryDateTime": {}, "additionalInformation": { … }, "brandedPromise": { … } }, "originOrder": { "get__typename": "string", "id": "string", "name": "string", "fulfillmentOrders": { … } }, "customer": { "get__typename": "string", "id": "string", "email": "string", "displayName": "string", "firstName": "string", "lastName": "string", "phone": "string" }, "discounts": { "get__typename": "string", "nodes": [ … ], "pageInfo": { … } }, "note": "string", "customAttributes": [ { … } ], "billingAttempts": { "get__typename": "string", "nodes": [ … ] } }
Request
Applies an existing Shopify discount code to a subscription contract. The discount code must already exist in Shopify and be valid for subscription usage.
Discount Application Process:
- Code Validation: Verifies discount code exists in Shopify
- Eligibility Check: Ensures code is valid for subscription use
- Contract Update: Applies discount to subscription contract
- Price Recalculation: Updates subscription pricing with discount applied
- Activity Logging: Records discount application event
Key Features:
- Existing Code Support: Uses Shopify discount codes already created in admin
- Automatic Validation: Checks code validity and subscription eligibility
- Immediate Application: Discount applies to next billing cycle
- Contract Synchronization: Keeps Shopify contract in sync with discount
Discount Code Requirements:
- Must exist in Shopify admin
- Must be active and not expired
- Must be eligible for subscription purchases
- Usage limits must not be exceeded
Use Cases:
- Allow customers to apply promotional codes to existing subscriptions
- Customer service applying retention discounts
- Reward program integration with discount codes
- Referral program discount application
- Seasonal promotion code application
- Win-back campaign discount codes
Returns: Updated subscription contract object with discount applied
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
- https://membership-admin.appstle.com/api/external/v2/subscription-contracts-apply-discount
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-apply-discount?contractId=123456789&api_key=string&discountCode=SUMMER2024' \
-H 'X-API-Key: string'{ "get__typename": "string", "id": "string", "createdAt": {}, "updatedAt": {}, "nextBillingDate": {}, "status": "ACTIVE", "deliveryPrice": { "get__typename": "string", "amount": {}, "currencyCode": "USD" }, "lastPaymentStatus": "SUCCEEDED", "billingPolicy": { "get__typename": "string", "interval": "DAY", "intervalCount": 0, "anchors": [ … ], "maxCycles": 0, "minCycles": 0 }, "deliveryPolicy": { "get__typename": "string", "interval": "DAY", "intervalCount": 0, "anchors": [ … ] }, "lines": { "get__typename": "string", "nodes": [ … ], "pageInfo": { … } }, "customerPaymentMethod": { "get__typename": "string", "id": "string", "instrument": { … }, "revokedAt": {}, "revokedReason": "AUTHORIZE_NET_GATEWAY_NOT_ENABLED" }, "deliveryMethod": { "get__typename": "string", "id": "string", "methodType": "SHIPPING", "serviceCode": "string", "minDeliveryDateTime": {}, "maxDeliveryDateTime": {}, "additionalInformation": { … }, "brandedPromise": { … } }, "originOrder": { "get__typename": "string", "id": "string", "name": "string", "fulfillmentOrders": { … } }, "customer": { "get__typename": "string", "id": "string", "email": "string", "displayName": "string", "firstName": "string", "lastName": "string", "phone": "string" }, "discounts": { "get__typename": "string", "nodes": [ … ], "pageInfo": { … } }, "note": "string", "customAttributes": [ { … } ], "billingAttempts": { "get__typename": "string", "nodes": [ … ] } }
Request
Adds a new product variant to a subscription contract's recurring line items. The product will be included in all future recurring orders.
Product Addition Process:
- Variant Validation: Verifies product variant exists and is available
- Add to Contract: Adds line item to subscription's recurring products
- Quantity Setting: Sets initial quantity for the product
- Price Calculation: Calculates pricing including any applicable discounts
- Shipping Update: May recalculate shipping if weight/dimensions change
- Activity Logging: Records product addition event
Key Features:
- Recurring Addition: Product added to every future order
- Quantity Control: Specify exact quantity to add
- Discount Inheritance: New item inherits subscription-level discounts
- Immediate Effect: Applies to next billing cycle
- Freeze Protection: Validates subscription isn't frozen before minimum cycles
Variant ID Format:
- Accepts Shopify variant ID as string
- Can be numeric ID or GraphQL format
- Example: "12345678" or "gid://shopify/ProductVariant/12345678"
Use Cases:
- Customer upgrades subscription to include more products
- Cross-sell additional products to existing subscribers
- Allow customers to customize subscriptions in portal
- Add seasonal products to subscriptions
- Build-a-box subscription customization
- Upsell workflows during customer interactions
Important Notes:
- Product must be available for purchase
- Subscription must not be frozen (before min cycles)
- Price updates automatically with subscription billing
- Quantity must be positive integer
Returns: Updated subscription contract object with new line item
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
- https://membership-admin.appstle.com/api/external/v2/subscription-contracts-add-line-item
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-add-line-item?contractId=123456789&api_key=string&quantity=2&variantId=12345678' \
-H 'X-API-Key: string'{ "get__typename": "string", "id": "string", "createdAt": {}, "updatedAt": {}, "nextBillingDate": {}, "status": "ACTIVE", "deliveryPrice": { "get__typename": "string", "amount": {}, "currencyCode": "USD" }, "lastPaymentStatus": "SUCCEEDED", "billingPolicy": { "get__typename": "string", "interval": "DAY", "intervalCount": 0, "anchors": [ … ], "maxCycles": 0, "minCycles": 0 }, "deliveryPolicy": { "get__typename": "string", "interval": "DAY", "intervalCount": 0, "anchors": [ … ] }, "lines": { "get__typename": "string", "nodes": [ … ], "pageInfo": { … } }, "customerPaymentMethod": { "get__typename": "string", "id": "string", "instrument": { … }, "revokedAt": {}, "revokedReason": "AUTHORIZE_NET_GATEWAY_NOT_ENABLED" }, "deliveryMethod": { "get__typename": "string", "id": "string", "methodType": "SHIPPING", "serviceCode": "string", "minDeliveryDateTime": {}, "maxDeliveryDateTime": {}, "additionalInformation": { … }, "brandedPromise": { … } }, "originOrder": { "get__typename": "string", "id": "string", "name": "string", "fulfillmentOrders": { … } }, "customer": { "get__typename": "string", "id": "string", "email": "string", "displayName": "string", "firstName": "string", "lastName": "string", "phone": "string" }, "discounts": { "get__typename": "string", "nodes": [ … ], "pageInfo": { … } }, "note": "string", "customAttributes": [ { … } ], "billingAttempts": { "get__typename": "string", "nodes": [ … ] } }