Skip to content

Customer Portal APIs (0.0.1)

Important Note:

The APIs in this document are for reference only and will not work directly in Swagger. To use these APIs, you need to call them from your shop.

The base URL for these APIs is your shop's domain. For example, if your shop domain is https://www.myshop.com/apps, then the full API endpoint will be based on this domain (e.g., https://www.myshop.com/apps/memberships/cp/api/**).

Please ensure the customer is logged in when calling the Customer Portal Proxy API. If the customer is not logged in, the API will return a 401 Unauthorized error.

Languages
Servers
https://www.myshop.com/apps

Shipping & Delivery Profiles

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

Operations

Custom CSS Styling

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

Operations

Customer Discount History

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

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

Cancellation Flow Configuration

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

Operations

Membership Contracts

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

Operations

applyDiscountCode

Request

Query
contractIdinteger(int64)required
discountCodestringrequired
curl -i -X PUT \
  'https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-apply-discount?contractId=0&discountCode=string'

Responses

OK

Body*/*
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)

Add a product to an existing membership contract

Request

Adds a new product/variant line item to an existing active membership contract. This allows customers or merchants to add additional products to their recurring membership orders.

Key Features:

  • Add any product variant to an existing membership
  • Specify custom quantity and price per line item
  • Product will be included in all future billing cycles
  • Price is per-item, total line price = price × quantity

Important Notes:

  • Immediate Effect: Product is added immediately and will appear in the next billing cycle
  • Price Override: The price parameter allows setting a custom price (e.g., member discount)
  • Activity Logging: Addition is logged for audit trail
  • Validation: System validates that the variant exists and is available

Common Use Cases:

  • Customer wants to add more products to their monthly membership box
  • Merchant adds a complimentary product to a membership
  • Upgrading membership with additional items
  • Adding seasonal or limited-time products to existing memberships

Price Considerations:

  • Price is specified in shop's currency
  • Can be set to member-only pricing (different from regular product price)
  • Zero price is allowed for free add-ons

Variant ID Format:

  • Accepts both numeric ID (e.g., '987654321') and Shopify GID format
  • System will convert to proper Shopify GraphQL format internally

Authentication: Requires authenticated shop user or customer portal token

Query
contractIdinteger(int64)required

Membership contract ID to add product to

Example: contractId=123456789
shopstringrequired

Shop domain (will be auto-populated from authentication)

Example: shop=example-shop.myshopify.com
quantityinteger(int32)required

Quantity of the product to add

Example: quantity=2
variantIdstringrequired

Shopify variant ID of the product to add (numeric or GID format)

Example: variantId=987654321
pricenumber(double)required

Price per unit in shop currency (allows custom/member pricing)

Example: price=19.99
curl -i -X PUT \
  'https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-add-line-item?contractId=123456789&shop=example-shop.myshopify.com&quantity=2&variantId=987654321&price=19.99'

Responses

Product successfully added to membership 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" }, "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": [] } }

updateVariant

Request

Query
contractIdinteger(int64)required
oldLineIdstring
oldVariantIdstring
newVariantIdstringrequired
sellingPlanIdstring
skipBillingboolean
Default false
curl -i -X PUT \
  'https://www.myshop.com/apps/memberships/cp/api/subscription-contract-update-variant?contractId=0&oldLineId=string&oldVariantId=string&newVariantId=string&sellingPlanId=string&skipBilling=false'

Responses

OK

Body*/*
string

Billing & Orders

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

Operations

Product & Inventory Data

APIs for retrieving product catalog, variants, pricing, and inventory information for subscription memberships

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 Swap Rules

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

Operations

loyalty-integration-resource

Operations

customer-retention-activity-resource

Operations

shop-info-resource

Operations