curl --request POST \
--url https://api.fintoc.com/v2/invoices/{id}/pay \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"external_payment": true
}
'import requests
url = "https://api.fintoc.com/v2/invoices/{id}/pay"
payload = { "external_payment": True }
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({external_payment: true})
};
fetch('https://api.fintoc.com/v2/invoices/{id}/pay', 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}/pay",
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([
'external_payment' => true
]),
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/{id}/pay"
payload := strings.NewReader("{\n \"external_payment\": true\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/{id}/pay")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_payment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/invoices/{id}/pay")
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 \"external_payment\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"attempt_count": 1,
"collection_method": "send_invoice",
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2bVdWyTnGq4PfLs7DkXjRm0CwIo",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"external_payment": false,
"hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"amount": 30000,
"currency": "CLP",
"description": "A premium plan",
"name": "Premium Plan",
"period_end": "2026-06-01T00:00:00Z",
"period_start": "2026-05-01T00:00:00Z",
"quantity": 1
}
],
"metadata": {},
"mode": "live",
"next_payment_attempt_at": "2026-05-02T12:00:00Z",
"payments": [
{
"amount": 30000,
"currency": "CLP",
"payment_intent": "pi_2bVdX2RsLu8TjPwBHoBnVq4G0Ms",
"status": "succeeded"
}
],
"reason": null,
"split": [
{
"amount": 8500,
"charge_processing_fee": true,
"entity_id": "ent_xK9mPq2RkV3WnDQG",
"inherited": true,
"metadata": {},
"type": "percentage"
}
],
"split_applied": [
{
"calculated_amount": 25500,
"charge_processing_fee": true,
"entity_id": "ent_xK9mPq2RkV3WnDQG",
"redirected": false,
"redirected_to_entity_id": "<string>",
"redirection_reason": "not_operational"
}
],
"status": "draft",
"subscription": "sub_2bVdWzKfHr5QgMt8ElYkSn1DxJp",
"total": 30000
}{
"error": {
"type": "invalid_request_error",
"code": "mutually_exclusive_params",
"param": "external_payment",
"message": "external_payment and payment_method are mutually exclusive",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "authorization_error",
"code": "product_access_required",
"param": null,
"message": "Your organization does not have access to the 'invoicing_invoices' product. To request access, email sales@fintoc.com.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"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_payable",
"message": "Invoice is not open (status=paid)",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Pay an invoice
Settles an open invoice, in the live or test mode of the API key used. By default Fintoc charges the invoice: pass payment_method to charge a specific method, or omit it to use the invoice’s default_payment_method. The method must belong to the invoice’s customer and be active. Use this to collect an invoice on demand, or to retry collection after a failed attempt with a different method. The charge is asynchronous: the invoice stays open with a pending payment until the charge resolves. Pass external_payment instead to mark the invoice paid because you collected it outside Fintoc. Fintoc moves the invoice to paid right away and creates no payment. Fintoc does not verify the amount you collected, and settling an invoice is not reversible.
curl --request POST \
--url https://api.fintoc.com/v2/invoices/{id}/pay \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"external_payment": true
}
'import requests
url = "https://api.fintoc.com/v2/invoices/{id}/pay"
payload = { "external_payment": True }
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({external_payment: true})
};
fetch('https://api.fintoc.com/v2/invoices/{id}/pay', 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}/pay",
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([
'external_payment' => true
]),
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/{id}/pay"
payload := strings.NewReader("{\n \"external_payment\": true\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/{id}/pay")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_payment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/invoices/{id}/pay")
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 \"external_payment\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"attempt_count": 1,
"collection_method": "send_invoice",
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2bVdWyTnGq4PfLs7DkXjRm0CwIo",
"default_payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"external_payment": false,
"hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"amount": 30000,
"currency": "CLP",
"description": "A premium plan",
"name": "Premium Plan",
"period_end": "2026-06-01T00:00:00Z",
"period_start": "2026-05-01T00:00:00Z",
"quantity": 1
}
],
"metadata": {},
"mode": "live",
"next_payment_attempt_at": "2026-05-02T12:00:00Z",
"payments": [
{
"amount": 30000,
"currency": "CLP",
"payment_intent": "pi_2bVdX2RsLu8TjPwBHoBnVq4G0Ms",
"status": "succeeded"
}
],
"reason": null,
"split": [
{
"amount": 8500,
"charge_processing_fee": true,
"entity_id": "ent_xK9mPq2RkV3WnDQG",
"inherited": true,
"metadata": {},
"type": "percentage"
}
],
"split_applied": [
{
"calculated_amount": 25500,
"charge_processing_fee": true,
"entity_id": "ent_xK9mPq2RkV3WnDQG",
"redirected": false,
"redirected_to_entity_id": "<string>",
"redirection_reason": "not_operational"
}
],
"status": "draft",
"subscription": "sub_2bVdWzKfHr5QgMt8ElYkSn1DxJp",
"total": 30000
}{
"error": {
"type": "invalid_request_error",
"code": "mutually_exclusive_params",
"param": "external_payment",
"message": "external_payment and payment_method are mutually exclusive",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "authorization_error",
"code": "product_access_required",
"param": null,
"message": "Your organization does not have access to the 'invoicing_invoices' product. To request access, email sales@fintoc.com.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"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_payable",
"message": "Invoice is not open (status=paid)",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Cuerpo
Set to true to mark the invoice paid because you collected it outside Fintoc, which creates no payment and charges nothing. Defaults to false. Works on any open invoice, including one Fintoc collects whose charge failed. When true, cannot be combined with payment_method.
true
Respuesta
Returns the invoice. When Fintoc charges it, the invoice stays open with a new pending payment in payments. When you collected it outside Fintoc, the invoice is paid with external_payment: true.
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ó?