# Static Brcode

A Static Brcode is a QR Code that can receive multiple Pix payments with a fixed or open amount.

Here we will show you how to create and manage them.

### The Static Brcode Object

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | STRING | Unique id for the static Brcode. |
| `name` | STRING | Receiver name displayed in the QR code. |
| `keyId` | STRING | Pix key to which payments will be directed. |
| `city` | STRING | City of the receiver. |
| `amount` | INTEGER | Fixed amount in cents. Leave empty for open amount QR codes. |
| `reconciliationId` | STRING | Reconciliation ID included in the QR code. |
| `cashierBankCode` | STRING | Bank ISPB code of the cashier for Pix Saque/Troco operations. |
| `type` | STRING | Type of the static Brcode. Options: "instant", "instantAndOrSubscription". |
| `description` | STRING | Description of the static Brcode. |
| `tags` | LIST OF STRINGS | Tags associated with the static Brcode. |
| `uuid` | STRING | Unique UUID used to identify this QR code. |
| `url` | STRING | URL for the QR code image. |
| `created` | STRING | Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00". |
| `updated` | STRING | Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00". |

### Create Static Brcodes

`POST /v2/static-brcode`

Create static Pix QR codes for receiving payments.

You can create up to 100 static Brcodes in a single request.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `keyId` | REQUIRED | Pix key to which payments will be directed. |
| `name` | REQUIRED | Receiver name displayed in the QR code. |
| `city` | REQUIRED | City of the receiver. |
| `amount` | OPTIONAL | Fixed amount in cents. Leave empty for open amount QR codes. |
| `cashierBankCode` | OPTIONAL | Bank ISPB code of the cashier for Pix Saque/Troco operations. |
| `type` | OPTIONAL | Type of the static Brcode. Options: "instant", "instantAndOrSubscription". Defaults to "instant". |
| `description` | OPTIONAL | Description of the static Brcode. |
| `reconciliationId` | OPTIONAL | Reconciliation ID included in the QR code. |
| `tags` | OPTIONAL | Array of strings to tag the entity for future queries. |

**Request**

```python
import starkinfra

brcodes = starkinfra.staticbrcode.create([
    starkinfra.StaticBrcode(
        name="Jon Snow",
        key_id="+5511989898989",
        city="São Paulo",
        amount=1000,
        cashier_bank_code="20018183",
        type="instant",
        reconciliation_id="my-reconciliation-id",
        description="Payment for services",
        tags=["invoice", "payment"]
    )
])

for brcode in brcodes:
    print(brcode)
```

**Response**

```python
[
    StaticBrcode(
        id="5656565656565656",
        name="Jon Snow",
        key_id="+5511989898989",
        city="São Paulo",
        amount=1000,
        reconciliation_id="my-reconciliation-id",
        cashier_bank_code="20018183",
        type="instant",
        description="Payment for services",
        tags=["invoice", "payment"],
        uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        url="https://brcode.starkinfra.com/static-qrcode/a1b2c3d4-e5f6-7890-abcd-ef1234567890.png",
        created="2022-01-01T00:00:00+00:00",
        updated="2022-01-01T00:00:00+00:00"
    )
]
```

### List Static Brcodes

`GET /v2/static-brcode`

List and filter all static Brcodes. Results are paged.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `after` | OPTIONAL | Filter entities created after this date. |
| `before` | OPTIONAL | Filter entities created before this date. |
| `cursor` | OPTIONAL | String used to get the next batch of results. |
| `fields` | OPTIONAL | List of strings to filter response JSON keys. Not available in the SDKs. |
| `limit` | OPTIONAL | Number of results per cursor. Max = 100. |
| `tags` | OPTIONAL | Filter entities that contain the specified tags. |
| `uuids` | OPTIONAL | Filter by UUIDs. |

**Request**

```python
import starkinfra

brcodes = starkinfra.staticbrcode.query(
    limit=10,
    after="2022-01-01",
    before="2022-12-31",
    uuids=["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
    tags=["invoice"]
)

for brcode in brcodes:
    print(brcode)
```

**Response**

```python
StaticBrcode(
    id="5656565656565656",
    name="Jon Snow",
    key_id="+5511989898989",
    city="São Paulo",
    amount=1000,
    reconciliation_id="my-reconciliation-id",
    cashier_bank_code="20018183",
    type="instant",
    description="Payment for services",
    tags=["invoice"],
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    url="https://brcode.starkinfra.com/static-qrcode/a1b2c3d4-e5f6-7890-abcd-ef1234567890.png",
    created="2022-01-01T00:00:00+00:00",
    updated="2022-01-01T00:00:00+00:00"
)
```

### Get a Static Brcode

`GET /v2/static-brcode/:uuid`

Get a single static Brcode by its UUID.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `uuid` | REQUIRED | UUID of the static Brcode. |

**Request**

```python
import starkinfra

brcode = starkinfra.staticbrcode.get("a1b2c3d4-e5f6-7890-abcd-ef1234567890")

print(brcode)
```

**Response**

```python
StaticBrcode(
    id="5656565656565656",
    name="Jon Snow",
    key_id="+5511989898989",
    city="São Paulo",
    amount=1000,
    reconciliation_id="my-reconciliation-id",
    cashier_bank_code="20018183",
    type="instant",
    description="Payment for services",
    tags=["invoice", "payment"],
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    url="https://brcode.starkinfra.com/static-qrcode/a1b2c3d4-e5f6-7890-abcd-ef1234567890.png",
    created="2022-01-01T00:00:00+00:00",
    updated="2022-01-01T00:00: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/static-brcode-python.md)
- [Node.js](https://docs.starkinfra.com/api/v2/static-brcode-node.md)
- [PHP](https://docs.starkinfra.com/api/v2/static-brcode-php.md)
- [Java](https://docs.starkinfra.com/api/v2/static-brcode-java.md)
- [Ruby](https://docs.starkinfra.com/api/v2/static-brcode-ruby.md)
- [Elixir](https://docs.starkinfra.com/api/v2/static-brcode-elixir.md)
- [.NET](https://docs.starkinfra.com/api/v2/static-brcode-dotnet.md)
- [Go](https://docs.starkinfra.com/api/v2/static-brcode-go.md)
- [Clojure](https://docs.starkinfra.com/api/v2/static-brcode-clojure.md)
- [cURL](https://docs.starkinfra.com/api/v2/static-brcode-curl.md)
