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

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

Update subscription contract status (pause/resume/activate)

Request

Changes the status of a subscription contract. This allows pausing, resuming, or activating subscriptions to control billing and delivery.

Key Features:

  • Pause Subscriptions: Temporarily stop billing and deliveries
  • Resume Subscriptions: Reactivate paused subscriptions
  • Activate Subscriptions: Start inactive subscriptions
  • Activity Logging: All status changes are logged for audit trail
  • Customer Restrictions: Includes minimum cycle checks when called from customer portal

Status Values:

  • ACTIVE: Subscription is active and billing/delivering normally
  • PAUSED: Subscription is temporarily paused (no billing, no deliveries)
  • CANCELLED: Subscription is cancelled (use DELETE endpoint instead)

Pause vs. Cancel:

  • Pause: Temporary hold, customer can resume anytime
  • Cancel: Permanent termination, requires creating new subscription to restart

Common Use Cases:

  • Vacation Hold: Customer going on vacation, pause deliveries temporarily
  • Financial Pause: Customer needs temporary break from payments
  • Product Surplus: Customer has too much product, pause until they use it
  • Seasonal Pause: Pause subscriptions during off-season (e.g., lawn care in winter)
  • Resume After Pause: Customer ready to restart after temporary hold
  • Reactivate Failed: Reactivate subscription after payment method updated

Pause Behavior:

  • Billing Paused: No charges while paused
  • Deliveries Paused: No orders created while paused
  • Next Billing Date: Preserved or recalculated on resume (merchant setting)
  • Unlimited Duration: Pauses can be indefinite unless merchant sets limits

Resume Behavior:

  • Immediate Reactivation: Subscription becomes active immediately
  • Next Billing Date: Calculated based on pause duration settings
  • Deliveries Resume: Next delivery scheduled according to interval

Customer Portal Restrictions: When called from customer portal (vs. merchant API):

  • Minimum Cycles: Cannot pause/cancel until minimum billing cycles met
  • Freeze Period: Updates may be frozen until minimum requirements satisfied
  • Retention Rules: Special retention discounts may be offered on cancellation

Important Notes:

  • Customer Communication: Consider sending email notifications on status changes
  • Billing Cycles Not Lost: Paused cycles don't count toward minimums
  • No Pro-rata: No refunds or credits when pausing mid-cycle

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
statusstringrequired

New subscription status

Enum"ACTIVE""PAUSED"
Example: status=PAUSED
api_keystring

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

Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-status?contractId=12345&status=PAUSED&api_key=string' \
  -H 'X-API-Key: string'

Responses

Subscription status successfully updated (no content returned)

Response
No content

Update shipping address for subscription contract

Request

Changes the delivery shipping address for a subscription contract. This allows customers to update where their subscription orders are delivered.

Key Features:

  • Full Address Update: Change complete shipping address in one call
  • Address Validation: System validates address format and country codes
  • Immediate Effect: New address applies to the next delivery
  • Activity Logging: All address changes are logged for audit trail
  • International Support: Supports addresses in all countries

Required Address Fields:

  • firstName: Recipient's first name
  • lastName: Recipient's last name
  • address1: Street address line 1
  • city: City name
  • countryCode: ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
  • zip: Postal/ZIP code

Optional Address Fields:

  • address2: Apartment, suite, unit number
  • company: Company name (for business addresses)
  • phone: Contact phone number
  • provinceCode: State/province code (e.g., CA, NY, ON)

Common Use Cases:

  • Customer Moved: Update address after relocation
  • Temporary Address: Ship to vacation home or temporary location
  • Gift Recipient: Change recipient for gift subscriptions
  • Correct Typos: Fix address errors from initial signup
  • Business to Home: Switch between business and residential addresses
  • Seasonal Address: Update for snowbird/seasonal residents

Country and Province Codes:

  • countryCode: Use ISO 3166-1 alpha-2 codes
    • Examples: US (United States), CA (Canada), GB (United Kingdom), AU (Australia)
  • provinceCode: Use ISO 3166-2 subdivision codes
    • US Examples: CA (California), NY (New York), TX (Texas)
    • Canada Examples: ON (Ontario), BC (British Columbia), QC (Quebec)

Address Validation:

  • Format Validation: System checks required fields are present
  • Country Validation: Verifies country code is valid
  • Province Validation: Checks province code matches country
  • Postal Code: Validates postal code format for country

