Subscription Contracts
Get current customer's saved Shopify payment methods
GET
/
subscriptions
/
cp
/
api
/
subscription-contract-details
/
shopify
/
customer
/
payment-methods
Get current customer's saved Shopify payment methods
curl --request GET \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methodsimport requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods';
const options = {method: 'GET'};
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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods"
req, _ := http.NewRequest("GET", 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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"__typename": "CustomerPaymentMethodConnection",
"nodes": [
{
"__typename": "CustomerPaymentMethod",
"id": "gid://shopify/CustomerPaymentMethod/0a1b2c3d4e5f60718293a4b5c6d7e8f9",
"instrument": {
"__typename": "CustomerCreditCard",
"billingAddress": {
"__typename": "CustomerCreditCardBillingAddress",
"address1": "<string>",
"city": "<string>",
"country": "<string>",
"countryCode": "US",
"province": "<string>",
"provinceCode": "OR",
"zip": "<string>"
},
"brand": "bogus",
"expiresSoon": true,
"expiryMonth": 12,
"expiryYear": 2030,
"firstDigits": "424242",
"inactive": true,
"lastDigits": "4242",
"maskedNumber": "•••• •••• •••• 4242",
"name": "Maya Brooks",
"paypalAccountEmail": "<string>",
"revocable": true
},
"revokedAt": "2023-11-07T05:31:56Z",
"revokedReason": "<string>"
}
],
"pageInfo": {
"__typename": "PageInfo",
"endCursor": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
}Response
200 - application/json
The signed-in customer's saved payment methods, in the same shape as the Admin API's customer payment methods endpoint. The body is empty when Appstle couldn't read them from Shopify.
A customer's saved payment methods, read from Shopify.
⌘I
Get current customer's saved Shopify payment methods
curl --request GET \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methodsimport requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods';
const options = {method: 'GET'};
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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods"
req, _ := http.NewRequest("GET", 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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"__typename": "CustomerPaymentMethodConnection",
"nodes": [
{
"__typename": "CustomerPaymentMethod",
"id": "gid://shopify/CustomerPaymentMethod/0a1b2c3d4e5f60718293a4b5c6d7e8f9",
"instrument": {
"__typename": "CustomerCreditCard",
"billingAddress": {
"__typename": "CustomerCreditCardBillingAddress",
"address1": "<string>",
"city": "<string>",
"country": "<string>",
"countryCode": "US",
"province": "<string>",
"provinceCode": "OR",
"zip": "<string>"
},
"brand": "bogus",
"expiresSoon": true,
"expiryMonth": 12,
"expiryYear": 2030,
"firstDigits": "424242",
"inactive": true,
"lastDigits": "4242",
"maskedNumber": "•••• •••• •••• 4242",
"name": "Maya Brooks",
"paypalAccountEmail": "<string>",
"revocable": true
},
"revokedAt": "2023-11-07T05:31:56Z",
"revokedReason": "<string>"
}
],
"pageInfo": {
"__typename": "PageInfo",
"endCursor": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
}