Skip to content

External (0.0.1)

Languages
Servers
https://membership-admin.appstle.com

Shipping & Delivery Profiles

APIs for managing Shopify delivery profiles, shipping rates, zones, and free shipping configuration for subscription memberships

Operations

Customer Discount History

APIs for retrieving historical discount code usage and redemption information for membership contracts

Operations

Cancellation Flow Configuration

APIs for managing membership cancellation flow settings including retention offers, survey questions, and cancel confirmation screens

Operations

Billing & Orders

APIs for managing membership billing attempts, recurring orders, payment retries, order history, and order skipping

Operations

One-Time Add-Ons

APIs for managing one-time product additions to upcoming subscription orders, including adding, retrieving, and removing one-off items

Operations

Membership Plans

APIs for managing membership/subscription plan groups, including creating plans, configuring discounts, billing intervals, and assigning products to plans

Operations

Product Bundles

APIs for managing subscription product bundles, bundle configurations, item grouping, and bundle-specific discount codes

Operations

Custom CSS Styling

APIs for retrieving custom CSS styles applied to subscription widgets and customer portal for theme customization

Operations

Customer Portal Configuration

APIs for managing customer portal settings including UI customization, text labels, feature toggles, and branding options for the member self-service portal

Operations

Membership Contracts

APIs for managing membership/subscription contracts including creation, updates, status changes, line items, discounts, and billing operations

Operations

Apply discount code to subscription

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

Query
contractIdinteger(int64)required

Subscription contract ID to apply discount to

Example: contractId=123456789
api_keystring

API Key (Deprecated - Use Header X-API-Key instead)

discountCodestringrequired

Shopify discount code to apply

Example: discountCode=SUMMER2024
Headers
X-API-Keystring
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'

Responses

Discount code successfully applied to subscription

Bodyapplication/json
get__typenamestring
idstring
createdAtobject
updatedAtobject
nextBillingDateobject
statusstring
Enum"ACTIVE""PAUSED""CANCELLED""EXPIRED""FAILED""$UNKNOWN"
deliveryPriceobject(DeliveryPrice)
lastPaymentStatusstring
Enum"SUCCEEDED""FAILED""$UNKNOWN"
billingPolicyobject(BillingPolicy)
deliveryPolicyobject(DeliveryPolicy)
linesobject(Lines)
customerPaymentMethodobject(CustomerPaymentMethod)
deliveryMethodobject(DeliveryMethod)
originOrderobject(OriginOrder)
customerobject(Customer)
discountsobject(Discounts)
notestring
customAttributesArray of objects(CustomAttribute1)
billingAttemptsobject(BillingAttempts)
Response
application/json
{ "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": [] } }

Add product to recurring subscription

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

Query
contractIdinteger(int64)required

Subscription contract ID to add product to

Example: contractId=123456789
api_keystring

API Key (Deprecated - Use Header X-API-Key instead)

quantityinteger(int32)required

Quantity of the product to add

Example: quantity=2
variantIdstringrequired

Shopify product variant ID

Example: variantId=12345678
Headers
X-API-Keystring
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'

Responses

Product successfully added to subscription

Bodyapplication/json
get__typenamestring
idstring
createdAtobject
updatedAtobject
nextBillingDateobject
statusstring
Enum"ACTIVE""PAUSED""CANCELLED""EXPIRED""FAILED""$UNKNOWN"
deliveryPriceobject(DeliveryPrice)
lastPaymentStatusstring
Enum"SUCCEEDED""FAILED""$UNKNOWN"
billingPolicyobject(BillingPolicy)
deliveryPolicyobject(DeliveryPolicy)
linesobject(Lines)
customerPaymentMethodobject(CustomerPaymentMethod)
deliveryMethodobject(DeliveryMethod)
originOrderobject(OriginOrder)
customerobject(Customer)
discountsobject(Discounts)
notestring
customAttributesArray of objects(CustomAttribute1)
billingAttemptsobject(BillingAttempts)
Response
application/json
{ "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": [] } }

Create and add custom discount to subscription

Request

Creates a custom discount and applies it to a subscription contract. This endpoint allows you to create on-the-fly discounts without requiring pre-existing discount codes in Shopify.

Discount Creation & Application:

  • Custom Discount: Creates discount directly on subscription contract
  • Flexible Types: Supports percentage off or fixed amount off
  • Cycle Limits: Optional limit on number of billing cycles discount applies
  • Item-Level Control: Option to apply discount to each item vs entire order
  • Immediate Effect: Discount applies to next billing cycle

