Listar cartões
curl --request GET \
--url https://api.upag.io/v1/cards \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/cards';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cartões
Listar cartões
Lista os cartões ativos da conta, opcionalmente de um cliente
GET
https://api.upag.io
/
v1
/
cards
Listar cartões
curl --request GET \
--url https://api.upag.io/v1/cards \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/cards';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Lista os cartões ativos da conta (
Campos em Referência.
status: active, não removidos), do mais recente para o mais antigo. Sem customer, traz todos, inclusive os que ainda não têm cliente vinculado.
Permissão: card.read. Apenas chave secreta (sk_…); chave publicável não lista cartões.
Os exemplos usam o sandbox (
https://api.upag.dev/v1). Em produção use https://api.upag.io/v1 com sk_live_….Endpoint
curl -G https://api.upag.dev/v1/cards \
-H "Authorization: Bearer sk_test_your_api_key" \
-d "customer=8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83" \
-d "page=1" \
-d "limit=15"
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const { data, count } = await upag.cards.list({
customer: '8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83',
page: 1,
limit: 15,
});
Parâmetros
string (uuid)
Filtra pelos cartões vinculados a este cliente.
integer
default:"1"
Página, a partir de 1.
integer
default:"15"
Itens por página, mínimo 1.
Resposta
200 OK. count é o total que corresponde ao filtro.
Response
{
"data": [
{
"id": "5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15",
"customer": "8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83",
"brand": "visa",
"firstDigits": "424242",
"lastDigits": "4242",
"holderName": "Luke Skywalker",
"expirationMonth": 11,
"expirationYear": 2031,
"funding": "credit",
"wallet": null,
"status": "active",
"createdAt": "2026-07-27T18:04:11.482Z",
"updatedAt": "2026-07-27T18:06:04.331Z"
}
],
"count": 1
}
Erros
| Status | Causa |
|---|---|
403 | Chave publicável (este endpoint exige chave secreta) ou sem a permissão card.read |
422 | customer não é UUID, ou page/limit inválidos |