curl --request POST \
--url https://api.fintoc.com/v2/invoices/{id}/finalize \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v2/invoices/{id}/finalize"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v2/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.fintoc.com/v2/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",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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.fintoc.com/v2/invoices/{id}/finalize"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.fintoc.com/v2/invoices/{id}/finalize")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/invoices/{id}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"collection_method": "charge_automatically",
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2bVdWyTnGq4PfLs7DkXjRm0CwIo",
"hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"name": "Design",
"description": "Design work",
"amount": 30000,
"currency": "CLP",
"period_end": null,
"period_start": null,
"quantity": 1
}
],
"metadata": null,
"mode": "live",
"payments": [],
"status": "open",
"subscription": null,
"total": 30000
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "id",
"message": "No such invoice: inv_fake_id",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invoice_not_finalizable",
"message": "Invoice cannot be finalized because it is in status: void",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Finalize an invoice
Finalizes a draft invoice, moving its status to open. This is how you advance an invoice for collection: Fintoc never finalizes invoices automatically. When the invoice has a default_payment_method and its collection_method is charge_automatically, Fintoc charges the invoice right after finalizing. Finalizing an invoice that is already open, or a zero-amount invoice that Fintoc already marked as paid, returns the invoice unchanged. You cannot finalize a paid invoice with a positive total or a void invoice.
curl --request POST \
--url https://api.fintoc.com/v2/invoices/{id}/finalize \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v2/invoices/{id}/finalize"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v2/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.fintoc.com/v2/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",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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.fintoc.com/v2/invoices/{id}/finalize"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.fintoc.com/v2/invoices/{id}/finalize")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/invoices/{id}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"collection_method": "charge_automatically",
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2bVdWyTnGq4PfLs7DkXjRm0CwIo",
"hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"name": "Design",
"description": "Design work",
"amount": 30000,
"currency": "CLP",
"period_end": null,
"period_start": null,
"quantity": 1
}
],
"metadata": null,
"mode": "live",
"payments": [],
"status": "open",
"subscription": null,
"total": 30000
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "id",
"message": "No such invoice: inv_fake_id",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invoice_not_finalizable",
"message": "Invoice cannot be finalized because it is in status: void",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}draft hasta que llamas a este endpoint.Esa regla no vale para las invoices que emite una suscripción. Fintoc crea cada invoice de suscripción en draft y la finaliza después de 1 hora, la pasa a open y la cobra. La excepción es la primera invoice de una suscripción, que Fintoc finaliza de inmediato. Consulta Gestionar invoices.Llama a este endpoint sobre una invoice de suscripción solo para cobrar la invoice antes de que termine la ventana de una hora en draft.Respuesta
The invoice after the finalize request succeeds.
The way Fintoc collects the invoice. charge_automatically means Fintoc charges default_payment_method once the invoice is finalized. send_invoice means Fintoc leaves the invoice open for you to collect, through hosted_invoice_url or outside Fintoc. Subscription invoices inherit the collection method when issued and keep that collection method even if the subscription changes later.
charge_automatically, send_invoice "send_invoice"
ISO 8601 timestamp of the next scheduled automatic charge attempt. null when no further attempt is scheduled. Also null on the preview invoice carried by an invoice.upcoming event, where lines[].period_start marks the charge date.
"2026-05-02T12:00:00Z"
Payment attempts to collect the invoice. If a Mexican direct debit charge fails validation before reaching the bank, Fintoc adds no payment. Examples include an amount out of range, an exceeded limit, or an inactive mandate. Fintoc doesn't retry the charge or send invoice.payment_failed.
Show child attributes
Show child attributes
Reason the invoice reports inconsistent. split_amount_mismatch means the flat split amounts do not add up to total, or a percentage split leaves an entity with no amount, so Fintoc cannot finalize the invoice. For every other status, the value is null.
split_amount_mismatch, null null
Status of the invoice. Invoices start as draft, become open when finalized, and end as paid, void, or uncollectible. An uncollectible invoice is no longer expected to be paid. A draft whose split can no longer be applied to total reports inconsistent until you update split or lines. The reason field explains why. The preview invoice carried by an invoice.upcoming event reports draft and never appears when you list invoices.
draft, open, paid, void, uncollectible, inconsistent "draft"
¿Esta página le ayudó?