Buscar Método de Pagamento por ID
curl --request GET \
--url https://api.billing.upag.io/v1/customers/{customerId}/payment-methods/{paymentMethodId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.billing.upag.io/v1/customers/{customerId}/payment-methods/{paymentMethodId}', 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/{paymentMethodId}';
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
Buscar Método de Pagamento por ID
Retorna os detalhes de um método de pagamento específico
GET
https://api.billing.upag.io
/
v1
/
customers
/
{customerId}
/
payment-methods
/
{paymentMethodId}
Buscar Método de Pagamento por ID
curl --request GET \
--url https://api.billing.upag.io/v1/customers/{customerId}/payment-methods/{paymentMethodId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.billing.upag.io/v1/customers/{customerId}/payment-methods/{paymentMethodId}', 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/{paymentMethodId}';
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 as informações completas de um método de pagamento específico.
Endpoint
curl https://api.billing.upag.io/v1/customers/cus_ahwDXrgYvur89iPs/payment-methods/pm_abc123xyz \
-H "Authorization: Bearer {token}"
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const paymentMethod = await upag.paymentMethods.retrieve(
'cus_ahwDXrgYvur89iPs',
'pm_abc123xyz',
);
Parâmetros
string
required
ID do cliente.
string
required
ID único do método de pagamento, começando com
pm_.Resposta
Response
{
"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
}