Pagar Fatura
curl --request POST \
--url https://api.billing.upag.io/v1/invoices/{id}/pay \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.billing.upag.io/v1/invoices/{id}/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/invoices/{id}/pay';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Faturas
Pagar Fatura
Processa o pagamento de uma fatura
POST
https://api.billing.upag.io
/
v1
/
invoices
/
{id}
/
pay
Pagar Fatura
curl --request POST \
--url https://api.billing.upag.io/v1/invoices/{id}/pay \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.billing.upag.io/v1/invoices/{id}/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/invoices/{id}/pay';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Processa o pagamento de uma fatura utilizando o método de pagamento associado. A fatura deve estar com status
open.
Endpoint
cURL
curl -X POST https://api.billing.upag.io/v1/invoices/inv_abc123xyz/pay \
-H "Authorization: Bearer {token}"
Parâmetros
string
required
ID único da fatura, começando com
inv_.Resposta
Response
{
"id": "inv_abc123xyz",
"customerId": "cus_ahwDXrgYvur89iPs",
"paymentMethodId": "pm_abc123xyz",
"currency": "BRL",
"status": "paid",
"livemode": false,
"number": "INV-001",
"description": null,
"dueDate": "2024-12-15T00:00:00.000Z",
"paidAt": "2024-11-15T11:00:00.000Z",
"amountDue": 9900,
"amountPaid": 9900,
"attemptCount": 1,
"subscriptionId": null,
"items": [
{
"id": "ii_abc123xyz",
"priceId": "price_def456ghi",
"quantity": 1,
"amount": 9900
}
],
"payments": [],
"createdAt": "2024-11-15T10:00:00.000Z",
"updatedAt": "2024-11-15T11:00:00.000Z"
}