sk_test_...). Cada passo usa o ID retornado no anterior.
SDK servidor: upag (upag-node). Frontend: upag-js.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Quickstart Billing: crie cliente, método de pagamento e cobrança com a API ou SDK upag (sk_test).
sk_test_...). Cada passo usa o ID retornado no anterior.
SDK servidor: upag (upag-node). Frontend: upag-js.
curl -X POST https://api.billing.upag.io/v1/customers \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+5511999999999",
"taxId": "12345678900"
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const customer = await upag.customers.create({
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+5511999999999',
taxId: '12345678900',
});
curl -X POST https://api.billing.upag.io/v1/customers/cus_ahwDXrgYvur89iPs/payment-methods \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "credit_card",
"card": {
"number": "4242424242424242",
"expiryMonth": "12",
"expiryYear": "2032",
"cvv": "123",
"holderName": "JOHN DOE"
}
}'
const paymentMethod = await upag.paymentMethods.create(customer.id, {
type: 'credit_card',
card: {
number: '4242424242424242',
expiryMonth: '12',
expiryYear: '2032',
cvv: '123',
holderName: 'JOHN DOE',
},
});
curl -X POST https://api.billing.upag.io/v1/payments \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"customer": "cus_ahwDXrgYvur89iPs",
"paymentMethod": "pm_abc123xyz",
"amount": 1000,
"currency": "BRL",
"installments": 1
}'
const payment = await upag.payments.create({
customer: customer.id,
paymentMethod: paymentMethod.id,
amount: 1000,
currency: 'brl',
installments: 1,
});
console.log('Pagamento criado:', payment.id, payment.status);