curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"saved_payment_methods": {
"upi_collect": [
{
"count": 123,
"last_used": "<string>",
"vpa": "<string>"
}
],
"wallet": [
{
"id": "<string>",
"wallet": "<string>",
"gateway_reference_id": "<string>",
"last_refreshed": "<string>",
"linked": "<string>",
"metadata": {
"mobile_number": "<string>",
"device_id": "<string>"
},
"sub_details": {
"last_used": "<string>",
"current_balance": "<string>",
"last_refreshed": "<string>",
"payment_method": "<string>",
"payment_method_type": "<string>"
}
}
],
"card": [
{
"card_sub_type": "<string>",
"extended_card_type": "<string>",
"provider_category": "<string>",
"vault_provider": "<string>",
"card_type": "<string>",
"card_token": "<string>",
"card_exp_month": "<string>",
"expired": true,
"tokenize_support": true,
"card_exp_year": "<string>",
"name_on_card": "<string>",
"country_code": "<string>",
"card_number": "<string>",
"card_global_fingerprint": "<string>",
"nickname": "<string>",
"card_reference": "<string>",
"metadata": {
"origin_merchant_id": "<string>"
},
"card_issuer": "<string>",
"provider": "<string>",
"card_sub_type_category": "<string>",
"card_fingerprint": "<string>",
"juspay_bank_code": "<string>",
"card_isin": "<string>",
"card_brand": "<string>",
"card_issuer_country": "<string>"
}
]
}
}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>"
}List all saved payment methods
This endpoint acts as a proxy for JusPayโs Fetch Saved Payment Methods API. It enables to securely retrieve a list of payment methods (such as saved cards, UPI handles, wallets) that have been previously stored for a given customer.
The operation helps streamline the checkout flow by allowing users to quickly select from existing payment methods, reducing input friction and improving conversion.
You can filter the results by payment method type using the payment_method query parameter. Multiple payment methods can be specified by separating them with commas (e.g., payment_method=upi_collect,card,wallet).
API documentation of JusPay can be found at below link:
https://juspay.io/in/docs/api-reference/docs/express-checkout/fetch-saved-payment-methods
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/customers/{customer_id}/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"saved_payment_methods": {
"upi_collect": [
{
"count": 123,
"last_used": "<string>",
"vpa": "<string>"
}
],
"wallet": [
{
"id": "<string>",
"wallet": "<string>",
"gateway_reference_id": "<string>",
"last_refreshed": "<string>",
"linked": "<string>",
"metadata": {
"mobile_number": "<string>",
"device_id": "<string>"
},
"sub_details": {
"last_used": "<string>",
"current_balance": "<string>",
"last_refreshed": "<string>",
"payment_method": "<string>",
"payment_method_type": "<string>"
}
}
],
"card": [
{
"card_sub_type": "<string>",
"extended_card_type": "<string>",
"provider_category": "<string>",
"vault_provider": "<string>",
"card_type": "<string>",
"card_token": "<string>",
"card_exp_month": "<string>",
"expired": true,
"tokenize_support": true,
"card_exp_year": "<string>",
"name_on_card": "<string>",
"country_code": "<string>",
"card_number": "<string>",
"card_global_fingerprint": "<string>",
"nickname": "<string>",
"card_reference": "<string>",
"metadata": {
"origin_merchant_id": "<string>"
},
"card_issuer": "<string>",
"provider": "<string>",
"card_sub_type_category": "<string>",
"card_fingerprint": "<string>",
"juspay_bank_code": "<string>",
"card_isin": "<string>",
"card_brand": "<string>",
"card_issuer_country": "<string>"
}
]
}
}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>"
}Authorizations
Access token
Path Parameters
Customer Id
Query Parameters
Filter payment methods by type. Accepts multiple payment method types separated by commas. Example: payment_method=upi_collect,card,wallet. Available payment method types include: upi_collect, card, wallet.
Was this page helpful?