Listar Métodos de Pagamento
curl --request GET \
--url https://api.billing.upag.io/v1/customers/{customerId}/payment-methods \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.billing.upag.io/v1/customers/{customerId}/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/customers/{customerId}/payment-methods';
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));Métodos de Pagamento
Listar Métodos de Pagamento
Retorna todos os métodos de pagamento de um cliente
GET
https://api.billing.upag.io
/
v1
/
customers
/
{customerId}
/
payment-methods
Listar Métodos de Pagamento
curl --request GET \
--url https://api.billing.upag.io/v1/customers/{customerId}/payment-methods \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.billing.upag.io/v1/customers/{customerId}/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/customers/{customerId}/payment-methods';
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));Retorna uma lista de todos os métodos de pagamento cadastrados para um cliente específico.
Endpoint
curl -G https://api.billing.upag.io/v1/customers/cus_ahwDXrgYvur89iPs/payment-methods \
-H "Authorization: Bearer {token}" \
-d page=1 \
-d limit=10
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const paymentMethods = await upag.paymentMethods.list('cus_ahwDXrgYvur89iPs', {
limit: 10,
page: 1,
});
Parâmetros
string
required
ID do cliente.
integer
Limita o número de métodos de pagamento retornados. Padrão:
10, máximo: 100.integer
Número da página a ser retornada. Padrão:
1.Resposta
Response
{
"data": [
{
"id": "pm_abc123xyz",
"livemode": false,
"type": "credit_card",
"expiresIn": null,
"expiryMonth": "12",
"expiryYear": "2025",
"firstDigits": "4111",
"lastDigits": "1111",
"brand": "visa",
"holderName": "JOHN DOE",
"createdAt": 1731622178441,
"updatedAt": 1731622178441
},
{
"id": "pm_pix123xyz",
"livemode": false,
"type": "pix",
"expiresIn": 600,
"expiryMonth": null,
"expiryYear": null,
"firstDigits": null,
"lastDigits": null,
"brand": null,
"holderName": null,
"createdAt": 1731622178441,
"updatedAt": 1731622178441
}
],
"total": 2
}