Membership Contracts
Send payment method update email
Asks Shopify to email the member a secure link to update the payment method on this membership. The payment method changes only when the member follows the link and saves new details, so a 200 response means Shopify accepted the email request, not that the payment method changed.
How it works:
- Finds the membership’s payment method: Looks up the payment method attached to this membership contract in Shopify
- Requests Shopify’s update email: Shopify emails the member a secure link to update that payment method
- Changes nothing itself: The call does not change the membership’s payment method, and it does not read the customer’s default payment method in Shopify
Use Cases:
- Ask a member whose card is expiring or has expired to update it
- Follow up after a failed renewal. The call does not retry the billing attempt
Important Notes:
- The membership must have an active payment method. If Shopify has revoked it, the call returns 400 and no email is sent
- The call does not check the membership’s status. It also returns 200 for a cancelled membership whose payment method is still on file
- Each successful call asks Shopify for another email, so don’t retry a call that returned 200
- Shopify sends the email, not the app, so the app’s email templates don’t apply and the call takes no subject or message
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
PUT
/
api
/
external
/
v2
/
subscription-contracts-update-payment-method
Send payment method update email
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_bodyHeaders
Query Parameters
Membership contract ID to update payment method for
API Key (Deprecated - Use Header X-API-Key instead)
Response
Shopify accepted the request to email the member a link to update the payment method. The payment method has not changed yet
⌘I
Send payment method update email
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