Skip to main content
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

filter[customer_id]
string
Filtra tarjetas por ID de cliente.
sort
string
default:"-created_at"
Ordenamiento por fecha de creación. Usa created_at para ascendente y -created_at para descendente (más reciente primero).
per_page
integer
default:"15"
Cantidad de resultados por página.
page
integer
default:"1"
Número de página para paginación.

Ejemplos de uso

curl https://api.onepay.la/v1/cards \
  -X GET \
  -H "Authorization: Bearer sk_test_xxx"
Con filtro por cliente:
curl "https://api.onepay.la/v1/cards?filter[customer_id]=9dd4158b-0e45-42bc-b56f-a4c1f856814d" \
  -X GET \
  -H "Authorization: Bearer sk_test_xxx"

Response

data
array
Lista de tarjetas.
current_page
integer
Página actual.
from
integer
Índice del primer registro en la página actual.
last_page
integer
Última página disponible.
per_page
integer
Cantidad de registros por página.
to
integer
Índice del último registro en la página actual.
total
integer
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
}