Comprehensive API documentation for managing subscriptions, payments, and related operations. These APIs allow you to programmatically manage subscription lifecycles, handle payments, configure products, and integrate subscription functionality into your applications.
- Update subscription payment method
External APIs (0.0.1)
Request
Triggers Shopify to send an email to the subscription customer with a secure link to update their payment method. This endpoint initiates Shopify's native payment update flow without requiring direct payment handling.
Key Features:
- Sends official Shopify payment update email to customer
- Customer receives secure link to Shopify-hosted payment update page
- No PCI compliance required - Shopify handles all payment data
- Supports all Shopify-supported payment methods
- Automatically updates subscription after customer completes the process
Process Flow:
- API call triggers email send request to Shopify
- Shopify sends branded email to customer's registered email
- Customer clicks secure link in email
- Customer authenticates on Shopify-hosted page
- Customer adds/updates payment method
- Subscription automatically uses new payment method
Email Details:
- Sent from Shopify's email servers
- Uses store's configured sender email
- Subject line typically: "Update your payment method"
- Contains secure, time-limited link
- Shopify-branded with store information
Use Cases:
- Failed payment recovery
- Expiring credit card updates
- Customer-requested payment changes
- Proactive payment method maintenance
Important Notes:
- Customer must have valid email address
- Email cannot be customized (Shopify template)
- Link expiration time set by Shopify
- Multiple emails can be sent if needed
- No webhook for completion - poll contract for updates
Rate Limiting:
- Subject to Shopify's email sending limits
- Recommended: Wait 24 hours between sends to same customer
- Excessive sends may be blocked by Shopify
Authentication: Requires valid X-API-Key header
- https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method?contractId=123456789&api_key=string' \
-H 'X-API-Key: string'{ "message": "Payment method update email sent successfully" }
Request
Updates the payment method for an existing subscription contract to use a different existing payment method. The new payment method must already be associated with the customer in Shopify.
Important Notes:
- The payment method must already exist in the customer's Shopify payment methods
- Only valid, non-revoked payment methods can be used
- The update is processed through Shopify's subscription draft system
- Payment method details are cached locally after successful update
Process Flow:
- Validates subscription contract exists
- Creates a draft update in Shopify
- Updates the draft with new payment method
- Commits the draft to apply changes
- Caches payment instrument details locally
- Records activity log entry
Authentication: Requires valid X-API-Key header
Subscription contract ID to update payment method for. Must be a valid contract ID that belongs to the authenticated shop.
ID of the existing customer payment method to use. Must be a valid Shopify GraphQL payment method ID in the format 'gid://shopify/CustomerPaymentMethod/{id}'. The payment method must:
- Already exist in the customer's Shopify account
- Be in a valid state (not expired or revoked)
- Be authorized for subscription use
You can retrieve available payment methods using the customer payment methods endpoint.
- https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-existing-payment-method
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-existing-payment-method?contractId=123456789&paymentMethodId=gid%3A%2F%2Fshopify%2FCustomerPaymentMethod%2Fcdb2bbe581599b20439ebf636a380b8b' \
-H 'X-API-Key: sk_live_1234567890abcdef'{ "message": "Payment method updated successfully" }