# List export types and their columns

```http
GET https://secure.yoprint.com/v1/api/store/{team_slug}/data_export/definitions
```

- API version: v1
- Operation ID: `v1_public_data_export_definitions`
- Section: Imports and exports › [Data exports](https://developer.yoprint.com/reference/data-exports.md)
- Web page: https://developer.yoprint.com/reference/data-exports/v1-data-export-definitions/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Returns every export type with the columns you can ask for. Use the column `id`s in `columns` when you create an export or a preset.

The answer is an object keyed by export type. `date_range` says whether the type needs `start_date` and `end_date`. `date_fields` lists the values of `date_field`, which only the sales order export accepts; for other types it always says `issue_date` and can be ignored. It is the same for every team.

## 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`.

## Request body

This operation takes no request body.

### Example request

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

## Response

`200` Successful response.

Fields:

- `data` (object, required): One entry per export type, keyed by type.
  - `customer_list` (object, optional)
    - `columns` (array of objects, required): In the default order of the file.
      - Each item:
        - `id` (string, required): Send this in `columns`.
        - `label` (string, required): The column's name in the web app.
    - `date_fields` (array of strings, required): The values of `date_field`. Only the sales order export reads it; ignore it for the others.
    - `date_range` (boolean, required): True when the export needs `start_date` and `end_date`.
    - `schema_version` (integer, required): Version of the column list (1).
  - `invoice_item_list` (object, optional): Same fields as `data.customer_list` above.
  - `invoice_list` (object, optional): Same fields as `data.customer_list` above.
  - `payment_list` (object, optional): Same fields as `data.customer_list` above.
  - `purchase_order_list` (object, optional): Same fields as `data.customer_list` above.
  - `sales_order_list` (object, optional): Same fields as `data.customer_list` above.
  - `simple_product_list` (object, optional): Same fields as `data.customer_list` above.
  - `tax_list` (object, optional): Same fields as `data.customer_list` above.
  - `variant_product_list` (object, optional): Same fields as `data.customer_list` above.
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": {
    "sales_order_list": {
      "columns": [
        {
          "id": "name",
          "label": "Name"
        },
        {
          "id": "order_id",
          "label": "Order Id"
        },
        {
          "id": "total",
          "label": "Total"
        }
      ],
      "date_fields": [
        "issue_date",
        "deposit_due",
        "due_date",
        "ship_due_date",
        "cust_due_date",
        "start_date"
      ],
      "date_range": true,
      "schema_version": 1
    },
    "simple_product_list": {
      "columns": [
        {
          "id": "title",
          "label": "Title"
        },
        {
          "id": "brand",
          "label": "Brand"
        },
        {
          "id": "price",
          "label": "Price"
        },
        {
          "id": "status",
          "label": "Sales Status"
        }
      ],
      "date_fields": [
        "issue_date"
      ],
      "date_range": false,
      "schema_version": 1
    }
  },
  "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.

## Notes

- The example is shortened; the real answer lists all nine types and every column.

## Related

- [Save an export column preset](https://developer.yoprint.com/reference/data-exports/v1-data-export-presets-store.md): `POST /v1/api/store/{team_slug}/data_export/presets`
- [Export sales orders in a date range to CSV](https://developer.yoprint.com/reference/data-exports/v1-data-export-export-sales-order.md): `POST /v1/api/store/{team_slug}/data_export/export_sales_order`
