<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# List products

`GET https://marketplace-api.sequifi.com/v1/products`

Module: Products · operationId: `listProducts` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/list-products

Lists your company's active products so you can map each product or package in your system to a Sequifi product. Send the integer `id` as `product_id` on `POST /v1/sales`. The string field called `product_id` in this response is the product code, not the id.

**What happens:**

- Read-only. Only active products that are not deleted are listed.
- `product_codes` lists every code `POST /v1/sales` matches for each product, in lowercase. Send a code as listed; case does not matter. `POST /v1/sales` also matches the product name.

**Filtering and paging:**

- `name` is a partial match on the product name; `%` and `_` act as wildcards.
- `page` (default 1) must be a positive whole number and `per_page` (default 100) a whole number from 1 to 200, else `400`. An unknown parameter returns `400`.
- Ordered by name, then `id`. `last_page` is `0` when nothing matches.

**Formats:**

- `effective_date` is `YYYY-MM-DD`. `created_date` and `updated_date` are `YYYY-MM-DD HH:MM:SS` with no time zone.

**Errors:**

- `400 Invalid query parameter(s)`: an unknown parameter; `data.allowed_params` lists the valid ones.
- `400 page must be a positive integer` or `per_page must be an integer between 1 and 200`.
- `401`: missing, invalid or expired token. The body is `{"message": "Unauthorized"}`.
- `500 Internal Server Error`: retry later.

**Common mistakes:**

- Posting a sale with the `id` of a product that is not in this list (inactive or deleted). A new sale then lands on your company's default product, and `data.warnings[]` says so. Ask your Sequifi admin first.
- Mapping only to `product_id`. A product can have several codes; check `product_codes` before reporting a product as unmapped.
- Matching by name when two products share a name. `POST /v1/sales` picks one of them; send the `id`.

**Related:**

- `GET /v1/products/{id}`: one product, including inactive ones.
- `GET /v1/milestones?product=<id>`: the milestones for a product.
- `POST /v1/sales`: send `product_id`.

## Query parameters

- `page` (integer): Page number, starting at 1. Must be a positive whole number, else `400`. Default: `1`. Minimum: 1.
- `per_page` (integer): Products per page. Default 100, maximum 200. Must be a whole number in range, else `400`. Default: `100`. Minimum: 1. Maximum: 200.
- `name` (string): Partial match on the product name. `%` and `_` act as wildcards. Example: `Solar`.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/products" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: One page of active products.

- `status` (integer): The HTTP status code, repeated. Example: `200`.
- `message` (string): Short text. Wording varies by endpoint; branch on the HTTP status, not on this text. Example: `success`.
- `data` (object)
  - `requestedBy` (string): Name of the API credential that made the call.
  - `current_page` (integer): Page returned.
  - `per_page` (integer): Page size used.
  - `total` (integer): Number of active products that match.
  - `last_page` (integer): Last page number. `0` when nothing matches.
  - `products` (array of object): Products on this page, ordered by name.
    - `id` (integer): Product id. Send it as `product_id` on `POST /v1/sales`.
    - `product_id` (string): The product code (not the id).
    - `product_codes` (array of string): Every code `POST /v1/sales` matches for this product, in lowercase, starting with the `product_id` code when it matches. A code two products share is listed only on the product a sale lands on. An inactive product's `product_id` code does not match and is not listed. Empty when no code matches this product.
    - `name` (string): Product name.
    - `description` (string, nullable): Product description.
    - `effective_date` (string (date), nullable): Effective date, `YYYY-MM-DD`.
    - `created_date` (string): When the product was created, `YYYY-MM-DD HH:MM:SS` with no time zone.
    - `updated_date` (string): When the product was last changed, `YYYY-MM-DD HH:MM:SS` with no time zone.
    - `status` (string): `active` or `inactive`. The list returns active products only. One of: `active`, `inactive`.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "current_page": 1,
    "per_page": 100,
    "total": 2,
    "last_page": 1,
    "products": [
      {
        "id": 14,
        "product_id": "SOL-GRND",
        "product_codes": [
          "sol-grnd",
          "sol-ground"
        ],
        "name": "Solar Ground Mount",
        "description": "Ground-mounted residential system",
        "effective_date": "2026-01-01",
        "created_date": "2026-01-02 09:00:00",
        "updated_date": "2026-04-02 11:15:00",
        "status": "active"
      },
      {
        "id": 12,
        "product_id": "SOL-ROOF",
        "product_codes": [
          "sol-roof"
        ],
        "name": "Solar Rooftop",
        "description": "Roof-mounted residential system",
        "effective_date": "2026-01-01",
        "created_date": "2026-01-02 09:00:00",
        "updated_date": "2026-05-12 14:30:00",
        "status": "active"
      }
    ]
  }
}
```

### 400: Unknown parameter, or invalid `page` or `per_page`.

Example (unknown_param): Unknown query parameter

```json
{
  "status": 400,
  "message": "Invalid query parameter(s)",
  "data": {
    "invalid_params": [
      "category"
    ],
    "allowed_params": [
      "page",
      "per_page",
      "name"
    ]
  }
}
```

### 401: Missing, invalid or expired token. The body has only `message`.

```json
{
  "message": "Unauthorized"
}
```

### 500: Server error. Retry later.

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
