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

# Product

> This API handles operations related to importing, retrieving, and deleting products in bulk or individually.

## Base URL

`https://api.videowise.com`

***

### Bulk Product Import

#### **POST** `/external/product/v1/bulk`

Imports or modifies list of products into the system.

#### Headers

| Key                        | Type   | Required | Description                            |
| -------------------------- | ------ | -------- | -------------------------------------- |
| `X-Videowise-Access-Token` | String | Yes      | Access token to authorize the request. |

#### Request Body

* **siteId** (string, deprecated): The site ID to associate with the products.
* **siteType** (string, deprecated): The type of site to associate with the products.
* **products** (array of **Product Object**, required): List of products to be imported.

**Product Object**:

| Field            | Type      | Required | Description                           |
| ---------------- | --------- | -------- | ------------------------------------- |
| `id`             | String    | Yes      | The unique identifier of the product. |
| `sku`            | String    | Yes      | The SKU of the product.               |
| `title`          | String    | Yes      | The name of the product.              |
| `description`    | String    | No       | The description of the product.       |
| `price`          | Number    | No       | The price of the product.             |
| `price_min`      | Number    | No       | The minimum price of the product.     |
| `price_max`      | Number    | No       | The maximum price of the product.     |
| `available`      | Boolean   | Yes      | Whether the product is available.     |
| `images`         | \[String] | No       | List of image URLs for the product.   |
| `featured_image` | String    | Yes      | The image URL of the product.         |
| `url`            | String    | Yes      | The URL of the product.               |

#### Example Request

```json theme={null}
{
  "siteId": "YourSiteID",
  "siteType": "Salesforce",
  "products": [
    {
      "id": "008884303989",
      "sku": "008884303989",
      "title": "Platinum Blue Stripes Easy Care Fitted Shirt",
      "description": "An elegant fitted shirt with blue stripes.",
      "price": 35,
      "price_min": 35,
      "price_max": 35,
      "available": true,
      "images": ["https://example.com/image1.jpg"],
      "featured_image": "https://example.com/image1.jpg",
      "url": "https://example.com/product1"
    },
    {
      "id": "008884303990",
      "sku": "008884303990",
      "title": "Test Shirt",
      "description": "A test product.",
      "price": 60,
      "available": true,
      "featured_image": "https://example.com/image2.jpg",
      "url": "https://example.com/product2"
    }
  ]
}
```

#### Response

| Status | Description                     |
| ------ | ------------------------------- |
| `200`  | Products imported successfully. |
| `400`  | Bad request or site not found.  |
| `401`  | Unauthorized access.            |

***

### Bulk Product Import CSV

#### **POST** `/external/product/v1/bulk/csv`

Imports or modifies list of products into the system.

#### Headers

| Key                        | Type   | Required | Description                            |
| -------------------------- | ------ | -------- | -------------------------------------- |
| `X-Videowise-Access-Token` | String | Yes      | Access token to authorize the request. |

#### Request Body

* **siteId** (string, deprecated): The site ID to associate with the products.
* **siteType** (string, deprecated): The type of site to associate with the products.
* **csvContent** (string, required): CSV Content.

**CSV Content**:

The CSV content should be formatted as follows:

* **First row**: Headers containing the field names (id, sku, title, description, price, price\_min, price\_max, available, images, featured\_image, url)
* **Following rows**: Product data corresponding to each **Product Object** field

**CSV Format**:

```
id,sku,title,description,price,price_min,price_max,available,images,featured_image,url
008884303989,008884303989,Platinum Blue Stripes Easy Care Fitted Shirt,An elegant fitted shirt with blue stripes,35,35,35,true,https://example.com/image1.jpg,https://example.com/image1.jpg,https://example.com/product1
008884303990,008884303990,Test Shirt,A test product.,60,60,60,true,["https://example.com/image1.jpg","https://example.com/image2.jpg"],https://example.com/image1.jpg,https://example.com/product2
```

