Get customer payment methods from Shopify
Returns a customer’s saved payment methods, read from Shopify when you call it. Use it to show which card a customer has on file, with its last digits and expiry, or to find methods Shopify has revoked.
Response
nodes lists the customer’s payment methods. Each has an id (a Shopify gid://shopify/CustomerPaymentMethod/... ID), an instrument, and revokedAt and revokedReason, which stay null until Shopify revokes the method. instrument.__typename tells you the kind of method, and each kind returns its own fields:
CustomerCreditCard:brand,firstDigits,lastDigits,maskedNumber,name,expiryMonth,expiryYear,expiresSoon,billingAddressandrevocable.CustomerShopPayAgreement:lastDigits,maskedNumber,name,expiryMonth,expiryYear,expiresSoonandrevocable.CustomerPaypalBillingAgreement:paypalAccountEmail,inactive,billingAddressandrevocable.- Any other kind, such as
BankAccount:__typenameonly.
A customer with no saved payment methods gets an empty nodes array.
Appstle reads every page of the customer’s payment methods from Shopify and returns them all in nodes, so you don’t need to page. pageInfo.hasNextPage is true only when Appstle couldn’t read every page. The list is then incomplete, so call again later.
To bill a contract to one of these methods, pass its id as paymentMethodId to PUT /api/external/v2/subscription-contracts-update-existing-payment-method.
allowRevokedMethod
false (the default) returns only methods that haven’t been revoked. true also returns revoked methods, with revokedAt and revokedReason set, for example MANUALLY_REVOKED.
Empty body
The call returns 200 with an empty body, not 404, when the store has no customer with that ID, and also when Appstle couldn’t read the customer’s payment methods from Shopify. Check for an empty body before you parse the JSON. If you know the customer exists, call again later.
Errors
A customerId that isn’t a number returns 400. Any unexpected server error also returns HTTP 400, with "status": 500 in the body, so read status in the body, not only the HTTP code. A missing or wrong API key returns 401.
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/payment-methodsimport requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/payment-methods"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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": "212 Alder Street",
"city": "Portland",
"country": "United States",
"countryCode": "US",
"province": "Oregon",
"provinceCode": "OR",
"zip": "97205"
},
"brand": "bogus",
"expiresSoon": false,
"expiryMonth": 12,
"expiryYear": 2030,
"firstDigits": "424242",
"lastDigits": "4242",
"maskedNumber": "•••• •••• •••• 4242",
"name": "Maya Brooks",
"revocable": false
},
"revokedAt": null,
"revokedReason": null
}
],
"pageInfo": {
"__typename": "PageInfo",
"endCursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkwLCJsYXN0X3ZhbHVlIjoxMjM0NTY3ODkwfQ==",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkwLCJsYXN0X3ZhbHVlIjoxMjM0NTY3ODkwfQ=="
}
}{
"detail": "Unexpected runtime exception",
"message": "error.http.400",
"path": "/api/external/v2/subscription-contract-details/shopify/customer/abc/payment-methods",
"status": 400,
"title": "Bad Request",
"type": "https://appstle.com/problem/problem-with-message"
}{
"error": "Unauthorized",
"path": "/api/external/v2/subscription-contract-details/shopify/customer/123456789/payment-methods",
"status": 401,
"timestamp": "2026-11-21T20:24:38.174+00:00"
}Path Parameters
Query Parameters
Response
The customer's payment methods. The body is empty when the store has no customer with that ID, or when Appstle couldn't read the payment methods from Shopify.
A customer's saved payment methods, read from Shopify.
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/payment-methodsimport requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/payment-methods"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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://subscription-admin.appstle.com/api/external/v2/subscription-contract-details/shopify/customer/{customerId}/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": "212 Alder Street",
"city": "Portland",
"country": "United States",
"countryCode": "US",
"province": "Oregon",
"provinceCode": "OR",
"zip": "97205"
},
"brand": "bogus",
"expiresSoon": false,
"expiryMonth": 12,
"expiryYear": 2030,
"firstDigits": "424242",
"lastDigits": "4242",
"maskedNumber": "•••• •••• •••• 4242",
"name": "Maya Brooks",
"revocable": false
},
"revokedAt": null,
"revokedReason": null
}
],
"pageInfo": {
"__typename": "PageInfo",
"endCursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkwLCJsYXN0X3ZhbHVlIjoxMjM0NTY3ODkwfQ==",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkwLCJsYXN0X3ZhbHVlIjoxMjM0NTY3ODkwfQ=="
}
}{
"detail": "Unexpected runtime exception",
"message": "error.http.400",
"path": "/api/external/v2/subscription-contract-details/shopify/customer/abc/payment-methods",
"status": 400,
"title": "Bad Request",
"type": "https://appstle.com/problem/problem-with-message"
}{
"error": "Unauthorized",
"path": "/api/external/v2/subscription-contract-details/shopify/customer/123456789/payment-methods",
"status": 401,
"timestamp": "2026-11-21T20:24:38.174+00:00"
}