Listar tarjetas
curl --request GET \
--url https://api.onepay.la/v1/cards \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/cards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/cards', 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.onepay.la/v1/cards",
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://api.onepay.la/v1/cards"
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://api.onepay.la/v1/cards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/cards")
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{
"data": [
{
"id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"brand": "Mastercard",
"label": "Mastercard • 8099",
"last_four": "8099",
"expiration_date": "9/2026",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-19T18:29:25.000000Z",
"country": "CO"
},
{
"id": "9e01eeae-4569-4564-9d04-84d1d1d027a3",
"brand": "Visa",
"label": "Visa • 4242",
"last_four": "4242",
"expiration_date": "12/2027",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-20T10:15:30.000000Z",
"country": "CO"
}
],
"current_page": 1,
"from": 1,
"last_page": 3,
"per_page": 15,
"to": 15,
"total": 42
}
Listar tarjetas
Endpoint para obtener las tarjetas tokenizadas registradas en tu empresa.
GET
/
cards
Listar tarjetas
curl --request GET \
--url https://api.onepay.la/v1/cards \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/cards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/cards', 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.onepay.la/v1/cards",
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://api.onepay.la/v1/cards"
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://api.onepay.la/v1/cards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/cards")
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{
"data": [
{
"id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"brand": "Mastercard",
"label": "Mastercard • 8099",
"last_four": "8099",
"expiration_date": "9/2026",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-19T18:29:25.000000Z",
"country": "CO"
},
{
"id": "9e01eeae-4569-4564-9d04-84d1d1d027a3",
"brand": "Visa",
"label": "Visa • 4242",
"last_four": "4242",
"expiration_date": "12/2027",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-20T10:15:30.000000Z",
"country": "CO"
}
],
"current_page": 1,
"from": 1,
"last_page": 3,
"per_page": 15,
"to": 15,
"total": 42
}
Query Parameters
Filtra tarjetas por ID de cliente.
Ordenamiento por fecha de creación. Usa
created_at para ascendente y -created_at para descendente (más reciente primero).Cantidad de resultados por página.
Número de página para paginación.
Ejemplos de uso
- curl
- JavaScript
- Python
curl https://api.onepay.la/v1/cards \
-X GET \
-H "Authorization: Bearer sk_test_xxx"
curl "https://api.onepay.la/v1/cards?filter[customer_id]=9dd4158b-0e45-42bc-b56f-a4c1f856814d" \
-X GET \
-H "Authorization: Bearer sk_test_xxx"
const response = await fetch('https://api.onepay.la/v1/cards?filter[customer_id]=9dd4158b-0e45-42bc-b56f-a4c1f856814d', {
method: 'GET',
headers: {
'Authorization': 'Bearer sk_test_xxx',
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.onepay.la/v1/cards',
params={'filter[customer_id]': '9dd4158b-0e45-42bc-b56f-a4c1f856814d'},
headers={'Authorization': 'Bearer sk_test_xxx'},
)
data = response.json()
Response
Lista de tarjetas.
Show Propiedades de cada tarjeta
Show Propiedades de cada tarjeta
UUID de la tarjeta tokenizada.
Marca de la tarjeta (
Mastercard, Visa, etc.).Etiqueta legible, por ejemplo
Mastercard • 8099.Últimos 4 dígitos de la tarjeta.
Fecha de vencimiento en formato
MM/YYYY, por ejemplo 9/2026.UUID del cliente al que pertenece la tarjeta.
Fecha de creación en formato ISO 8601.
Código de país donde fue registrada la tarjeta, por ejemplo
CO.Página actual.
Índice del primer registro en la página actual.
Última página disponible.
Cantidad de registros por página.
Índice del último registro en la página actual.
Total de tarjetas.
Ejemplo de respuesta
{
"data": [
{
"id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"brand": "Mastercard",
"label": "Mastercard • 8099",
"last_four": "8099",
"expiration_date": "9/2026",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-19T18:29:25.000000Z",
"country": "CO"
},
{
"id": "9e01eeae-4569-4564-9d04-84d1d1d027a3",
"brand": "Visa",
"label": "Visa • 4242",
"last_four": "4242",
"expiration_date": "12/2027",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-20T10:15:30.000000Z",
"country": "CO"
}
],
"current_page": 1,
"from": 1,
"last_page": 3,
"per_page": 15,
"to": 15,
"total": 42
}
Was this page helpful?
⌘I