> ## Documentation Index
> Fetch the complete documentation index at: https://guides.affiliate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add products to an existing product list

> Append one or more product IDs to an existing list. Duplicate IDs are silently ignored and returned in ignored_product_ids so you can detect them.

Use `POST /v1/products/lists/{list_id}/items` to append products to an existing list. Pass an array of product IDs in the request body. The response tells you which IDs were successfully added and which were skipped because they were already in the list.

<Note>
  If you submit product IDs that already exist in the list, the API does not return an error. Instead, those IDs appear in `ignored_product_ids` in the response. Only new IDs are added and appear in `added_product_ids`.
</Note>

## Request

**Endpoint:** `POST /v1/products/lists/{list_id}/items`

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key as a Bearer token: `Bearer {your_api_key}`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

### Path parameters

<ParamField path="list_id" type="string" required>
  The unique identifier of the list to add products to.
</ParamField>

### Body parameters

<ParamField body="product_ids" type="string[]" required>
  An array of product ID strings to add to the list.

  ```json theme={null}
  {
    "product_ids": [
      "3456789012345678901",
      "4567890123456789012"
    ]
  }
  ```
</ParamField>

## Example request

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.affiliate.com/v1/products/lists/{list_id}/items' \
  --header 'Authorization: Bearer {your_api_key}' \
  --header 'Content-Type: application/json' \
  --data '{
    "product_ids": [
      "3456789012345678901",
      "4567890123456789012"
    ]
  }'
```

## Response

A `200 OK` response confirms which product IDs were added and which were ignored.

```json theme={null}
{
  "list_id": "d345e67f-89g0-1h2i-3j45-6k7891lm2345",
  "added_product_ids": [
    "3456789012345678901"
  ],
  "ignored_product_ids": [
    "4567890123456789012"
  ],
  "meta": {
    "trace_id": "d1e2f3g4-5h6i-7j8k-9l10-m1n2o3p4q5r6"
  }
}
```

### Response fields

<ResponseField name="list_id" type="string">
  The ID of the list that was modified.
</ResponseField>

<ResponseField name="added_product_ids" type="string[]">
  Product IDs that were successfully added to the list.
</ResponseField>

<ResponseField name="ignored_product_ids" type="string[]">
  Product IDs that were not added because they were already present in the list. No error is thrown for these IDs.
</ResponseField>

<ResponseField name="meta" type="object">
  <Expandable title="meta properties">
    <ResponseField name="meta.trace_id" type="string">
      Unique request identifier. Include this when contacting support.
    </ResponseField>
  </Expandable>
</ResponseField>
