curl --request POST \
--url https://api.fintoc.com/v2/invoices \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"lines": [
{
"amount": 100000,
"currency": "CLP",
"name": "Arriendo unidad A-401",
"quantity": 1
}
],
"split": [
{
"entity_id": "ent_6Qd3kZvNxL8r",
"type": "flat",
"amount": 90000,
"charge_processing_fee": true
},
{
"entity_id": "ent_4Pq7sLwXy2Nc",
"type": "flat",
"amount": 10000
}
]
}
'import requests
url = "https://api.fintoc.com/v2/invoices"
payload = {
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"lines": [
{
"amount": 100000,
"currency": "CLP",
"name": "Arriendo unidad A-401",
"quantity": 1
}
],
"split": [
{
"entity_id": "ent_6Qd3kZvNxL8r",
"type": "flat",
"amount": 90000,
"charge_processing_fee": True
},
{
"entity_id": "ent_4Pq7sLwXy2Nc",
"type": "flat",
"amount": 10000
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: 'cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu',
default_payment_method: 'pm_2c4mDhAbCdEfGhIjKlMnOpQrStu',
lines: [{amount: 100000, currency: 'CLP', name: 'Arriendo unidad A-401', quantity: 1}],
split: [
{
entity_id: 'ent_6Qd3kZvNxL8r',
type: 'flat',
amount: 90000,
charge_processing_fee: true
},
{entity_id: 'ent_4Pq7sLwXy2Nc', type: 'flat', amount: 10000}
]
})
};
fetch('https://api.fintoc.com/v2/invoices', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer' => 'cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu',
'default_payment_method' => 'pm_2c4mDhAbCdEfGhIjKlMnOpQrStu',
'lines' => [
[
'amount' => 100000,
'currency' => 'CLP',
'name' => 'Arriendo unidad A-401',
'quantity' => 1
]
],
'split' => [
[
'entity_id' => 'ent_6Qd3kZvNxL8r',
'type' => 'flat',
'amount' => 90000,
'charge_processing_fee' => true
],
[
'entity_id' => 'ent_4Pq7sLwXy2Nc',
'type' => 'flat',
'amount' => 10000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v2/invoices"
payload := strings.NewReader("{\n \"customer\": \"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu\",\n \"default_payment_method\": \"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu\",\n \"lines\": [\n {\n \"amount\": 100000,\n \"currency\": \"CLP\",\n \"name\": \"Arriendo unidad A-401\",\n \"quantity\": 1\n }\n ],\n \"split\": [\n {\n \"entity_id\": \"ent_6Qd3kZvNxL8r\",\n \"type\": \"flat\",\n \"amount\": 90000,\n \"charge_processing_fee\": true\n },\n {\n \"entity_id\": \"ent_4Pq7sLwXy2Nc\",\n \"type\": \"flat\",\n \"amount\": 10000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": \"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu\",\n \"default_payment_method\": \"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu\",\n \"lines\": [\n {\n \"amount\": 100000,\n \"currency\": \"CLP\",\n \"name\": \"Arriendo unidad A-401\",\n \"quantity\": 1\n }\n ],\n \"split\": [\n {\n \"entity_id\": \"ent_6Qd3kZvNxL8r\",\n \"type\": \"flat\",\n \"amount\": 90000,\n \"charge_processing_fee\": true\n },\n {\n \"entity_id\": \"ent_4Pq7sLwXy2Nc\",\n \"type\": \"flat\",\n \"amount\": 10000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": \"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu\",\n \"default_payment_method\": \"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu\",\n \"lines\": [\n {\n \"amount\": 100000,\n \"currency\": \"CLP\",\n \"name\": \"Arriendo unidad A-401\",\n \"quantity\": 1\n }\n ],\n \"split\": [\n {\n \"entity_id\": \"ent_6Qd3kZvNxL8r\",\n \"type\": \"flat\",\n \"amount\": 90000,\n \"charge_processing_fee\": true\n },\n {\n \"entity_id\": \"ent_4Pq7sLwXy2Nc\",\n \"type\": \"flat\",\n \"amount\": 10000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"collection_method": "charge_automatically",
"attempt_count": 0,
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"hosted_invoice_url": null,
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"name": "Design",
"description": "Design work",
"amount": 60000,
"currency": "CLP",
"period_end": null,
"period_start": null,
"quantity": 2
},
{
"id": "il_2bVdX1QrKt7SiOvAGnAmUp3FzLr",
"object": "line_item",
"name": "Hosting",
"description": "Hosting",
"amount": 40000,
"currency": "CLP",
"period_end": null,
"period_start": null,
"quantity": 1
}
],
"metadata": {
"order_id": "12345"
},
"mode": "live",
"next_payment_attempt_at": null,
"payments": [],
"status": "draft",
"subscription": null,
"total": 100000
}Create an invoice
Creates a one-off invoice for a customer, in the live or test mode of the API key used. The invoice is not tied to a subscription and starts in draft status. Fintoc does not charge the invoice until you finalize it. The total is the sum of the lines, which must all share the same currency. The collection_method decides how Fintoc collects the invoice once you finalize it. With charge_automatically, the default, Fintoc charges default_payment_method, so the payment method is required. With send_invoice, Fintoc leaves the invoice open for you to collect, and default_payment_method is optional.
curl --request POST \
--url https://api.fintoc.com/v2/invoices \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"lines": [
{
"amount": 100000,
"currency": "CLP",
"name": "Arriendo unidad A-401",
"quantity": 1
}
],
"split": [
{
"entity_id": "ent_6Qd3kZvNxL8r",
"type": "flat",
"amount": 90000,
"charge_processing_fee": true
},
{
"entity_id": "ent_4Pq7sLwXy2Nc",
"type": "flat",
"amount": 10000
}
]
}
'import requests
url = "https://api.fintoc.com/v2/invoices"
payload = {
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"lines": [
{
"amount": 100000,
"currency": "CLP",
"name": "Arriendo unidad A-401",
"quantity": 1
}
],
"split": [
{
"entity_id": "ent_6Qd3kZvNxL8r",
"type": "flat",
"amount": 90000,
"charge_processing_fee": True
},
{
"entity_id": "ent_4Pq7sLwXy2Nc",
"type": "flat",
"amount": 10000
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: 'cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu',
default_payment_method: 'pm_2c4mDhAbCdEfGhIjKlMnOpQrStu',
lines: [{amount: 100000, currency: 'CLP', name: 'Arriendo unidad A-401', quantity: 1}],
split: [
{
entity_id: 'ent_6Qd3kZvNxL8r',
type: 'flat',
amount: 90000,
charge_processing_fee: true
},
{entity_id: 'ent_4Pq7sLwXy2Nc', type: 'flat', amount: 10000}
]
})
};
fetch('https://api.fintoc.com/v2/invoices', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer' => 'cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu',
'default_payment_method' => 'pm_2c4mDhAbCdEfGhIjKlMnOpQrStu',
'lines' => [
[
'amount' => 100000,
'currency' => 'CLP',
'name' => 'Arriendo unidad A-401',
'quantity' => 1
]
],
'split' => [
[
'entity_id' => 'ent_6Qd3kZvNxL8r',
'type' => 'flat',
'amount' => 90000,
'charge_processing_fee' => true
],
[
'entity_id' => 'ent_4Pq7sLwXy2Nc',
'type' => 'flat',
'amount' => 10000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v2/invoices"
payload := strings.NewReader("{\n \"customer\": \"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu\",\n \"default_payment_method\": \"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu\",\n \"lines\": [\n {\n \"amount\": 100000,\n \"currency\": \"CLP\",\n \"name\": \"Arriendo unidad A-401\",\n \"quantity\": 1\n }\n ],\n \"split\": [\n {\n \"entity_id\": \"ent_6Qd3kZvNxL8r\",\n \"type\": \"flat\",\n \"amount\": 90000,\n \"charge_processing_fee\": true\n },\n {\n \"entity_id\": \"ent_4Pq7sLwXy2Nc\",\n \"type\": \"flat\",\n \"amount\": 10000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": \"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu\",\n \"default_payment_method\": \"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu\",\n \"lines\": [\n {\n \"amount\": 100000,\n \"currency\": \"CLP\",\n \"name\": \"Arriendo unidad A-401\",\n \"quantity\": 1\n }\n ],\n \"split\": [\n {\n \"entity_id\": \"ent_6Qd3kZvNxL8r\",\n \"type\": \"flat\",\n \"amount\": 90000,\n \"charge_processing_fee\": true\n },\n {\n \"entity_id\": \"ent_4Pq7sLwXy2Nc\",\n \"type\": \"flat\",\n \"amount\": 10000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": \"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu\",\n \"default_payment_method\": \"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu\",\n \"lines\": [\n {\n \"amount\": 100000,\n \"currency\": \"CLP\",\n \"name\": \"Arriendo unidad A-401\",\n \"quantity\": 1\n }\n ],\n \"split\": [\n {\n \"entity_id\": \"ent_6Qd3kZvNxL8r\",\n \"type\": \"flat\",\n \"amount\": 90000,\n \"charge_processing_fee\": true\n },\n {\n \"entity_id\": \"ent_4Pq7sLwXy2Nc\",\n \"type\": \"flat\",\n \"amount\": 10000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"collection_method": "charge_automatically",
"attempt_count": 0,
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"hosted_invoice_url": null,
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"name": "Design",
"description": "Design work",
"amount": 60000,
"currency": "CLP",
"period_end": null,
"period_start": null,
"quantity": 2
},
{
"id": "il_2bVdX1QrKt7SiOvAGnAmUp3FzLr",
"object": "line_item",
"name": "Hosting",
"description": "Hosting",
"amount": 40000,
"currency": "CLP",
"period_end": null,
"period_start": null,
"quantity": 1
}
],
"metadata": {
"order_id": "12345"
},
"mode": "live",
"next_payment_attempt_at": null,
"payments": [],
"status": "draft",
"subscription": null,
"total": 100000
}Body
The way Fintoc collects the invoice. One of charge_automatically (Fintoc charges default_payment_method once you finalize the invoice) or send_invoice (Fintoc leaves the invoice open for you to collect, through hosted_invoice_url or outside Fintoc). Defaults to charge_automatically.
charge_automatically, send_invoice "send_invoice"
Rules for dividing the payment of the invoice between entities. Available for organizations with splits enabled. Provide 1 to 10 entries. All entries must use the same type. Each entity_id can appear only once. When Fintoc deducts processing fees from your payouts, at least one entry must pay the processing fee. When Fintoc invoices you for processing fees, no entry can pay the fee. For flat splits, amounts must add up to the invoice total. For percentage splits, amounts must add up to 10000 basis points (100%).
Show child attributes
Show child attributes
Response
The created invoice, in draft status.
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"
Was this page helpful?