APIs for managing Shopify delivery profiles, shipping rates, zones, and free shipping configuration for subscription memberships
- updateVariant
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.
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
- https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-add-line-item
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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'{ "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": [ … ] } }
- https://www.myshop.com/apps/memberships/cp/api/subscription-contract-update-variant
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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'- https://www.myshop.com/apps/memberships/cp/api/subscription-contract-details
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://www.myshop.com/apps/memberships/cp/api/subscription-contract-details \
-H 'Content-Type: application/json' \
-d '{
"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
}'