Membership Contracts
Update membership payment method
Updates the payment method for a membership contract by refreshing payment instrument from Shopify customer. This endpoint syncs the membership’s payment method with the customer’s default payment method in Shopify.
Payment Method Update Process:
- Fetch Latest Payment: Retrieves customer’s current default payment method from Shopify
- Update Contract: Associates new payment method with membership contract
- Validate Payment: Ensures payment method is valid and active
- Sync Changes: Updates payment instrument in membership billing system
Key Features:
- Automatic Sync: Pulls latest payment method from Shopify customer record
- Payment Validation: Verifies new payment method is usable for billing
- Contract Update: Updates Shopify membership contract with new payment
- Failed Billing Recovery: Useful for updating payment after billing failures
Use Cases:
- Customer updates credit card and wants to apply to existing membership
- Recover from failed billing by allowing payment method update
- Sync payment methods in customer portal workflows
- Update expired or invalid payment methods
- Switch between multiple saved payment methods
- Integration with custom payment update flows
Important Notes:
- Customer must have a default payment method in Shopify
- Payment method must be valid and not expired
- Updates are reflected immediately for future billing
- Does not retry failed billing attempts automatically
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
PUT
/
api
/
external
/
v2
/
subscription-contracts-update-payment-method
Update membership payment method
curl --request PUT \
--url https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-methodimport requests
url = "https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method';
const options = {method: 'PUT'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body⌘I
Update membership payment method
curl --request PUT \
--url https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-methodimport requests
url = "https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method';
const options = {method: 'PUT'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://membership-admin.appstle.com/api/external/v2/subscription-contracts-update-payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body