Métodos de pago (flujo directo)
Obtener métodos de pago inscritos
Obtiene la lista de métodos de pago que un cliente ha inscrito
GET
/
customers
/
{customer_id}
/
payment-methods
Obtener métodos de pago inscritos
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."
]
}Obtén la lista de métodos de pago que el usuario ha inscrito.
Los instrumentos almacenados mediante un CIT de Apple Pay o Google Pay (
vault_on_success: true) no se incluyen en esta lista de forma intencional. El vaulted_token solo se devuelve en la respuesta de pago del CIT, por lo que debes guardarlo de tu lado. Un token de billetera almacenado aún se puede resolver con Obtener método de pago inscrito por ID. Consulta Credenciales almacenadas.Este endpoint tiene alcance de organización: devuelve los métodos de pago inscritos del cliente sin importar desde qué cuenta lo llames, no solo la cuenta usada para inscribirlos. Consulta Cuentas para saber por qué, y qué hacer si tu organización gestiona varias empresas que necesitan registros de clientes separados.
Autorizaciones
Parámetros de ruta
El identificador único del cliente, creado con el endpoint Create Customer (MAX 64; MIN 36).
¿Esta página le ayudó?
⌘I
Obtener métodos de pago inscritos
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."
]
}