APIs for managing Shopify delivery profiles, shipping rates, zones, and free shipping configuration for subscription memberships
- syncCustomerInfoV2
External (0.0.1)
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:
- Embedded in magic link URLs:
https://portal.example.com?token={token} - Used as Bearer token in Authorization headers for API calls
- Stored temporarily for customer session management
- 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
- https://membership-admin.appstle.com/api/external/v2/customer-portal-token
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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'{ "customerId": 0, "token": "string" }
- https://membership-admin.appstle.com/api/external/v2/subscription-customers/sync-info/{customerId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://membership-admin.appstle.com/api/external/v2/subscription-customers/sync-info/{customerId}' \
-H 'X-API-Key: string'Request
Cancels a membership/subscription contract and sends cancellation confirmation emails. This endpoint terminates the recurring subscription and processes all cancellation workflows.
Cancellation Process:
- Contract Termination: Marks subscription as cancelled in Shopify
- Billing Stop: Prevents future billing attempts
- Email Notification: Sends cancellation confirmation to customer
- Activity Logging: Records cancellation event with source and feedback
- Feedback Capture: Optional cancellation reason for analytics
Key Features:
- Immediate Cancellation: Stops subscription processing immediately
- Feedback Collection: Capture customer cancellation reasons
- Automated Emails: Customer receives cancellation confirmation
- Activity Tracking: Logs cancellation to activity history
- Source Attribution: Tracks whether cancellation came from customer portal or API
Validation Checks:
- Contract Ownership: Verifies contract belongs to authenticated shop
- Minimum Cycles: Checks if minimum billing cycles requirement is met (if configured)
- Freeze Status: Validates subscription is not frozen
- Existing Status: Ensures contract is not already cancelled
Email Notifications:
- Sends cancellation confirmation to customer email
- Includes subscription details and cancellation date
- Uses customizable email templates from shop settings
Use Cases:
- Allow customers to cancel from custom portals or mobile apps
- Bulk cancellation workflows via external systems
- Integration with customer service platforms
- Automated cancellation based on business rules
- Churn management and retention workflows
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
- https://membership-admin.appstle.com/api/external/v2/subscription-contracts/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://membership-admin.appstle.com/api/external/v2/subscription-contracts/123456789?api_key=string&cancellationFeedback=Too+expensive' \
-H 'X-API-Key: string'