# Issuing Stock

The Issuing Stock resource tracks the inventory of physical card blanks available for embossing.

Each stock entry is associated with a specific card design and holder type.

Monitor your stock levels to ensure cards are available when needed.

### The Issuing Stock object

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | STRING | Unique identifier for the issuing stock. |
| `designId` | STRING | Id of the IssuingDesign of the card blanks in stock. |
| `embosserId` | STRING | Id of the embosser that holds this stock. |
| `embosserName` | STRING | Name of the embosser that holds this stock. |
| `balance` | INTEGER | Number of card blanks currently available in stock. Returned when "expand=balance" is informed in the request. |
| `created` | STRING | Creation datetime. Example: "2022-01-01T00:00:00.000000+00:00". |
| `updated` | STRING | Last update datetime. Example: "2022-01-01T00:00:00.000000+00:00". |

### List Issuing Stocks

`GET /v2/issuing-stock`

Get a list of issuing stocks 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. |
| `ids` | OPTIONAL | List of strings to get specific entities by ids. |
| `designIds` | OPTIONAL | List of strings to filter stocks by specific IssuingDesign ids. |
| `embosserIds` | OPTIONAL | List of strings to filter stocks by specific embosser ids. |
| `expand` | OPTIONAL | Fields to expand information on the response. Options: "balance". |

**Request**

```python
import starkinfra

stocks = starkinfra.issuingstock.query(limit=10)

for stock in stocks:
    print(stock)
```

**Response**

```python
IssuingStock(
    id=5715709195239424,
    design_id=6724771005489152,
    embosser_id=7834882116598271,
    embosser_name=Stark Embosser,
    balance=500,
    created=2022-01-01 00:00:00,
    updated=2022-01-01 00:00:00
)
```

### Get an Issuing Stock

`GET /v2/issuing-stock/:id`

Get a single issuing stock entry by its id.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `id` | REQUIRED | Id of the issuing stock entity. |
| `expand` | OPTIONAL | Fields to expand information on the response. Options: "balance". |

**Request**

```python
import starkinfra

stock = starkinfra.issuingstock.get("5715709195239424")

print(stock)
```

**Response**

```python
IssuingStock(
    id=5715709195239424,
    design_id=6724771005489152,
    embosser_id=7834882116598271,
    embosser_name=Stark Embosser,
    balance=500,
    created=2022-01-01 00:00:00,
    updated=2022-01-01 00:00:00
)
```

### List Issuing Stock Logs

`GET /v2/issuing-stock/log`

Get a paged list of issuing stock logs.

**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. |
| `types` | OPTIONAL | Filter logs by log types. |
| `stockIds` | OPTIONAL | Array of stock ids to filter logs. |
| `ids` | OPTIONAL | List of strings to get specific log entities by ids. |

**Request**

```python
import starkinfra

logs = starkinfra.issuingstock.log.query(
    limit=10,
    types=["created"]
)

for log in logs:
    print(log)
```

**Response**

```python
Log(
    id=6724771005489152,
    type=created,
    stock=IssuingStock(id=5715709195239424, balance=500),
    count=10,
    created=2022-01-01 00:00:00
)
```

### Get an Issuing Stock Log

`GET /v2/issuing-stock/log/:id`

Get a single issuing stock log by its id.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `id` | REQUIRED | Id of the log entity. |

**Request**

```python
import starkinfra

log = starkinfra.issuingstock.log.get("6724771005489152")

print(log)
```

**Response**

```python
Log(
    id=6724771005489152,
    type=created,
    stock=IssuingStock(id=5715709195239424, balance=500),
    count=10,
    created=2022-01-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-stock-python.md)
- [Node.js](https://docs.starkinfra.com/api/v2/issuing-stock-node.md)
- [PHP](https://docs.starkinfra.com/api/v2/issuing-stock-php.md)
- [Java](https://docs.starkinfra.com/api/v2/issuing-stock-java.md)
- [Ruby](https://docs.starkinfra.com/api/v2/issuing-stock-ruby.md)
- [Elixir](https://docs.starkinfra.com/api/v2/issuing-stock-elixir.md)
- [.NET](https://docs.starkinfra.com/api/v2/issuing-stock-dotnet.md)
- [Go](https://docs.starkinfra.com/api/v2/issuing-stock-go.md)
- [Clojure](https://docs.starkinfra.com/api/v2/issuing-stock-clojure.md)
- [cURL](https://docs.starkinfra.com/api/v2/issuing-stock-curl.md)
