Moyens de paiement (flux direct)
Récupérer les moyens de paiement inscrits
Récupère la liste des moyens de paiement qu’un client a inscrits
GET
/
customers
/
{customer_id}
/
payment-methods
Récupérer les moyens de paiement inscrits
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",
"metadata": [
{
"key": "on_behalf_of",
"value": "acct_1A2b3C4d5E6f7G8h"
},
{
"key": "order_ref",
"value": "ABC-123"
}
],
"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."
]
}Obtenez la liste des moyens de paiement auxquels l’utilisateur s’est inscrit.
Les instruments enregistrés dans le vault par un CIT Apple Pay ou Google Pay (
vault_on_success: true) ne sont volontairement pas inclus dans cette liste. Le vaulted_token est renvoyé uniquement dans la réponse de paiement du CIT, conservez-le donc de votre côté. Un jeton de portefeuille stocké peut toujours être résolu avec Retrieve Enrolled Payment Method by ID. Voir Stored credentials.Cet endpoint est limité à l’organisation : il renvoie les moyens de paiement inscrits du client quel que soit le compte depuis lequel vous l’appelez, et pas seulement le compte utilisé pour les inscrire. Voir Accounts pour comprendre pourquoi, et pour savoir quoi faire si votre organisation gère plusieurs sociétés qui ont besoin de fiches client séparées.
Autorisations
Paramètres de chemin
L'identifiant unique du client, créé avec l'endpoint Créer un client (MAX 64 ; MIN 36).
Cette page vous a-t-elle été utile ?
⌘I
Récupérer les moyens de paiement inscrits
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",
"metadata": [
{
"key": "on_behalf_of",
"value": "acct_1A2b3C4d5E6f7G8h"
},
{
"key": "order_ref",
"value": "ABC-123"
}
],
"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."
]
}