# List the lines of an invoice

```http
GET https://secure.yoprint.com/v2/api/store/{team_slug}/v2/invoice/{unique_key}/item
```

- API version: v2
- Operation ID: `v2_public_invoice_item_index`
- Section: Invoices and payments › [Invoice line items](https://developer.yoprint.com/reference/invoice-line-items.md)
- Web page: https://developer.yoprint.com/reference/invoice-line-items/v2-invoice-item-index/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Returns every line of an invoice: billed sales order lines, shipping fees, discounts and the tax line. Not paged, and in no set order: sort by `position`.

| `product.type` | What it is |
| --- | --- |
| `order_item` | Bills a line of the sales order (any kind of product line). Name and unit price come from that line. |
| `shipment_fee` | A shipping charge with its own price. |
| `invoice_discount` | A discount, as a percentage or a fixed amount. |
| `user_tax` | Tax from one of your tax presets. |
| `override_tax` | A tax you set by hand: a fixed amount, a percentage, or tax exempt. |
| `auto_tax` | US Auto Tax, calculated by YoPrint's tax provider. |

The sales order line kinds (`db_catalog`, `user_simple`, `db_variant`, `custom`, `fee`) are not invoice kinds: to bill one, add an `order_item` line that points at it.

## Permission

Any member of the team.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.
- `unique_key` (string, required): The invoice's `id` (a hash id), as its answers show it. Its unique key (`ordinv_...`) also works, but API answers don't include it. Example `cBRpSf5nw6upt5`.

## Request body

This operation takes no request body.

### Example request

```bash
curl 'https://secure.yoprint.com/v2/api/store/your-team/v2/invoice/cBRpSf5nw6upt5/item' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1'
```

## Response

`200` Successful response.

Fields:

- `data` (array of objects, required)
  - Each item:
    - `_meta` (object, optional): Read-only: `id`, `type`, `invoice_id`, `lock_version`, `from_legacy`, `position_hash`.
    - `auto_invoice_managed` (boolean, optional): YoPrint manages this line (Auto Invoice).
    - `external_ids` (array of objects, optional): Links to external systems; empty for lines made in YoPrint.
    - `external_type` (string | null, optional)
    - `from_legacy` (boolean, optional)
    - `id` (string, optional): The invoice line.
    - `invoice_id` (string, optional): The invoice.
    - `is_external` (boolean, optional)
    - `lock_version` (integer, optional): Send it back on Update an invoice line to detect a concurrent change.
    - `position` (integer, optional)
    - `pricing` (object, optional): Absent on tax and discount lines. `system` (sales order lines): `_meta.unit_price` is the price copied from the sales order line and `_meta.subtotal` is that price × this line's quantity. `fee` (shipping fees): `product.total` is the fee. Prices come at the stored scale (6 decimal places); `_meta.subtotal` at the combined scale of price × quantity (compacted when large). Always read `dp`.
      - `type` (string, optional): One of: `"system"`, `"fee"`.
    - `product` (object, optional)
      - `_meta` (object, optional): Read-only details, always an object (with `editable_fields_on_update`); for `order_item`, `parent` describes the sales order line.
      - `properties` (object, optional): The kind's fields; for `order_item`, `id` is the sales order line. A discount's percentage or amount comes back as `total` (you send it as `rate`).
      - `type` (string, optional): One of: `"order_item"`, `"shipment_fee"`, `"invoice_discount"`, `"user_tax"`, `"override_tax"`, `"auto_tax"`, `"invoice_surcharge"`.
    - `quantity` (object, optional): Absent on tax and discount lines.
      - `type` (string, optional): Always `"unit"`.
      - `total` (decimal pair, optional): The quantity. A decimal pair: the amount is `value` ÷ 10^`dp` (`{ "value": 1250, "dp": 2 }` is 12.50). Read `dp` every time: it can differ between fields and records. See https://developer.yoprint.com/concepts/money-and-quantities.md.
    - `tax` (object, optional): Absent on tax and discount lines. YoPrint adds it by default only to sales order lines (`taxable`); other lines have it only when it was sent.
      - `type` (string, optional): One of: `"taxable"`, `"non_taxable"`.
    - `type` (string, optional): Same as `product.type`.
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": [
    {
      "_meta": {
        "from_legacy": false,
        "id": "nhsGsn84PyJBvK",
        "invoice_id": "cBRpSf5nw6upt5",
        "lock_version": 1730000000000000,
        "position_hash": "EXAMPLEpositionHash",
        "type": "order_item"
      },
      "auto_invoice_managed": false,
      "external_ids": [],
      "external_type": null,
      "from_legacy": false,
      "id": "nhsGsn84PyJBvK",
      "invoice_id": "cBRpSf5nw6upt5",
      "is_external": false,
      "lock_version": 1730000000000000,
      "position": 100,
      "position_hash": "EXAMPLEpositionHash",
      "pricing": {
        "_meta": {
          "subtotal": {
            "dp": 0,
            "value": 300
          },
          "unit_price": {
            "dp": 6,
            "value": 12500000
          }
        },
        "type": "system"
      },
      "product": {
        "_meta": {
          "parent": {
            "product_name": "Gildan 5000 T-shirt"
          }
        },
        "properties": {
          "id": "ZJTJ2uF5dMiArL"
        },
        "type": "order_item"
      },
      "quantity": {
        "total": {
          "dp": 0,
          "value": 24
        },
        "type": "unit"
      },
      "tax": {
        "type": "taxable"
      },
      "type": "order_item"
    }
  ],
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
  - When: The invoice isn't your team's. Fix: Check the invoice id.

## Related

- [Add a line to an invoice](https://developer.yoprint.com/reference/invoice-line-items/v2-invoice-item-create.md): `POST /v2/api/store/{team_slug}/v2/invoice/{unique_key}/item`
- [Add, change and remove invoice lines at once](https://developer.yoprint.com/reference/invoice-line-items/v2-invoice-item-bulk.md): `POST /v2/api/store/{team_slug}/v2/invoice/{unique_key}/item/bulk`
- [Get an invoice](https://developer.yoprint.com/reference/invoices/v2-invoice-show.md): `GET /v2/api/store/{team_slug}/v2/invoice/{unique_key}`