Important Notes:

  • Shipping Rate Recalculation: New address may have different shipping costs
  • Delivery Method: System automatically selects appropriate delivery method
  • Next Order Only: Only affects future orders, not orders already placed
  • Address Book: Consider updating customer's default address separately
  • PO Boxes: Some delivery methods may not support PO Box addresses

Shipping Cost Impact:

  • Changing address may change shipping costs for future deliveries
  • International addresses typically have higher shipping costs
  • Remote/rural areas may have additional delivery fees
  • Consider notifying customer of cost changes

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
api_keystring

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

Headers
X-API-Keystring
Bodyapplication/jsonrequired

New shipping address details

address1string
address2string
citystring
firstNamestring
lastNamestring
phonestring
provincestring
zipstring
countrystring
countryCodestring
provinceCodestring
companystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-shipping-address?contractId=12345&api_key=string' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "address1": "123 Main Street",
    "address2": "Apt 4B",
    "city": "San Francisco",
    "provinceCode": "CA",
    "countryCode": "US",
    "zip": "94102",
    "phone": "+1-415-555-0123",
    "company": "Acme Corp"
  }'

Responses

Shipping address successfully updated

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": [] } }

Update delivery interval for subscription contract

Request

Changes the delivery/shipping frequency of a subscription contract. This allows customers to modify how often they receive their subscription orders.

Key Features:

  • Flexible Delivery: Change delivery frequency (daily, weekly, monthly, yearly)
  • Custom Intervals: Set custom interval counts (e.g., every 2 weeks, every 3 months)
  • Independent from Billing: Delivery interval can differ from billing interval
  • Immediate Effect: Changes apply to the next delivery cycle
  • Activity Logging: All changes are logged for audit trail

Delivery Interval Options:

  • DAY: Daily delivery (intervalCount: how many days)
  • WEEK: Weekly delivery (intervalCount: how many weeks)
  • MONTH: Monthly delivery (intervalCount: how many months)
  • YEAR: Yearly delivery (intervalCount: how many years)

Common Examples:

  • intervalCount=1, interval=MONTH: Deliver monthly
  • intervalCount=2, interval=WEEK: Deliver every 2 weeks
  • intervalCount=3, interval=MONTH: Deliver quarterly
  • intervalCount=1, interval=WEEK: Deliver weekly
  • intervalCount=6, interval=MONTH: Deliver twice a year

Billing vs. Delivery Intervals: These can be different! For example:

  • Bill monthly, deliver weekly: Customer pays monthly but receives weekly shipments
  • Bill quarterly, deliver monthly: Customer pays every 3 months but receives monthly shipments
  • Bill annually, deliver monthly: Customer pays yearly upfront for monthly deliveries

Common Use Cases:

  • Customer wants deliveries less frequently (save on shipping)
  • Customer wants deliveries more frequently (use products faster)
  • Adjust delivery to match consumption rate
  • Seasonal frequency changes (more in summer, less in winter)
  • Align deliveries with schedule (delivery when home from vacation)

Important Notes:

  • Billing Date Unchanged: Only affects delivery schedule, not billing schedule
  • Next Delivery Date: System recalculates next delivery date based on new interval
  • Order Fulfillment: Each delivery creates a new order at the specified interval
  • Prepaid Memberships: Particularly useful for prepaid plans with multiple deliveries

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
api_keystring

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

deliveryIntervalCountstring>= 1required

Number of intervals between deliveries

Example: deliveryIntervalCount=1
deliveryIntervalstringrequired

Delivery interval unit

Enum"DAY""WEEK""MONTH""YEAR"
Example: deliveryInterval=MONTH
Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-delivery-interval?contractId=12345&api_key=string&deliveryIntervalCount=1&deliveryInterval=MONTH' \
  -H 'X-API-Key: string'

Responses

Delivery interval successfully updated

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": [] } }

Update billing interval for subscription contract

Request

Changes the billing frequency of a subscription contract. This allows customers to modify how often they are charged for their membership.

Key Features:

  • Flexible Billing: Change billing frequency (daily, weekly, monthly, yearly)
  • Custom Intervals: Set custom interval counts (e.g., every 2 weeks, every 3 months)
  • Immediate Effect: Changes apply to the next billing cycle
  • Independent from Delivery: Billing interval can differ from delivery interval
  • Activity Logging: All changes are logged for audit trail

