> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fintoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The Invoice object

## The Invoice object

An invoice represents an amount your customer owes. You create an invoice explicitly, or Fintoc generates one automatically from a subscription. Each invoice lists its line items, tracks its payment attempts, and reflects the status of the customer's debt.

```json theme={null}
{
  "id": "inv_456789abcdef",
  "object": "invoice",
  "created_at": "2025-08-01T12:00:00Z",
  "currency": "CLP",
  "customer": "cus_asdlfknmuy",
  "hosted_invoice_url": "https://acme.billing.fintoc.com/invoices/inv_456789abcdef",
  "lines": [
    {
      "id": "il_348nasdfsdf",
      "object": "line_item",
      "amount": 15000,
      "currency": "CLP",
      "period_end": "2025-09-01T00:00:00Z",
      "period_start": "2025-08-01T00:00:00Z",
      "quantity": 1
    }
  ],
  "metadata": {},
  "mode": "live",
  "payments": [
    {
      "amount": 15000,
      "currency": "CLP",
      "payment_intent": "pi_duinkasdfb",
      "status": "succeeded"
    }
  ],
  "status": "paid",
  "subscription": "sub_123489rnas",
  "total": 15000
}
```

| Attribute            | Type               | Description                                                                                                                                                                                                 |
| -------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                 | `string`           | Unique identifier for the invoice.                                                                                                                                                                          |
| `object`             | `string`           | Type of the object. Always `invoice`.                                                                                                                                                                       |
| `created_at`         | `string`           | ISO 8601 datetime in UTC when the invoice was created.                                                                                                                                                      |
| `currency`           | `string`           | [Three-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html). Fintoc supports only `CLP`.                                                                                        |
| `customer`           | `string`           | ID of the customer this invoice bills.                                                                                                                                                                      |
| `hosted_invoice_url` | `string` or `null` | URL for the Fintoc-hosted page where your customer can view and pay the invoice. `null` until the invoice is `open`.                                                                                        |
| `lines`              | `array`            | Line items on the invoice. See the Line Item object below.                                                                                                                                                  |
| `metadata`           | `object` or `null` | Set of [key-value](/reference/fintoc-api/metadata) pairs you can attach to the invoice. Use `metadata` to store additional structured information about the invoice. `null` if the invoice has no metadata. |
| `mode`               | `string`           | One of `live` or `test`.                                                                                                                                                                                    |
| `payments`           | `array`            | Payment attempts made against the invoice. See the Invoice Payment object below.                                                                                                                            |
| `status`             | `string`           | Invoice status. One of `draft`, `open`, `paid`, or `void`.                                                                                                                                                  |
| `subscription`       | `string` or `null` | ID of the subscription that generated this invoice. `null` for invoices you create directly.                                                                                                                |
| `total`              | `integer`          | Total amount due, in the smallest currency unit. For example, `15000` for \$15,000 CLP, since CLP has no minor unit.                                                                                        |

## The Line Item object (within the Invoice object)

A line item represents a single charge on the invoice, including its amount, quantity, and billing period, and appears in the invoice's `lines` field.

| Attribute      | Type      | Description                                                                                                                   |
| -------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `id`           | `string`  | Unique identifier for the line item.                                                                                          |
| `object`       | `string`  | Type of the object. Always `line_item`.                                                                                       |
| `amount`       | `integer` | Amount for this line item, in the smallest currency unit. For example, `15000` for \$15,000 CLP, since CLP has no minor unit. |
| `currency`     | `string`  | [Three-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html). Fintoc supports only `CLP`.          |
| `period_end`   | `string`  | ISO 8601 datetime in UTC when the billing period ends.                                                                        |
| `period_start` | `string`  | ISO 8601 datetime in UTC when the billing period starts.                                                                      |
| `quantity`     | `integer` | Number of units for this line item.                                                                                           |

## The Invoice Payment object (within the Invoice object)

An invoice payment represents a single payment attempt against the invoice, with its amount, associated payment intent, and status, and appears in the invoice's `payments` field.

| Attribute        | Type      | Description                                                                                                          |
| ---------------- | --------- | -------------------------------------------------------------------------------------------------------------------- |
| `amount`         | `integer` | Payment amount, in the smallest currency unit. For example, `15000` for \$15,000 CLP, since CLP has no minor unit.   |
| `currency`       | `string`  | [Three-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html). Fintoc supports only `CLP`. |
| `payment_intent` | `string`  | ID of the `PaymentIntent` that processed this payment attempt.                                                       |
| `status`         | `string`  | One of `pending`, `succeeded`, or `failed`.                                                                          |