Discount Parameters:

  • Percentage: Percentage discount (e.g., 15 for 15% off) - use for discountType='PERCENTAGE'
  • Amount: Fixed amount discount (e.g., 10.00 for $10 off) - use for discountType='FIXED_AMOUNT'
  • Title: Display name for the discount (e.g., 'Loyalty Discount')
  • Cycle Limit: Number of billing cycles discount applies (null = unlimited)
  • Applies On Each Item: true = per-item discount, false = order-level discount

Discount Types:

  • PERCENTAGE: Percentage-based discount (use 'percentage' parameter)
  • FIXED_AMOUNT: Fixed dollar amount discount (use 'amount' parameter)

Cycle Limit Examples:

  • recurringCycleLimit=1: Discount for first order only
  • recurringCycleLimit=3: Discount for first 3 orders
  • recurringCycleLimit=null: Discount applies forever

Use Cases:

  • Customer retention offers (e.g., 20% off next 3 orders)
  • Loyalty rewards and point redemptions
  • Win-back campaigns with limited-time discounts
  • Customer service compensation discounts
  • Referral program rewards
  • First-order discounts for new subscribers
  • Seasonal promotions on existing subscriptions

Example Scenarios:

  1. Retention Offer: 25% off for 2 billing cycles
    • percentage=25, recurringCycleLimit=2, discountType='PERCENTAGE'
  2. Loyalty Reward: $5 off every order forever
    • amount=5.00, recurringCycleLimit=null, discountType='FIXED_AMOUNT'
  3. First Order Deal: 50% off first order only
    • percentage=50, recurringCycleLimit=1, discountType='PERCENTAGE'

Returns: Updated subscription contract object with discount applied

Authentication: Requires API key authentication via X-API-Key header or api_key parameter

Query
contractIdinteger(int64)required

Subscription contract ID to add discount to

Example: contractId=123456789
api_keystring

API Key (Deprecated - Use Header X-API-Key instead)

percentageinteger(int32)

Percentage discount value (use with discountType=PERCENTAGE)

Example: percentage=15
discountTitlestring

Display title for the discount

Example: discountTitle=Loyalty Discount
recurringCycleLimitinteger(int32)

Number of billing cycles discount applies (null for unlimited)

Example: recurringCycleLimit=3
appliesOnEachItemboolean

Apply discount to each item individually (true) or entire order (false)

amountnumber(double)

Fixed amount discount value (use with discountType=FIXED_AMOUNT)

Example: amount=10
discountTypestring

Discount type: PERCENTAGE or FIXED_AMOUNT

Example: discountType=PERCENTAGE
Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-add-discount?contractId=123456789&api_key=string&percentage=15&discountTitle=Loyalty+Discount&recurringCycleLimit=3&appliesOnEachItem=true&amount=10&discountType=PERCENTAGE' \
  -H 'X-API-Key: string'

Responses

Discount successfully created and applied to subscription

Bodyapplication/json
get__typenamestring
idstring
createdAtobject
updatedAtobject
nextBillingDateobject
statusstring
Enum"ACTIVE""PAUSED""CANCELLED""EXPIRED""FAILED""$UNKNOWN"
deliveryPriceobject(DeliveryPrice)
lastPaymentStatusstring
Enum"SUCCEEDED""FAILED""$UNKNOWN"
billingPolicyobject(BillingPolicy)
deliveryPolicyobject(DeliveryPolicy)
linesobject(Lines)
customerPaymentMethodobject(CustomerPaymentMethod)
deliveryMethodobject(DeliveryMethod)
originOrderobject(OriginOrder)
customerobject(Customer)
discountsobject(Discounts)
notestring
customAttributesArray of objects(CustomAttribute1)
billingAttemptsobject(BillingAttempts)
Response
application/json
{ "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": [] } }

Bundle Settings

APIs for managing subscription bundle configuration settings including bundle behavior, pricing rules, and display options

Operations

Customer Payment Methods

APIs for managing customer payment methods, payment tokens, and payment method retrieval for subscriptions

Operations

Product Swap Rules

APIs for retrieving product swap/substitution options allowing members to exchange subscription items based on configured swap rules and variant groups

Operations

Subscription Contract Management

Operations

Subscription Billing

Operations

Billing Attempts

Operations