Billing Interval Options:

  • DAY: Daily billing (intervalCount: how many days)
  • WEEK: Weekly billing (intervalCount: how many weeks)
  • MONTH: Monthly billing (intervalCount: how many months)
  • YEAR: Yearly billing (intervalCount: how many years)

Common Examples:

  • intervalCount=1, interval=MONTH: Bill monthly
  • intervalCount=2, interval=WEEK: Bill every 2 weeks
  • intervalCount=3, interval=MONTH: Bill quarterly
  • intervalCount=6, interval=MONTH: Bill semi-annually
  • intervalCount=1, interval=YEAR: Bill annually

Common Use Cases:

  • Customer wants to change from monthly to quarterly billing
  • Switch from annual to monthly payments
  • Adjust billing frequency to match cash flow
  • Promotional frequency changes
  • Align billing with payday schedules

Important Notes:

  • Next Billing Date: System recalculates the next billing date based on new interval
  • Pro-rata Billing: No pro-rata adjustment; new interval starts from next billing date
  • Minimum Cycles: Respects minimum billing cycle requirements if configured
  • Customer Portal Protection: Includes freeze checks if called from customer portal

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
api_keystring

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

intervalCountstring>= 1required

Number of intervals between billings

Example: intervalCount=1
intervalstringrequired

Billing interval unit

Enum"DAY""WEEK""MONTH""YEAR"
Example: interval=MONTH
Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-billing-interval?contractId=12345&api_key=string&intervalCount=1&interval=MONTH' \
  -H 'X-API-Key: string'

Responses

Billing interval successfully updated

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": [] } }

Update subscription contract billing date

Request

Updates the next billing date for a subscription contract. This reschedules when the next payment will be charged for the membership.

Key Features:

  • Flexible Rescheduling: Move billing date forward or backward
  • Immediate Effect: Changes take effect immediately in the billing schedule
  • Automatic Adjustments: Future billing dates recalculate based on frequency
  • Customer Portal Compatible: Can be triggered from customer self-service portal
  • Activity Logging: All changes are tracked in activity logs

Billing Date Update Rules:

  • New date must be in the future (past dates are rejected)
  • Cannot update if contract is paused or cancelled
  • Cannot update if minimum billing cycles enforcement is active
  • Date format must be ISO 8601 with timezone (e.g., 2024-12-25T10:00:00Z)
  • Subsequent billing dates auto-calculate based on delivery frequency

Common Use Cases:

  • Customer requests to postpone next delivery/billing
  • Align billing date with customer payday or preference
  • Skip a billing cycle due to vacation or temporary hold
  • Synchronize multiple subscriptions to bill on same day
  • Resolve payment timing conflicts or scheduling issues
  • Adjust for seasonal demand or customer availability

Important Notes:

  • Changing billing date does NOT change the billing cycle frequency
  • If minimum cycles are configured, this may be restricted
  • Activity logs capture old date, new date, and change source
  • Customer receives updated billing schedule notification

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
api_keystring

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

nextBillingDatestring(date-time)required

New next billing date in ISO 8601 format with timezone

Example: nextBillingDate=2024-12-25T10:00:00Z
Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-billing-date?contractId=12345&api_key=string&nextBillingDate=2024-12-25T10%3A00%3A00Z' \
  -H 'X-API-Key: string'

Responses

Billing date successfully updated, returns updated subscription contract

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": [] } }

Update product variant in subscription contract

Request

Replaces an existing product variant with a new variant in a subscription contract. This allows customers to swap products in their membership while maintaining their subscription.

Key Features:

  • Product Swapping: Replace any line item's variant with a different variant
  • Quantity Preservation: Maintains the same quantity after variant swap
  • Price Updates: New variant pricing is applied automatically
  • Flexible Identification: Identify old variant by lineId OR variantId
  • Activity Logging: All variant changes are logged for audit trail

Identification Methods: You can identify the old variant using either:

  • oldLineId: The Shopify line item ID from the subscription contract
  • oldVariantId: The Shopify product variant ID At least one of these must be provided.

Common Use Cases:

  • Customer wants to change product flavor/color/size in their membership
  • Swap discontinued products with new alternatives
  • Change product preferences mid-subscription
  • Update seasonal product selections
  • Replace out-of-stock variants with alternatives

Important Notes:

  • Immediate Effect: Variant change applies to the next billing cycle
  • Validation: System validates new variant exists and is available
  • Same Product: Old and new variants can be from different products
  • Price Changes: Customer is charged the new variant's price

