curl --request PATCH \
--url https://api.fintoc.com/v2/invoices/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"order_id": "1234"
}
}
'{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"attempt_count": 0,
"collection_method": "charge_automatically",
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2bVdWyTnGq4PfLs7DkXjRm0CwIo",
"default_payment_method": "pm_2bVdX3StMv9UkQxCIpCoWr5H1Nt",
"hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"name": "Premium Plan",
"description": "A premium plan",
"amount": 30000,
"currency": "CLP",
"period_end": "2026-06-01T00:00:00Z",
"period_start": "2026-05-01T00:00:00Z",
"quantity": 1
}
],
"metadata": {
"order_id": "1234"
},
"mode": "live",
"next_payment_attempt_at": null,
"payments": [],
"status": "open",
"subscription": "sub_2bVdWzKfHr5QgMt8ElYkSn1DxJp",
"total": 30000
}Update an invoice
Updates the metadata or the split of the invoice with the given id. You can change metadata at any point in the invoice’s lifecycle, including after it is paid or voided. When metadata is provided, it replaces the entire existing metadata object. If you omit it, the invoice keeps its current metadata. You can change split only while the invoice is in draft status. Changing split replaces the current rules as a whole, including the rules the invoice inherited from its subscription. The invoice must belong to your organization and to the live or test mode of the API key used.
curl --request PATCH \
--url https://api.fintoc.com/v2/invoices/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"order_id": "1234"
}
}
'{
"id": "inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"object": "invoice",
"attempt_count": 0,
"collection_method": "charge_automatically",
"created_at": "2026-05-01T12:00:00Z",
"currency": "CLP",
"customer": "cus_2bVdWyTnGq4PfLs7DkXjRm0CwIo",
"default_payment_method": "pm_2bVdX3StMv9UkQxCIpCoWr5H1Nt",
"hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_2bVdWxLpzXq8RkNcM3JtUv9AhTe",
"lines": [
{
"id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
"object": "line_item",
"name": "Premium Plan",
"description": "A premium plan",
"amount": 30000,
"currency": "CLP",
"period_end": "2026-06-01T00:00:00Z",
"period_start": "2026-05-01T00:00:00Z",
"quantity": 1
}
],
"metadata": {
"order_id": "1234"
},
"mode": "live",
"next_payment_attempt_at": null,
"payments": [],
"status": "open",
"subscription": "sub_2bVdWzKfHr5QgMt8ElYkSn1DxJp",
"total": 30000
}Cuerpo
Rules for dividing the payment of the invoice between entities. Replaces the current rules as a whole, so send every entry you want to keep. Only for invoices in draft status. 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
Respuesta
The updated invoice, including its line items and payments. When you set split, split holds the new rules.
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ó?