# Issuing Billing Invoice

The Issuing Billing Invoice resource represents the invoice that settles the postpaid usage of your issuing operation in a billing period.

Each invoice consolidates the purchases and withdrawals settled in the billing period and can be paid via its brcode or link.

Fine and interest are applied when the invoice is paid after the due date.

### The Issuing Billing Invoice object

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | STRING | Unique identifier for the issuing billing invoice. |
| `taxId` | STRING | Tax id (CPF or CNPJ) of the invoice payer. Example: "012.345.678-90". |
| `name` | STRING | Name of the invoice payer. |
| `amount` | INTEGER | Current invoice amount in cents, including fine and interest when overdue. Example: 100000 (= R$ 1,000.00). |
| `nominalAmount` | INTEGER | Original invoice amount in cents, before fine and interest. Example: 100000 (= R$ 1,000.00). |
| `fine` | FLOAT | Fine percentage applied when paid after the due date. Example: 2.0. |
| `interest` | FLOAT | Monthly interest percentage applied when paid after the due date. Example: 1.0. |
| `status` | STRING | Current invoice status. Options: "created", "pending", "overdue", "expired", "paid". |
| `brcode` | STRING | Pix BR Code that can be used to pay the invoice. |
| `link` | STRING | Link to the invoice payment page. |
| `due` | STRING | Invoice due datetime. Example: "2022-02-10T00:00:00.000000+00:00". |
| `start` | STRING | Start datetime of the billing period. Example: "2022-01-01T00:00:00.000000+00:00". |
| `end` | STRING | End datetime of the billing period. Example: "2022-01-31T23:59:59.999999+00:00". |
| `created` | STRING | Creation datetime. Example: "2022-02-01T00:00:00.000000+00:00". |
| `updated` | STRING | Last update datetime. Example: "2022-02-01T00:00:00.000000+00:00". |

### List Issuing Billing Invoices

`GET /v2/issuing-billing-invoice`

Get a list of issuing billing invoices in chunks of at most 100.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `limit` | OPTIONAL | Number of results per cursor. Max = 100. |
| `cursor` | OPTIONAL | String used to get the next batch of results. Our SDKs handle this for you. |
| `after` | OPTIONAL | Filter entities created after this date. |
| `before` | OPTIONAL | Filter entities created before this date. |
| `status` | OPTIONAL | Filter entities by status. Options: "created", "pending", "overdue", "expired", "paid". |
| `ids` | OPTIONAL | List of strings to get specific entities by ids. |

**Request**

```python
import starkinfra
from datetime import date

billing_invoices = starkinfra.issuingbillinginvoice.query(
    after=date(2023, 1, 1),
    before=date(2024, 3, 1),
    limit=10
)

for billing_invoice in billing_invoices:
    print(billing_invoice)
```

**Response**

```python
IssuingBillingInvoice(
    id=5715709195239424,
    name=Tony Stark,
    tax_id=012.345.678-90,
    fine=2.0,
    interest=1.0,
    status=pending,
    amount=100000,
    nominal_amount=100000,
    brcode=00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B,
    link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    due=2022-02-10 00:00:00,
    start=2022-01-01 00:00:00,
    end=2022-01-31 23:59:59,
    created=2022-02-01 00:00:00,
    updated=2022-02-01 00:00:00
)
```

### Get an Issuing Billing Invoice

`GET /v2/issuing-billing-invoice/:id`

Get a single issuing billing invoice by its id.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `id` | REQUIRED | Id of the issuing billing invoice entity. |

**Request**

```python
import starkinfra

billing_invoice = starkinfra.issuingbillinginvoice.get("5715709195239424")

print(billing_invoice)
```

**Response**

```python
IssuingBillingInvoice(
    id=5715709195239424,
    name=Tony Stark,
    tax_id=012.345.678-90,
    fine=2.0,
    interest=1.0,
    status=pending,
    amount=100000,
    nominal_amount=100000,
    brcode=00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B,
    link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    due=2022-02-10 00:00:00,
    start=2022-01-01 00:00:00,
    end=2022-01-31 23:59:59,
    created=2022-02-01 00:00:00,
    updated=2022-02-01 00:00:00
)
```

## Available Languages

Code samples on this page are in Python. The same content is available with samples in:

- [Python](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-python.md)
- [Node.js](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-node.md)
- [PHP](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-php.md)
- [Java](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-java.md)
- [Ruby](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-ruby.md)
- [Elixir](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-elixir.md)
- [.NET](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-dotnet.md)
- [Go](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-go.md)
- [Clojure](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-clojure.md)
- [cURL](https://docs.starkinfra.com/api/v2/issuing-billing-invoice-curl.md)