Variant ID Format:

  • Accepts both numeric IDs and GraphQL IDs (gid://shopify/ProductVariant/...)
  • System automatically converts to correct format

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
api_keystring

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

oldLineIdstring

Line item ID to replace (provide either oldLineId or oldVariantId)

Example: oldLineId=gid://shopify/SubscriptionLine/123
oldVariantIdstring

Old variant ID to replace (provide either oldLineId or oldVariantId)

Example: oldVariantId=40123456789
newVariantIdstringrequired

New variant ID to use as replacement

Example: newVariantId=40987654321
skipBillingboolean

Skip billing on plan change (no charge or refund)

Default false
Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contract-update-variant?contractId=12345&api_key=string&oldLineId=gid%3A%2F%2Fshopify%2FSubscriptionLine%2F123&oldVariantId=40123456789&newVariantId=40987654321&skipBilling=false' \
  -H 'X-API-Key: string'

Responses

Variant successfully updated in subscription contract

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 line item to subscription contract

Request

Adds a new product (line item) to an existing subscription contract. This allows customers or merchants to add products to their recurring subscription orders.

Key Features:

  • Add Products: Include new products in future subscription deliveries
  • Quantity Control: Specify how many units of the product to add
  • Price Override: Set custom pricing for the added product
  • Immediate Effect: Changes apply to next billing cycle
  • Activity Logging: All additions are tracked in activity logs

Required Parameters:

  • contractId: Subscription contract ID to modify
  • variantId: Shopify product variant ID (with gid:// prefix or numeric)
  • quantity: Number of units to add (must be positive integer)
  • price: Price per unit in shop's base currency

Product Variant ID Format: Accepts two formats:

  • Shopify GID: gid://shopify/ProductVariant/12345678901
  • Numeric ID: 12345678901

Price Behavior:

  • Price is per unit, not total
  • Must be in shop's base currency (USD, EUR, etc.)
  • Can override product's default price
  • Does not include taxes or shipping
  • Total line item cost = price × quantity

Line Item Addition Rules:

  • Product variant must exist in Shopify catalog
  • Product must be active and available
  • Variant must have sufficient inventory (if tracked)
  • Contract must be ACTIVE or PAUSED (not CANCELLED)
  • Cannot add duplicate variants (use update quantity instead)

Common Use Cases:

  • Customer adds complementary product to existing subscription
  • Upsell additional products through customer portal
  • Merchant adds bonus items to customer subscriptions
  • Build custom "add-on" product selection interfaces
  • Cross-sell related products to existing subscribers
  • Create bundle upgrades (add multiple products at once)

Post-Addition Effects:

  • Next billing amount increases by (price × quantity)
  • Product appears in all future subscription deliveries
  • Customer receives confirmation of subscription update
  • Activity log records the addition with source (portal/merchant)
  • Contract's next billing date remains unchanged

Integration Example:

PUT /api/external/v2/subscription-contract-add-line-item?
  contractId=123456&
  variantId=gid://shopify/ProductVariant/987654321&
  quantity=2&
  price=19.99

This adds 2 units of variant 987654321 at $19.99 each ($39.98 total) to contract 123456.

Important Notes:

  • Changes apply to NEXT billing cycle, not current/past orders
  • If product is out of stock, order may be delayed or skipped
  • Price changes don't affect historical orders
  • Consider inventory availability before adding products

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

Query
contractIdinteger(int64)required

Subscription contract ID

Example: contractId=12345
api_keystring

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

quantityinteger(int32)required

Quantity of product to add

Example: quantity=2
variantIdstringrequired

Shopify product variant ID (with or without gid:// prefix)

Example: variantId=gid://shopify/ProductVariant/987654321
pricenumber(double)required

Price per unit in shop's base currency

Example: price=19.99
Headers
X-API-Keystring
curl -i -X PUT \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contract-add-line-item?contractId=12345&api_key=string&quantity=2&variantId=gid%3A%2F%2Fshopify%2FProductVariant%2F987654321&price=19.99' \
  -H 'X-API-Key: string'

Responses

Line item successfully added to subscription contract

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": [] } }

Get detailed customer subscription information

Request

Retrieves comprehensive details for all subscription contracts associated with a specific customer. This endpoint returns complete subscription contract data including products, pricing, billing schedule, and status.

Key Information Returned:

  • Contract Details: Contract ID, status (active, paused, cancelled), creation date
  • Products: Line items with product names, variants, quantities, and prices
  • Billing Information: Next billing date, billing frequency, payment method
  • Delivery Details: Shipping address, delivery method, delivery frequency
  • Pricing: Subtotal, discounts applied, total amount per cycle
  • Membership Plan: Associated subscription plan name and details
  • Order History: Past billing attempts and fulfillment records

Subscription Contract Details Include:

  • Contract ID: Unique identifier for the subscription
  • Customer ID: Shopify customer ID associated with the contract
  • Status: ACTIVE, PAUSED, CANCELLED, EXPIRED
  • Billing Cycle: Number of completed billing cycles
  • Next Billing Date: When the next payment will be charged
  • Delivery Date: When the next order will be shipped
  • Products: All line items in the subscription with pricing
  • Discount Codes: Applied discount codes and their values
  • Custom Attributes: Any custom metadata or tags

Common Use Cases:

  • Display full subscription list in customer account dashboard
  • Retrieve all contract details for customer support inquiries
  • Build custom customer portal with subscription management
  • Sync subscription data to external CRM or analytics systems
  • Generate customer subscription reports and analytics
  • Validate customer's active subscriptions before offering upgrades
  • Show subscription history and upcoming deliveries

Response Format: Returns a List of SubscriptionContractDetailsDTO objects, one per active/paused contract. If customer has no subscriptions, returns an empty list.

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

Path
customerIdinteger(int64)required

Shopify customer ID

Example: 6789012345
Query
api_keystring

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

Headers
X-API-Keystring
curl -i -X GET \
  'https://membership-admin.appstle.com/api/external/v2/subscription-customers-detail/valid/6789012345?api_key=string' \
  -H 'X-API-Key: string'

Responses

Customer subscription details successfully retrieved (may be empty list if no subscriptions)

Bodyapplication/json
idinteger(int64)
shopstringrequired
graphSubscriptionContractIdstring
subscriptionContractIdinteger(int64)
billingPolicyIntervalstring
billingPolicyIntervalCountinteger(int32)
currencyCodestring
customerIdinteger(int64)
graphCustomerIdstring
deliveryPolicyIntervalstring
deliveryPolicyIntervalCountinteger(int32)
statusstring
graphOrderIdstring
orderIdinteger(int64)
createdAtstring(date-time)
updatedAtstring(date-time)
nextBillingDatestring(date-time)
orderAmountnumber(double)
orderNamestring
customerNamestring
customerEmailstring
subscriptionCreatedEmailSentboolean
endsAtstring(date-time)
startsAtstring(date-time)
subscriptionCreatedEmailSentStatusstring
Enum"SENT""UNSENT""FAILED""EMAIL_SETTINGS_DISABLED""CUSTOMER_PAYMENT_EMPTY""CONTRACT_PAUSED_STATUS"
minCyclesinteger(int32)
maxCyclesinteger(int32)
customerFirstNamestring
customerLastNamestring
autoChargeboolean
importedIdstring
stopUpComingOrderEmailboolean
pausedFromActiveboolean
subscriptionCreatedSmsSentStatusstring
Enum"SENT""UNSENT""FAILED""SMS_SETTINGS_DISABLED""CUSTOMER_PAYMENT_EMPTY""CONTRACT_PAUSED_STATUS""PHONE_NUMBER_EMPTY"
phonestring
activatedOnstring(date-time)
pausedOnstring(date-time)
cancelledOnstring(date-time)
contractDetailsJSONstring
cancellationFeedbackstring
orderNotestring
orderNoteAttributesstring
allowDeliveryPriceOverrideboolean
orderAmountUSDnumber(double)
billingDateAfterTrialstring(date-time)
trialEndDatestring(date-time)
pausedBySecurityChallengeboolean
dunningboolean
contractAmountnumber(double)
contractAmountUSDnumber(double)
upcomingSwapRulestring
emailBouncedOrFailedboolean
Response
application/json
{ "id": 0, "shop": "string", "graphSubscriptionContractId": "string", "subscriptionContractId": 0, "billingPolicyInterval": "string", "billingPolicyIntervalCount": 0, "currencyCode": "string", "customerId": 0, "graphCustomerId": "string", "deliveryPolicyInterval": "string", "deliveryPolicyIntervalCount": 0, "status": "string", "graphOrderId": "string", "orderId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "nextBillingDate": "2019-08-24T14:15:22Z", "orderAmount": 0.1, "orderName": "string", "customerName": "string", "customerEmail": "string", "subscriptionCreatedEmailSent": true, "endsAt": "2019-08-24T14:15:22Z", "startsAt": "2019-08-24T14:15:22Z", "subscriptionCreatedEmailSentStatus": "SENT", "minCycles": 0, "maxCycles": 0, "customerFirstName": "string", "customerLastName": "string", "autoCharge": true, "importedId": "string", "stopUpComingOrderEmail": true, "pausedFromActive": true, "subscriptionCreatedSmsSentStatus": "SENT", "phone": "string", "activatedOn": "2019-08-24T14:15:22Z", "pausedOn": "2019-08-24T14:15:22Z", "cancelledOn": "2019-08-24T14:15:22Z", "contractDetailsJSON": "string", "cancellationFeedback": "string", "orderNote": "string", "orderNoteAttributes": "string", "allowDeliveryPriceOverride": true, "orderAmountUSD": 0.1, "billingDateAfterTrial": "2019-08-24T14:15:22Z", "trialEndDate": "2019-08-24T14:15:22Z", "pausedBySecurityChallenge": true, "dunning": true, "contractAmount": 0.1, "contractAmountUSD": 0.1, "upcomingSwapRule": "string", "emailBouncedOrFailed": true }

Send customer portal magic link via email

Request

Automatically generates and emails a secure magic link to the customer for accessing their subscription management portal. This is a convenience endpoint that combines token generation and email delivery in a single API call.

Key Features:

  • Automated Delivery: Generates magic link and sends email in one operation
  • Customer Lookup: Finds customer by email address automatically
  • Branded Emails: Uses shop's configured email templates and branding
  • Subscription Validation: Only sends if customer has active subscriptions
  • Time-Limited Links: Email contains token that expires after configured duration

Email Contents: The sent email typically includes:

  • Magic Link Button: One-click access to customer portal
  • Link URL: Full URL with embedded authentication token
  • Expiration Notice: When the link will expire (e.g., "Valid for 24 hours")
  • Shop Branding: Store logo, colors, and custom messaging
  • Help Text: Instructions on how to use the portal

Workflow:

  1. API receives customer email address
  2. System looks up customer in Shopify by email
  3. Validates customer has active subscription contracts
  4. Generates secure JWT authentication token
  5. Constructs magic link URL with token
  6. Sends branded email with magic link to customer
  7. Returns success confirmation to API caller

Email Template Customization: Email appearance and content can be customized via:

  • Shop's email notification settings in admin
  • Custom email templates for magic links
  • Localization settings for customer's language
  • Custom branding (logo, colors, footer)

Common Use Cases:

  • Customer support: send portal access link to customers over phone/chat
  • Automated workflows: trigger magic link emails based on events
  • Forgot password alternative: passwordless portal access
  • Post-purchase flows: send portal access after first order
  • Reactivation campaigns: re-engage paused/cancelled customers
  • Customer onboarding: welcome emails with portal access
  • Subscription reminders: include portal link in reminder emails

Integration Example:

GET /api/external/v2/subscription-contracts-email-magic-link?
  email=customer@example.com&
  api_key=your_api_key

This sends a magic link email to customer@example.com for portal access.

Error Handling:

  • If customer not found, returns 400 Bad Request
  • If customer has no active subscriptions, returns 400
  • If email service fails, returns 500 Internal Server Error
  • Invalid email format returns 400 Bad Request

Email Delivery Notes:

  • Emails are sent asynchronously (may take 1-5 minutes to deliver)
  • Check spam folders if customer doesn't receive email
  • Respect customer's email preferences and unsubscribe status
  • Rate limits may apply to prevent abuse

Security Considerations:

  • Only send to verified customer email addresses
  • Email contains passwordless authentication link
  • Links expire after configured duration (default: 24-72 hours)
  • Sending to wrong email grants that person subscription access
  • Consider email verification before using this endpoint

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

Query
api_keystring

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

emailstringrequired

Customer email address to send magic link to

Example: email=customer@example.com
Headers
X-API-Keystring
curl -i -X GET \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-email-magic-link?api_key=string&email=customer%40example.com' \
  -H 'X-API-Key: string'

Responses

Magic link email sent successfully to customer

Bodytext/plain
string

Get billing interval options for selling plans

Request

Retrieves available billing frequency/interval options for specified Shopify selling plans (subscription plans). This endpoint returns all configured billing frequencies that customers can choose from for their subscriptions.

Key Information Returned:

  • Frequency Options: List of available billing intervals (e.g., weekly, monthly, quarterly)
  • Interval Units: Time unit for each option (DAYS, WEEKS, MONTHS, YEARS)
  • Interval Count: Number of units between billings (e.g., 2 = every 2 weeks)
  • Display Names: Customer-friendly names for each frequency option
  • Plan IDs: Associated selling plan IDs for each frequency

Billing Frequency Structure: Each FrequencyInfoDTO contains:

  • id: Selling plan ID (Shopify subscription plan identifier)
  • name: Display name (e.g., "Deliver every 2 weeks", "Monthly subscription")
  • intervalUnit: Time unit (DAY, WEEK, MONTH, YEAR)
  • intervalCount: Number of units between deliveries
  • billingPolicy: How billing is configured (EXACT_DAY, ANNIVERSARY)
  • deliveryPolicy: How delivery is scheduled

Common Billing Intervals:

  • Weekly: intervalUnit=WEEK, intervalCount=1
  • Bi-Weekly: intervalUnit=WEEK, intervalCount=2
  • Monthly: intervalUnit=MONTH, intervalCount=1
  • Every 2 Months: intervalUnit=MONTH, intervalCount=2
  • Quarterly: intervalUnit=MONTH, intervalCount=3
  • Semi-Annual: intervalUnit=MONTH, intervalCount=6
  • Annual: intervalUnit=YEAR, intervalCount=1

Request Parameters:

  • sellingPlanIds: Comma-separated list of Shopify selling plan IDs (required)
    • Example: "123456,123457,123458"
    • Returns frequency options for all specified plans

Common Use Cases:

  • Display available billing frequencies in customer portal
  • Allow customers to change subscription delivery frequency
  • Build frequency selector UI components
  • Validate frequency options before updating subscription
  • Sync available billing options with external systems
  • Show frequency options during subscription checkout

Integration Example:

  1. Get customer's current subscription selling plan ID
  2. Call this endpoint with that selling plan ID
  3. Display returned frequency options to customer
  4. Customer selects new frequency
  5. Update subscription with selected frequency

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

Query
api_keystring

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

sellingPlanIdsstringrequired

Comma-separated list of Shopify selling plan IDs

Example: sellingPlanIds=123456,123457,123458
Headers
X-API-Keystring
curl -i -X GET \
  'https://membership-admin.appstle.com/api/external/v2/subscription-contract-details/billing-interval?api_key=string&sellingPlanIds=123456%2C123457%2C123458' \
  -H 'X-API-Key: string'

Responses

Billing interval options successfully retrieved

Bodyapplication/json
frequencyCountinteger(int32)
frequencyIntervalstring
Enum"DAY""WEEK""MONTH""YEAR"
billingFrequencyCountinteger(int32)
billingFrequencyIntervalstring
Enum"DAY""WEEK""MONTH""YEAR"
frequencyNamestring
discountOffernumber(double)
discountOffer2number(double)
afterCycle1integer(int32)
afterCycle2integer(int32)
discountTypestring
Enum"PERCENTAGE""FIXED""PRICE"
discountType2string
Enum"PERCENTAGE""FIXED""PRICE"
discountEnabledboolean
discountEnabled2boolean
discountEnabledMaskedboolean
discountEnabled2Maskedboolean
idstring
frequencyTypestring
Enum"ON_PURCHASE_DAY""ON_SPECIFIC_DAY"
specificDayValueinteger(int32)
specificMonthValueinteger(int32)
specificDayEnabledboolean
maxCyclesinteger(int32)
minCyclesinteger(int32)
cutOffinteger(int32)
prepaidFlagstring
idNewstring
planTypestring
Enum"PAY_AS_YOU_GO""PREPAID""ADVANCED_PREPAID"
deliveryPolicyPreAnchorBehaviorstring
Enum"ASAP""NEXT""$UNKNOWN"
freeTrialEnabledboolean
freeTrialCountinteger(int32)
freeTrialIntervalstring
Enum"DAY""WEEK""MONTH""YEAR"
frequencyDescriptionstring
keepOriginalNextBillingDateAfterTrialboolean
planSequenceinteger(int32)
groupNamestring
groupIdinteger(int64)
memberOnlyboolean
nonMemberOnlyboolean
memberInclusiveTagsstring
memberExclusiveTagsstring
lifeTimeMembershipboolean
rulesJsonstring
Response
application/json
{ "frequencyCount": 0, "frequencyInterval": "DAY", "billingFrequencyCount": 0, "billingFrequencyInterval": "DAY", "frequencyName": "string", "discountOffer": 0.1, "discountOffer2": 0.1, "afterCycle1": 0, "afterCycle2": 0, "discountType": "PERCENTAGE", "discountType2": "PERCENTAGE", "discountEnabled": true, "discountEnabled2": true, "discountEnabledMasked": true, "discountEnabled2Masked": true, "id": "string", "frequencyType": "ON_PURCHASE_DAY", "specificDayValue": 0, "specificMonthValue": 0, "specificDayEnabled": true, "maxCycles": 0, "minCycles": 0, "cutOff": 0, "prepaidFlag": "string", "idNew": "string", "planType": "PAY_AS_YOU_GO", "deliveryPolicyPreAnchorBehavior": "ASAP", "freeTrialEnabled": true, "freeTrialCount": 0, "freeTrialInterval": "DAY", "frequencyDescription": "string", "keepOriginalNextBillingDateAfterTrial": true, "planSequence": 0, "groupName": "string", "groupId": 0, "memberOnly": true, "nonMemberOnly": true, "memberInclusiveTags": "string", "memberExclusiveTags": "string", "lifeTimeMembership": true, "rulesJson": "string" }

Generate customer portal authentication token

Request

Generates an authentication token for customer portal access using either customer ID or email address. This token can be used to create magic links or authenticate API requests on behalf of a customer.

Key Features:

  • Flexible Lookup: Find customer by Shopify customer ID OR email address
  • JWT Token: Returns cryptographically secure JSON Web Token
  • Portal Access: Token grants access to customer subscription management portal
  • API Authentication: Can be used in subsequent API calls for customer-specific operations
  • Time-Limited: Token expires after configured duration (default: 24-72 hours)

Request Parameters: Provide either customerId OR email (not both):

  • customerId: Shopify customer ID (numeric string, e.g., "6789012345")
  • email: Customer's email address as registered in Shopify

Response Contains:

  • customerId: Shopify customer ID associated with the token
  • token: JWT authentication token for portal access
  • shop: Store domain the customer belongs to
  • expiresAt: Token expiration timestamp (ISO 8601)

Common Use Cases:

  • Generate token to construct customer portal magic links
  • Authenticate customer in headless commerce implementations
  • Validate customer identity before allowing subscription changes
  • Create custom portal integrations with embedded authentication
  • Server-side customer lookup when only email is available
  • Build custom subscription management UIs with API authentication
  • Integrate with external CRM systems requiring customer tokens

Token Usage: Once generated, the token can be:

  1. Embedded in magic link URLs: https://portal.example.com?token={token}
  2. Used as Bearer token in Authorization headers for API calls
  3. Stored temporarily for customer session management
  4. Passed to frontend applications for customer-specific operations

Security Best Practices:

  • Never expose tokens in client-side logs or browser storage
  • Transmit tokens only over HTTPS
  • Implement token rotation for long-lived sessions
  • Validate token expiration before use
  • Revoke tokens when customer logs out or changes credentials

Error Handling:

  • If neither customerId nor email is provided, returns 400 Bad Request
  • If both customerId and email are provided, customerId takes precedence
  • If customer not found, returns 404 Not Found
  • Invalid email format returns 400 Bad Request

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

Query
api_keystring

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

customerIdstring

Shopify customer ID (provide either customerId OR email)

Example: customerId=6789012345
emailstring

Customer email address (provide either customerId OR email)

Example: email=customer@example.com
Headers
X-API-Keystring
curl -i -X GET \
  'https://membership-admin.appstle.com/api/external/v2/customer-portal-token?api_key=string&customerId=6789012345&email=customer%40example.com' \
  -H 'X-API-Key: string'

Responses

Customer portal token generated successfully, returns customer ID and authentication token

Bodyapplication/json
customerIdinteger(int64)
tokenstring
Response
application/json
{ "customerId": 0, "token": "string" }

Subscription Billing

Operations

Billing Attempts

Operations