Payment Methods (Direct Workflow)
Retrieve Enrolled Payment Methods
Retrieves the list of payment methods a customer has enrolled
GET
/
customers
/
{customer_id}
/
payment-methods
Retrieve Enrolled Payment Methods
curl --request GET \
--url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v1/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://api-sandbox.y.uno/v1/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 => [
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_methods": [
{
"idempotency_key": null,
"name": "VISA ****1111",
"description": "VISA ****1111",
"icon": "https://icons.prod.y.uno/visa_logosimbolo.png",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "ENROLLED",
"sub_status": null,
"vaulted_token": "46adcbc0-aa26-4867-a4e7-28a5ad9100ae",
"callback_url": null,
"action": null,
"redirect_url": null,
"created_at": "2023-08-05T14:22:06.766268Z",
"updated_at": "2023-08-05T14:22:06.766268Z",
"card_data": {
"iin": "41111111",
"lfd": "1111",
"expiration_month": 3,
"expiration_year": 27,
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"issuer": null,
"issuer_name": "JPMORGAN_CHASE_BANK_NA",
"issuer_code": "US_JPMORGAN_CHASE_BANK_NA",
"category": null,
"type": "CREDIT"
},
"last_successfully_used": false,
"last_successfully_used_at": ""
},
{
"idempotency_key": null,
"name": "VISA ****1111",
"description": "VISA ****1111",
"icon": "https://icons.prod.y.uno/visa_logosimbolo.png",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "ENROLLED",
"sub_status": null,
"vaulted_token": "7ced7717-f860-4705-a376-58a714953de9",
"callback_url": null,
"action": null,
"redirect_url": null,
"created_at": "2023-08-05T14:45:24.112621Z",
"updated_at": "2023-08-05T14:45:24.112621Z",
"card_data": {
"iin": "41111111",
"lfd": "1111",
"expiration_month": 3,
"expiration_year": 27,
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"issuer": null,
"issuer_name": "JPMORGAN_CHASE_BANK_NA",
"issuer_code": "US_JPMORGAN_CHASE_BANK_NA",
"category": null,
"type": "CREDIT"
},
"last_successfully_used": false,
"last_successfully_used_at": ""
}
]
}{
"code": "INVALID_REQUEST",
"messages": [
"Invalid request"
]
}{
"code": "INVALID_CREDENTIALS",
"messages": [
"Invalid credentials"
]
}{
"code": "AUTHORIZATION_REQUIRED",
"messages": [
"The merchant has no authorization to use this API."
]
}Get the list of payment methods the user has enrolled.
Authorizations
Path Parameters
The unique identifier of the customer, created using the Create Customer endpoint (MAX 64; MIN 36).
Response
200
Show child attributes
Show child attributes
Was this page helpful?
Previous
Unenroll Payment MethodUnenrolls a customer's saved payment method and sets its status to UNENROLLED
Next
⌘I
Retrieve Enrolled Payment Methods
curl --request GET \
--url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v1/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://api-sandbox.y.uno/v1/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 => [
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_methods": [
{
"idempotency_key": null,
"name": "VISA ****1111",
"description": "VISA ****1111",
"icon": "https://icons.prod.y.uno/visa_logosimbolo.png",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "ENROLLED",
"sub_status": null,
"vaulted_token": "46adcbc0-aa26-4867-a4e7-28a5ad9100ae",
"callback_url": null,
"action": null,
"redirect_url": null,
"created_at": "2023-08-05T14:22:06.766268Z",
"updated_at": "2023-08-05T14:22:06.766268Z",
"card_data": {
"iin": "41111111",
"lfd": "1111",
"expiration_month": 3,
"expiration_year": 27,
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"issuer": null,
"issuer_name": "JPMORGAN_CHASE_BANK_NA",
"issuer_code": "US_JPMORGAN_CHASE_BANK_NA",
"category": null,
"type": "CREDIT"
},
"last_successfully_used": false,
"last_successfully_used_at": ""
},
{
"idempotency_key": null,
"name": "VISA ****1111",
"description": "VISA ****1111",
"icon": "https://icons.prod.y.uno/visa_logosimbolo.png",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "ENROLLED",
"sub_status": null,
"vaulted_token": "7ced7717-f860-4705-a376-58a714953de9",
"callback_url": null,
"action": null,
"redirect_url": null,
"created_at": "2023-08-05T14:45:24.112621Z",
"updated_at": "2023-08-05T14:45:24.112621Z",
"card_data": {
"iin": "41111111",
"lfd": "1111",
"expiration_month": 3,
"expiration_year": 27,
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"issuer": null,
"issuer_name": "JPMORGAN_CHASE_BANK_NA",
"issuer_code": "US_JPMORGAN_CHASE_BANK_NA",
"category": null,
"type": "CREDIT"
},
"last_successfully_used": false,
"last_successfully_used_at": ""
}
]
}{
"code": "INVALID_REQUEST",
"messages": [
"Invalid request"
]
}{
"code": "INVALID_CREDENTIALS",
"messages": [
"Invalid credentials"
]
}{
"code": "AUTHORIZATION_REQUIRED",
"messages": [
"The merchant has no authorization to use this API."
]
}