Listar assinaturas
curl --request GET \
--url https://api.upag.io/v1/subscriptions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/subscriptions';
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));Assinaturas
Listar assinaturas
Lista as assinaturas da conta, da mais nova para a mais antiga
GET
https://api.upag.io
/
v1
/
subscriptions
Listar assinaturas
curl --request GET \
--url https://api.upag.io/v1/subscriptions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/subscriptions';
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 as assinaturas da conta, da mais nova para a mais antiga, com filtros opcionais.
Permissão:
Cada item tem o mesmo formato do objeto assinatura.
subscription.read. Apenas chave secreta (sk_…).
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/subscriptions \
-H "Authorization: Bearer sk_test_your_api_key" \
-d "status=active" \
-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.subscriptions.list({
status: 'active',
customer: '8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83',
page: 1,
limit: 15,
});
Query
string
Filtra por status:
active, canceled, past_due, trialing, incomplete, paused ou void.string (uuid)
Filtra pelas assinaturas de um cliente.
boolean
true ou false: filtra as que vão (ou não) cancelar no fim do período.string (uuid)
Filtra por um ID específico.
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 de assinaturas que batem com o filtro, não o tamanho da página.
Response
{
"data": [
{
"id": "9a3c6e1f-0d58-4b72-a4e9-7c2f8b5d1e36",
"customer": "8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83",
"paymentMethod": "card",
"card": "5f0c3d1a-7b2e-4c9d-8a41-0e6f2b9d7c15",
"status": "active",
"currency": "brl",
"interval": "month",
"intervalCount": 1,
"cancelAtPeriodEnd": false,
"startDate": "2026-10-07T19:00:00.000Z",
"endDate": null,
"trialStartDate": null,
"trialEndDate": null,
"trialEndBehavior": null,
"currentPeriodStart": "2026-10-07T19:00:00.000Z",
"currentPeriodEnd": "2026-11-07T19:00:00.000Z",
"canceledAt": null,
"cancellationReason": null,
"items": [
{
"id": "c6d2f9a4-7e18-4b35-9a60-3f1e8d5b2c07",
"product": "7d2b5e90-1c34-4a68-b9f7-0e3a6c8d1f25",
"price": "3a7e9c14-6b2d-4f85-9e10-5c8d2a7b4f61",
"name": "Plano mensal",
"amount": 9900,
"quantity": 1,
"totalAmount": 9900,
"createdAt": "2026-10-07T19:00:00.000Z",
"updatedAt": "2026-10-07T19:00:00.000Z"
}
],
"createdAt": "2026-10-07T19:00:00.000Z",
"updatedAt": "2026-10-07T19:00:05.000Z"
}
],
"count": 1
}