Faturas
Finalizar uma fatura
Finalizar uma fatura.
Finalizar uma fatura
curl --request POST \
--url https://api.chargefy.io/v1/invoices/{id}/finalizeimport requests
url = "https://api.chargefy.io/v1/invoices/{id}/finalize"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.chargefy.io/v1/invoices/{id}/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chargefy.io/v1/invoices/{id}/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.chargefy.io/v1/invoices/{id}/finalize"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chargefy.io/v1/invoices/{id}/finalize")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chargefy.io/v1/invoices/{id}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"id": "inv_ztXkaV1WLnrmCafN",
"object": "invoice",
"affiliates": [],
"allow_late_payment": true,
"amount_credit_balance_applied": 0,
"amount_discount": 0,
"amount_due": 12990,
"amount_due_now": 12990,
"amount_paid": 0,
"amount_remaining": 12990,
"amount_subtotal": 12990,
"amount_tax": 0,
"amount_total": 12990,
"attempt_count": 0,
"billing_reason": "manual",
"collection_method": "send_invoice",
"created_at": "2026-05-19T18:00:00Z",
"currency": "brl",
"customer": "cus_9KaTnfYPTCwvFLAd",
"customer_billing_address": {
"city": "São Paulo",
"country": "BR",
"line1": "Av. Paulista, 1000",
"line2": "Conjunto 101",
"postal_code": "01310-100",
"state": "SP"
},
"customer_billing_name": "Cliente Exemplo",
"customer_document": "12345678901",
"customer_document_type": "cpf",
"customer_email": "[email protected]",
"customer_name": "Cliente Exemplo",
"default_payment_method": null,
"description": "Mensalidade de junho",
"due_date": "2026-06-10T12:00:00Z",
"ending_balance": 0,
"finalized_at": "2026-05-19T18:00:00Z",
"hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
"interest": {
"percent_per_month": 1
},
"interest_amount": null,
"invoice_pdf_url": "https://billing.chargefy.io/invoice/inv_ztXkaV1WLnrmCafN.pdf",
"late_fee": {
"type": "percentage",
"value": 2
},
"late_fee_amount": null,
"latest_charge": null,
"line_items": [
{
"id": "ili_GyVv5CghtCEFZTQj",
"object": "invoice_line_item",
"amount_discount": 0,
"amount_subtotal": 12990,
"amount_tax": 0,
"amount_total": 12990,
"currency": "brl",
"description": "Mensalidade de junho",
"discountable": true,
"metadata": {},
"period_end": null,
"period_start": null,
"position": 0,
"price": null,
"price_data": {
"currency": "brl",
"unit_amount": 12990
},
"product": null,
"proration": false,
"proration_details": {},
"quantity": 1,
"recurring_interval": null,
"recurring_interval_count": null,
"subscription_item": null,
"unit_amount": 12990
}
],
"livemode": true,
"marked_uncollectible_at": null,
"metadata": {},
"next_payment_attempt": null,
"number": "K7M2-0001",
"paid_at": null,
"paid_out_of_band": false,
"payment_intent": "pi_9kQ2mVx7LpZ4TfRb",
"payment_method_types": [
"pix",
"boleto",
"credit_card"
],
"payment_settings": {
"payment_method_options": null
},
"starting_balance": 0,
"statement_descriptor": "MENSALIDADE",
"status": "open",
"subscription": null,
"surcharge_amount": 0,
"updated_at": "2026-05-19T18:00:00Z",
"voided_at": null
}
Finaliza um rascunho após a revisão. Congela os itens, termos e dados atuais do cliente, aplica o crédito disponível e devolve a invoice completa com link público. Se não houver valor a cobrar, fica
paid, sem criar tentativa de pagamento.
Repetir a finalização de uma invoice open ou paid não consome crédito nem cria outro pagamento ou evento. Uma invoice void ou uncollectible retorna 409.
Antes de finalizar um rascunho avulso, corrija um vencimento que já passou. Uma falha preserva o rascunho, sem reservar número ou crédito. A entrega segue o valor de delivery salvo na fatura.
string
obrigatório
ID da invoice (
inv_*).{
"id": "inv_ztXkaV1WLnrmCafN",
"object": "invoice",
"affiliates": [],
"allow_late_payment": true,
"amount_credit_balance_applied": 0,
"amount_discount": 0,
"amount_due": 12990,
"amount_due_now": 12990,
"amount_paid": 0,
"amount_remaining": 12990,
"amount_subtotal": 12990,
"amount_tax": 0,
"amount_total": 12990,
"attempt_count": 0,
"billing_reason": "manual",
"collection_method": "send_invoice",
"created_at": "2026-05-19T18:00:00Z",
"currency": "brl",
"customer": "cus_9KaTnfYPTCwvFLAd",
"customer_billing_address": {
"city": "São Paulo",
"country": "BR",
"line1": "Av. Paulista, 1000",
"line2": "Conjunto 101",
"postal_code": "01310-100",
"state": "SP"
},
"customer_billing_name": "Cliente Exemplo",
"customer_document": "12345678901",
"customer_document_type": "cpf",
"customer_email": "[email protected]",
"customer_name": "Cliente Exemplo",
"default_payment_method": null,
"description": "Mensalidade de junho",
"due_date": "2026-06-10T12:00:00Z",
"ending_balance": 0,
"finalized_at": "2026-05-19T18:00:00Z",
"hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
"interest": {
"percent_per_month": 1
},
"interest_amount": null,
"invoice_pdf_url": "https://billing.chargefy.io/invoice/inv_ztXkaV1WLnrmCafN.pdf",
"late_fee": {
"type": "percentage",
"value": 2
},
"late_fee_amount": null,
"latest_charge": null,
"line_items": [
{
"id": "ili_GyVv5CghtCEFZTQj",
"object": "invoice_line_item",
"amount_discount": 0,
"amount_subtotal": 12990,
"amount_tax": 0,
"amount_total": 12990,
"currency": "brl",
"description": "Mensalidade de junho",
"discountable": true,
"metadata": {},
"period_end": null,
"period_start": null,
"position": 0,
"price": null,
"price_data": {
"currency": "brl",
"unit_amount": 12990
},
"product": null,
"proration": false,
"proration_details": {},
"quantity": 1,
"recurring_interval": null,
"recurring_interval_count": null,
"subscription_item": null,
"unit_amount": 12990
}
],
"livemode": true,
"marked_uncollectible_at": null,
"metadata": {},
"next_payment_attempt": null,
"number": "K7M2-0001",
"paid_at": null,
"paid_out_of_band": false,
"payment_intent": "pi_9kQ2mVx7LpZ4TfRb",
"payment_method_types": [
"pix",
"boleto",
"credit_card"
],
"payment_settings": {
"payment_method_options": null
},
"starting_balance": 0,
"statement_descriptor": "MENSALIDADE",
"status": "open",
"subscription": null,
"surcharge_amount": 0,
"updated_at": "2026-05-19T18:00:00Z",
"voided_at": null
}
⌘I
Finalizar uma fatura
curl --request POST \
--url https://api.chargefy.io/v1/invoices/{id}/finalizeimport requests
url = "https://api.chargefy.io/v1/invoices/{id}/finalize"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.chargefy.io/v1/invoices/{id}/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chargefy.io/v1/invoices/{id}/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.chargefy.io/v1/invoices/{id}/finalize"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chargefy.io/v1/invoices/{id}/finalize")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chargefy.io/v1/invoices/{id}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"id": "inv_ztXkaV1WLnrmCafN",
"object": "invoice",
"affiliates": [],
"allow_late_payment": true,
"amount_credit_balance_applied": 0,
"amount_discount": 0,
"amount_due": 12990,
"amount_due_now": 12990,
"amount_paid": 0,
"amount_remaining": 12990,
"amount_subtotal": 12990,
"amount_tax": 0,
"amount_total": 12990,
"attempt_count": 0,
"billing_reason": "manual",
"collection_method": "send_invoice",
"created_at": "2026-05-19T18:00:00Z",
"currency": "brl",
"customer": "cus_9KaTnfYPTCwvFLAd",
"customer_billing_address": {
"city": "São Paulo",
"country": "BR",
"line1": "Av. Paulista, 1000",
"line2": "Conjunto 101",
"postal_code": "01310-100",
"state": "SP"
},
"customer_billing_name": "Cliente Exemplo",
"customer_document": "12345678901",
"customer_document_type": "cpf",
"customer_email": "[email protected]",
"customer_name": "Cliente Exemplo",
"default_payment_method": null,
"description": "Mensalidade de junho",
"due_date": "2026-06-10T12:00:00Z",
"ending_balance": 0,
"finalized_at": "2026-05-19T18:00:00Z",
"hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
"interest": {
"percent_per_month": 1
},
"interest_amount": null,
"invoice_pdf_url": "https://billing.chargefy.io/invoice/inv_ztXkaV1WLnrmCafN.pdf",
"late_fee": {
"type": "percentage",
"value": 2
},
"late_fee_amount": null,
"latest_charge": null,
"line_items": [
{
"id": "ili_GyVv5CghtCEFZTQj",
"object": "invoice_line_item",
"amount_discount": 0,
"amount_subtotal": 12990,
"amount_tax": 0,
"amount_total": 12990,
"currency": "brl",
"description": "Mensalidade de junho",
"discountable": true,
"metadata": {},
"period_end": null,
"period_start": null,
"position": 0,
"price": null,
"price_data": {
"currency": "brl",
"unit_amount": 12990
},
"product": null,
"proration": false,
"proration_details": {},
"quantity": 1,
"recurring_interval": null,
"recurring_interval_count": null,
"subscription_item": null,
"unit_amount": 12990
}
],
"livemode": true,
"marked_uncollectible_at": null,
"metadata": {},
"next_payment_attempt": null,
"number": "K7M2-0001",
"paid_at": null,
"paid_out_of_band": false,
"payment_intent": "pi_9kQ2mVx7LpZ4TfRb",
"payment_method_types": [
"pix",
"boleto",
"credit_card"
],
"payment_settings": {
"payment_method_options": null
},
"starting_balance": 0,
"statement_descriptor": "MENSALIDADE",
"status": "open",
"subscription": null,
"surcharge_amount": 0,
"updated_at": "2026-05-19T18:00:00Z",
"voided_at": null
}