**Field Requirements**: Same as the **Product Object** defined in the [Bulk Product Import](#bulk-product-import) section.

**Notes**:

* For single images use string format
* For multiple images, use JSON array format: `[\"url1\",\"url2\"]`
* Boolean values should be `true` or `false`
* Ensure proper CSV escaping for fields containing commas or quotes

#### Example Request

```json theme={null}
{
  "siteId": "YourSiteID",
  "siteType": "Salesforce",
  "csvContent": "id,sku,title,description,price,price_min,price_max,available,images,featured_image,url\n008884303989,008884303989,Platinum Blue Stripes Easy Care Fitted Shirt,An elegant fitted shirt with blue stripes,35,35,35,true,https://example.com/image1.jpg,https://example.com/image1.jpg,https://example.com/product1\n008884303990,008884303990,Test Shirt,A test product.,60,60,60,true,[\"https://example.com/image1.jpg\",\"https://example.com/image2.jpg\"],https://example.com/image1.jpg,https://example.com/product2"
}
```

#### Response

| Status | Description                     |
| ------ | ------------------------------- |
| `200`  | Products imported successfully. |
| `400`  | Bad request or site not found.  |
| `401`  | Unauthorized access.            |

***

### Single Product Import

#### **POST** `/external/product/v1`

Imports or modifies single product into the system.

#### Headers

| Key                        | Type   | Required | Description                            |
| -------------------------- | ------ | -------- | -------------------------------------- |
| `X-Videowise-Access-Token` | String | Yes      | Access token to authorize the request. |

#### Request Body

* **siteId** (string, deprecated): The site ID to associate with the product.
* **siteType** (string, deprecated): The type of site to associate with the product.
* **product** (**Product Object**, required): The product to be imported.

**Product Object**: Same as defined in the [Bulk Product Import](#bulk-product-import) section.

#### Example Request

```json theme={null}
{
  "siteId": "YourSiteID",
  "siteType": "Magento",
  "product": {
    "id": "008884303989",
    "sku": "008884303989",
    "title": "Platinum Blue Stripes Easy Care Fitted Shirt",
    "description": "An elegant fitted shirt with blue stripes.",
    "price": 35,
    "price_min": 35,
    "price_max": 35,
    "available": true,
    "images": ["https://example.com/image1.jpg"],
    "featured_image": "https://example.com/image1.jpg",
    "url": "https://example.com/product1"
  }
}
```

#### Response

| Status | Description                    |
| ------ | ------------------------------ |
| `200`  | Product imported successfully. |
| `400`  | Bad request or site not found. |
| `401`  | Unauthorized access.           |

***

### Retrieve Product

#### **GET** `/external/product/v1/:productId`

Retrieves a product by its reference ID or SKU.

#### Headers

| Key                        | Type   | Required | Description                            |
| -------------------------- | ------ | -------- | -------------------------------------- |
| `X-Videowise-Access-Token` | String | Yes      | Access token to authorize the request. |

#### Query Parameters

| Parameter  | Type   | Required   | Description                  |
| ---------- | ------ | ---------- | ---------------------------- |
| `siteId`   | String | Deprecated | The site ID to search for.   |
| `siteType` | String | Deprecated | The site type to search for. |

#### Example Request

```bash theme={null}
GET /external/product/v1/008884303989?siteId=YourSiteID&siteType=Salesforce
```

#### Response

| Field            | Type   | Description                           |
| ---------------- | ------ | ------------------------------------- |
| `id`             | String | The unique identifier of the product. |
| `sku`            | String | The SKU of the product.               |
| `title`          | String | The name of the product.              |
| `featured_image` | String | The image URL of the product.         |
| `url`            | String | The URL of the product.               |

```json theme={null}
{
  "id": "008884303989",
  "sku": "008884303989",
  "title": "Platinum Blue Stripes Easy Care Fitted Shirt",
  "featured_image": "https://example.com/image1.jpg",
  "url": "https://example.com/product1"
}
```

| Status | Description                       |
| ------ | --------------------------------- |
| `200`  | Product retrieved successfully.   |
| `400`  | Bad request or product not found. |
| `401`  | Unauthorized access.              |

***

### Delete Product

#### **DELETE** `/external/product/v1/:productId`

Deletes a product by its reference ID or SKU.

#### Headers

| Key                        | Type   | Required | Description                            |
| -------------------------- | ------ | -------- | -------------------------------------- |
| `X-Videowise-Access-Token` | String | Yes      | Access token to authorize the request. |

#### Query Parameters

| Parameter  | Type   | Required   | Description                  |
| ---------- | ------ | ---------- | ---------------------------- |
| `siteId`   | String | Deprecated | The site ID to search for.   |
| `siteType` | String | Deprecated | The site type to search for. |

#### Example Request

```bash theme={null}
DELETE /external/product/v1/008884303989?siteId=YourSiteID&siteType=Salesforce
```

#### Response

| Field     | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| `message` | String | Confirmation of product deletion. |

```json theme={null}
{
  "message": "Product deleted successfully."
}
```

| Status | Description                                  |
| ------ | -------------------------------------------- |
| `200`  | Product deleted successfully.                |
| `400`  | Bad request or product could not be deleted. |
| `401`  | Unauthorized access.                         |

***

## Error Codes

| Status | Description                                                                   |
| ------ | ----------------------------------------------------------------------------- |
| `400`  | Bad request. This occurs when required parameters or body fields are missing. |
| `401`  | Unauthorized. Access token is missing or invalid.                             |
| `404`  | Resource not found. Site or product does not exist.                           |

***
