# Product

## Get Products

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Product/GetProducts`

Get list of products.

#### Query Parameters

| Name          | Type   | Description                                             |
| ------------- | ------ | ------------------------------------------------------- |
| warehousecode | String | Warehouse Code                                          |
| createdafter  | String | Created Date After …..                                  |
| createdbefore | String | Created Date Before …..                                 |
| updatedafter  | String | Updated Date After …..                                  |
| updatedbefore | String | Updated Date Before …..                                 |
| keyword       | String | Keyword to search at least 3 characters                 |
| searchsku     | String | Keyword of SKU to search                                |
| variationid   | Int    | Variation ID                                            |
| categoryid    | Int    | Category ID                                             |
| activestatus  | Int    | <p>Active status (Default = All)<br>1 = Active only</p> |
| page          | Int    | Page (Default = 1)                                      |
| limit         | Int    | Limit per page (Max = 500)                              |

#### Headers

| Name                                        | Type   | Description                              |
| ------------------------------------------- | ------ | ---------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                               |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                  |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                               |
| skulist                                     | String | <p>Sku List <br>Ex. P0001,P0002</p>      |
| productidlist                               | String | <p>Product ID List <br>Ex. 1234,5678</p> |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type            | Description/Example                   |
| --------- | --------------- | ------------------------------------- |
| res       | String          | <p>Response Code <br>200- Success</p> |
| list      | Product (Array) | Product List (Array)                  |
| count     | Int             | Total product number by filter        |

| Product (Array)       | Type             | Description/Example                                                                |
| --------------------- | ---------------- | ---------------------------------------------------------------------------------- |
| id                    | Int              | Product ID                                                                         |
| name                  | String           | Product Name                                                                       |
| description           | String           | Description                                                                        |
| sku                   | String           | Product Sku                                                                        |
| sellprice             | String           | Sell price                                                                         |
| purchaseprice         | String           | Purchase price                                                                     |
| sell\_vat\_status     | Int              | <p>Sell vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%</p> |
| purchase\_vat\_status | Int              | <p>Purchase vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat</p>           |
| barcode               | String           | Barcode                                                                            |
| stock                 | String           | Stock                                                                              |
| availablestock        | String           | Available Stock                                                                    |
| unittext              | String           | Unit                                                                               |
| imagepath             | String           | Image Url                                                                          |
| weight                | String           | Weight (Gram)                                                                      |
| width                 | String           | Width (CM)                                                                         |
| length                | String           | Length (CM)                                                                        |
| height                | String           | Height (CM)                                                                        |
| categoryid            | Int              | Category ID                                                                        |
| category              | String           | Category Name                                                                      |
| producttype           | Int              | <p>Product Type<br>0 - Product (Default)<br>1 - Service</p>                        |
| variationid           | Int              | Variation ID                                                                       |
| variant               | Variant (Array)  | Variant List (Array)                                                               |
| tag                   | String (Array)   | Tag List (Array)                                                                   |
| active                | Boolean          | Active status                                                                      |
| imageList             | String (Array)   | Image Url List                                                                     |
| sharelink             | String           | Share Link Url                                                                     |
| properties            | Property (Array) | Custom Properties List                                                             |

| Variant (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| variantid       | Int    | Variant ID          |
| variantname     | String | Variant Name        |
| name            | String | Attribute Name      |

| Property (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Property ID         |
| name             | String | Property Name       |
| value            | String | Property Value      |
| {% endtab %}     |        |                     |
| {% endtabs %}    |        |                     |

## Get Product Detail

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Product/GetProductDetail`

Get product detail.

#### Query Parameters

| Name                                 | Type   | Description    |
| ------------------------------------ | ------ | -------------- |
| id<mark style="color:red;">\*</mark> | Int    | Product ID     |
| warehousecode                        | String | Warehouse Code |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

{% tabs %}
{% tab title="Response" %}

| Parameter             | Type             | Description/Example                                                                |
| --------------------- | ---------------- | ---------------------------------------------------------------------------------- |
| id                    | Int              | Product ID                                                                         |
| name                  | String           | Product Name                                                                       |
| description           | String           | Description                                                                        |
| sku                   | String           | Product Sku                                                                        |
| sellprice             | String           | Sell price                                                                         |
| purchaseprice         | String           | Purchase price                                                                     |
| sell\_vat\_status     | Int              | <p>Sell vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%</p> |
| purchase\_vat\_status | Int              | <p>Purchase vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat</p>           |
| barcode               | String           | Barcode                                                                            |
| stock                 | String           | Stock                                                                              |
| availablestock        | String           | Available Stock                                                                    |
| unittext              | String           | Unit                                                                               |
| imagepath             | String           | Image Url                                                                          |
| weight                | String           | Weight (Gram)                                                                      |
| width                 | String           | Width (CM)                                                                         |
| length                | String           | Length (CM)                                                                        |
| height                | String           | Height (CM)                                                                        |
| categoryid            | Int              | Category ID                                                                        |
| category              | String           | Category Name                                                                      |
| producttype           | Int              | <p>Product Type<br>0 - Product (Default)<br>1 - Service</p>                        |
| variationid           | Int              | Variation ID                                                                       |
| variant               | Variant (Array)  | Variant List (Array)                                                               |
| tag                   | String (Array)   | Tag List (Array)                                                                   |
| active                | Boolean          | Active status                                                                      |
| imageList             | String (Array)   | Image Url List                                                                     |
| sharelink             | String           | Share Link Url                                                                     |
| properties            | Property (Array) | Custom Properties List                                                             |

| Variant (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| variantid       | Int    | Variant ID          |
| variantname     | String | Variant Name        |
| name            | String | Attribute Name      |

| Property (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Property ID         |
| name             | String | Property Name       |
| value            | String | Property Value      |
| {% endtab %}     |        |                     |
| {% endtabs %}    |        |                     |

## Get Variations

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Product/GetVariations`

Get list of variation products.

#### Query Parameters

| Name  | Type | Description                |
| ----- | ---- | -------------------------- |
| page  | Int  | Page (Default = 1)         |
| limit | Int  | Limit per page (Max = 500) |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type              | Description/Example                   |
| --------- | ----------------- | ------------------------------------- |
| res       | Response          | <p>Response Code <br>200- Success</p> |
| list      | Variation (Array) | Variation List (Array)                |
| count     | Int               | Total variation number                |

| Variation (Array) | Type            | Description/Example  |
| ----------------- | --------------- | -------------------- |
| id                | Int             | Variation ID         |
| sku               | String          | Variation Sku        |
| name              | String          | Variation Name       |
| variants          | Variant (Array) | Variant List (Array) |

| Variant (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| variantid       | Int    | Variant ID          |
| variantname     | String | Variant Name        |
| {% endtab %}    |        |                     |
| {% endtabs %}   |        |                     |

## Get Categories

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Product/GetCategorys`

Get list of product categories.

#### Query Parameters

| Name  | Type | Description                |
| ----- | ---- | -------------------------- |
| page  | Int  | Page (Default = 1)         |
| limit | Int  | Limit per page (Max = 500) |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type             | Description/Example                   |
| --------- | ---------------- | ------------------------------------- |
| res       | Response         | <p>Response Code <br>200- Success</p> |
| list      | Category (Array) | Category List (Array)                 |
| count     | Int              | Total category number by filter       |

| Parameter     | Type   | Description/Example |
| ------------- | ------ | ------------------- |
| id            | Int    | Category ID         |
| name          | String | Category Name       |
|               |        |                     |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add Product

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/AddProduct`

Add product.

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                   | Type             | Description                                                                                                                           |
| -------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark> | String           | Product Name                                                                                                                          |
| description                            | String           | Description                                                                                                                           |
| sku<mark style="color:red;">\*</mark>  | String           | Product Sku                                                                                                                           |
| sellprice                              | String           | Sell price                                                                                                                            |
| purchaseprice                          | String           | Purchase price                                                                                                                        |
| sell\_vat\_status                      | Int              | <p>Sell vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%<br>Remark: Only Merchant With Addon "Advance Vat".</p> |
| purchase\_vat\_status                  | Int              | <p>Purchase vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>Remark: Only Merchant With Addon "Advance Vat".</p>           |
| barcode                                | String           | Barcode                                                                                                                               |
| stock                                  | String           | Stock                                                                                                                                 |
| unittext                               | String           | Unit                                                                                                                                  |
| weight                                 | String           | Weight (Gram)                                                                                                                         |
| width                                  | String           | Width (CM)                                                                                                                            |
| length                                 | String           | Length (CM)                                                                                                                           |
| height                                 | String           | Height (CM)                                                                                                                           |
| tag                                    | String(Array)    | Tag List (Array)                                                                                                                      |
| category                               | String           | Category Name                                                                                                                         |
| producttype                            | Int              | <p>Product Type<br>0 - Product (Default)<br>1 - Service</p>                                                                           |
| properties                             | Property (Array) | Custom Properties List                                                                                                                |
| ∟ name                                 | String           | <p>Property Name Require if id = 0 or null</p><p>\*Must have either id or name</p>                                                    |
| ∟ id                                   | Int              | <p>Property ID</p><p>\*Must have either id or name</p>                                                                                |
| ∟ value                                | String           | Property Value                                                                                                                        |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type   | Description/Example                   |
| --------- | ------ | ------------------------------------- |
| resCode   | String | <p>Response Code <br>200- Success</p> |
| resDesc   | String | Response Description                  |
| detail    | Detail | Detail                                |

| Detail       | Type | Description/Example |
| ------------ | ---- | ------------------- |
| id           | Int  | Product ID          |
| {% endtab %} |      |                     |

{% tab title="Ex. Request JSON" %}

```json

{
  "sku": "P0001",
  "name": "Product1",
  "sellprice": "20.00",
  "purchaseprice": "10.00",
  "unittext": "Piece",
  "weight": "500",
  "barcode": "1234",
  "category": "test category"
}
```

{% endtab %}
{% endtabs %}

## Update Product

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/UpdateProduct`

Edit product info.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                  | Type          | Description                                                                                                                           |
| --------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| name                  | String        | Product Name                                                                                                                          |
| description           | String        | Description                                                                                                                           |
| tag                   | String(Array) | Tag List (Array)                                                                                                                      |
| height                | String        | Height (CM)                                                                                                                           |
| length                | String        | Length (CM)                                                                                                                           |
| width                 | String        | Weight (CM)                                                                                                                           |
| weight                | String        | Weight (Gram)                                                                                                                         |
| unittext              | String        | Unit                                                                                                                                  |
| barcode               | String        | Barcode                                                                                                                               |
| sellprice             | String        | Sell price                                                                                                                            |
| purchaseprice         | String        | Purchase price                                                                                                                        |
| sell\_vat\_status     | Int           | <p>Sell vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%<br>Remark: Only Merchant With Addon "Advance Vat".</p> |
| purchase\_vat\_status | Int           | <p>Purchase vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>Remark: Only Merchant With Addon "Advance Vat".</p>           |
| category              | String        | Category Name                                                                                                                         |

{% tabs %}
{% tab title="Response" %}

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% endtab %}  |        |                                       |
| {% endtabs %} |        |                                       |

## Update Product Image

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/UpdateProductImage`

Edit product image.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                   | Type | Description      |
| -------------------------------------- | ---- | ---------------- |
| file<mark style="color:red;">\*</mark> | File | File Binary Data |

{% tabs %}
{% tab title="Response" %}

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% endtab %}  |        |                                       |
| {% endtabs %} |        |                                       |

## Update Product Stock List

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/UpdateProductStockList`

Adjust current inventory of product.

#### Query Parameters

| Name                                            | Type   | Description    |
| ----------------------------------------------- | ------ | -------------- |
| warehousecode<mark style="color:red;">\*</mark> | String | Warehouse Code |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                      | Type          | Description                                                                                   |
| ----------------------------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| stocks<mark style="color:red;">\*</mark>  | Stock (Array) | Stock List (Array)                                                                            |
| ∟ productid                               | Int           | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| ∟ stock<mark style="color:red;">\*</mark> | Double        | Stock                                                                                         |
| ∟ cost                                    | Double        | Cost Per Unit                                                                                 |
| ∟ sku                                     | String        | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type   | Description/Example                   |
| --------- | ------ | ------------------------------------- |
| resCode   | String | <p>Response Code <br>200- Success</p> |
| resDesc   | String | Response Description                  |
| detail    | Detail | Detail                                |

| Detail      | Type        | Description/Example   |
| ----------- | ----------- | --------------------- |
| stockupdate | StockUpdate | Stock Updating Result |

| StockUpdate   | Type          | Description/Example       |
| ------------- | ------------- | ------------------------- |
| success       | Int           | Total success number      |
| fail          | Int           | Total failure number      |
| notupdate     | Int           | Total not updating number |
| successlist   | Stock (Array) | Stock List (Array)        |
| faillist      | Stock (Array) | Stock List (Array)        |
| notupdatelist | Stock (Array) | Stock List (Array)        |

| Stock        | Type   | Description/Example |
| ------------ | ------ | ------------------- |
| productid    | Int    | Product ID          |
| sku          | String | Product Sku         |
| stock        | Double | Stock               |
| {% endtab %} |        |                     |

{% tab title="Ex. Request JSON" %}

```json
{
  "stocks": [
    {
      "sku": "P0001",
      "stock": 10,
      "cost": 100
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Increase Product Stock List

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/IncreaseProductStockList`

Increase inventory of product.

#### Query Parameters

| Name                                            | Type   | Description    |
| ----------------------------------------------- | ------ | -------------- |
| warehousecode<mark style="color:red;">\*</mark> | String | Warehouse Code |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                      | Type          | Description                                                                                   |
| ----------------------------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| stocks<mark style="color:red;">\*</mark>  | Stock (Array) | Stock List (Array)                                                                            |
| ∟ productid                               | Int           | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| ∟ sku                                     | String        | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |
| ∟ stock<mark style="color:red;">\*</mark> | Double        | Stock to increase                                                                             |
| ∟ cost                                    | Double        | Cost Per Unit                                                                                 |

{% tabs %}
{% tab title="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

<table><thead><tr><th width="150">Parameter</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>resCode</td><td>String</td><td>Response Code <br>200- Success</td></tr><tr><td>resDesc</td><td>String</td><td>Response Description</td></tr><tr><td>detail</td><td>Detail</td><td>Detail</td></tr></tbody></table>

| Detail      | Type        | Description/Example   |
| ----------- | ----------- | --------------------- |
| stockupdate | StockUpdate | Stock Updating Result |

| StockUpdate   | Type          | Description/Example       |
| ------------- | ------------- | ------------------------- |
| success       | Int           | Total success number      |
| fail          | Int           | Total failure number      |
| notupdate     | Int           | Total not updating number |
| successlist   | Stock (Array) | Stock List (Array)        |
| faillist      | Stock (Array) | Stock List (Array)        |
| notupdatelist | Stock (Array) | Stock List (Array)        |

| Stock        | Type   | Description/Example |
| ------------ | ------ | ------------------- |
| productid    | Int    | Product ID          |
| sku          | String | Product Sku         |
| stock        | Double | Stock               |
| {% endtab %} |        |                     |

{% tab title="Ex. Request JSON" %}

```json
{
  "stocks": [
    {
      "sku": "P0001",
      "stock": 10,
      "cost": 100
    }
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## Decrease Product Stock List

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/DecreaseProductStockList`

Decrease inventory of product.

#### Query Parameters

| Name                                            | Type   | Description    |
| ----------------------------------------------- | ------ | -------------- |
| warehousecode<mark style="color:red;">\*</mark> | String | Warehouse Code |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                      | Type          | Description                                                                                   |
| ----------------------------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| stocks<mark style="color:red;">\*</mark>  | Stock (Array) | Stock List (Array)                                                                            |
| ∟ productid                               | Int           | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| ∟ sku                                     | String        | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |
| ∟ stock<mark style="color:red;">\*</mark> | Double        | Stock to decrease                                                                             |
| ∟ cost                                    | Double        | Cost Per Unit                                                                                 |

{% tabs %}
{% tab title="Response" %}

<table><thead><tr><th width="159.16618017145717">Parameter</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>resCode</td><td>String</td><td>Response Code <br>200- Success</td></tr><tr><td>resDesc</td><td>String</td><td>Response Description</td></tr><tr><td>detail</td><td>Detail</td><td>Detail</td></tr></tbody></table>

<table><thead><tr><th width="196">Detail</th><th width="186.33333333333334">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>stockupdate</td><td>StockUpdate</td><td>Stock Updating Result</td></tr></tbody></table>

<table><thead><tr><th width="199.33333333333334">StockUpdate</th><th width="187">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>success</td><td>Int</td><td>Total success number</td></tr><tr><td>fail</td><td>Int</td><td>Total failure number</td></tr><tr><td>notupdate</td><td>Int</td><td>Total not updating number</td></tr><tr><td>successlist</td><td>Stock (Array)</td><td>Stock List (Array)</td></tr><tr><td>faillist</td><td>Stock (Array)</td><td>Stock List (Array)</td></tr><tr><td>notupdatelist</td><td>Stock (Array)</td><td>Stock List (Array)</td></tr></tbody></table>

<table><thead><tr><th width="195">Stock</th><th width="189.33333333333334">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>productid</td><td>Int</td><td>Product ID</td></tr><tr><td>sku</td><td>String</td><td>Product Sku</td></tr><tr><td>stock</td><td>Double</td><td>Stock</td></tr></tbody></table>
{% endtab %}

{% tab title="Ex. Request JSON" %}

```json
{
  "stocks": [
    {
      "sku": "P0001",
      "stock": 10,
      "cost": 100
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Update Product Available Stock List

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/UpdateProductAvailableStockList`

Adjust available/sellable inventory of product.

#### Query Parameters

| Name                                            | Type   | Description    |
| ----------------------------------------------- | ------ | -------------- |
| warehousecode<mark style="color:red;">\*</mark> | String | Warehouse Code |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                      | Type          | Description                                                                                   |
| ----------------------------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| stocks<mark style="color:red;">\*</mark>  | Stock (Array) | Stock List (Array)                                                                            |
| ∟ productid                               | Int           | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| ∟ stock<mark style="color:red;">\*</mark> | Double        | Available Stock                                                                               |
| ∟ cost                                    | Double        | Cost Per Unit                                                                                 |
| ∟ sku                                     | String        | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |

{% tabs %}
{% tab title="Response" %}

<table><thead><tr><th>Parameter</th><th width="177.33333333333334">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>resCode</td><td>String</td><td>Response Code <br>200- Success</td></tr><tr><td>resDesc</td><td>String</td><td>Response Description</td></tr><tr><td>detail</td><td>Detail</td><td>Detail</td></tr></tbody></table>

<table><thead><tr><th>Detail</th><th width="195.33333333333334">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>stockupdate</td><td>StockUpdate</td><td>Stock Updating Result</td></tr></tbody></table>

<table><thead><tr><th>StockUpdate</th><th width="195.33333333333334">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>success</td><td>Int</td><td>Total success number</td></tr><tr><td>fail</td><td>Int</td><td>Total failure number</td></tr><tr><td>notupdate</td><td>Int</td><td>Total not updating number</td></tr><tr><td>successlist</td><td>Stock (Array)</td><td>Stock List (Array)</td></tr><tr><td>faillist</td><td>Stock (Array)</td><td>Stock List (Array)</td></tr><tr><td>notupdatelist</td><td>Stock (Array)</td><td>Stock List (Array)</td></tr></tbody></table>

<table><thead><tr><th>Stock</th><th width="203.33333333333334">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>productid</td><td>Int</td><td>Product ID</td></tr><tr><td>sku</td><td>String</td><td>Product Sku</td></tr><tr><td>stock</td><td>Double</td><td>Stock</td></tr></tbody></table>
{% endtab %}

{% tab title="Ex. Request JSON" %}

```json
{
  "stocks": [
    {
      "sku": "P0001",
      "stock": 10,
      "cost": 100
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Active Product

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/ActiveProduct`

Active Product

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

**Headers**

| Name                                        | Type     | Description |
| ------------------------------------------- | -------- | ----------- |
| storename<mark style="color:red;">\*</mark> | `String` | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | `String` | API Key     |
| apisecret<mark style="color:red;">\*</mark> | `String` | API Secret  |

{% tabs %}
{% tab title="Response" %}

| Parameter     | Type     | Description/Example                   |
| ------------- | -------- | ------------------------------------- |
| resCode       | `String` | <p>Response Code <br>200- Success</p> |
| resDesc       | `String` | Response Description                  |
| {% endtab %}  |          |                                       |
| {% endtabs %} |          |                                       |

## Disable Product

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/DisableProduct`

Disable Product

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

**Headers**

| Name                                        | Type     | Description |
| ------------------------------------------- | -------- | ----------- |
| storename<mark style="color:red;">\*</mark> | `String` | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | `String` | API Key     |
| apisecret<mark style="color:red;">\*</mark> | `String` | API Secret  |

{% tabs %}
{% tab title="Response" %}

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% endtab %}  |        |                                       |
| {% endtabs %} |        |                                       |

## Delete Product

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/DeleteProduct`

Delete product.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

{% tabs %}
{% tab title="Response" %}

<table><thead><tr><th width="150">Parameter</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>resCode</td><td>String</td><td>Response Code <br>200- Success</td></tr><tr><td>resDesc</td><td>String</td><td>Response Description</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Add Serial No

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/AddSerialNo`

Add serial no of product.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name            | Type             | Description    |
| --------------- | ---------------- | -------------- |
| serialsNo       | Property (Array) | Serial no List |
| ∟ name          | String           | Serial no Name |
| ∟ warehouseCode | String           | Warehouse Code |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type                 | Description/Example                   |
| --------- | -------------------- | ------------------------------------- |
| resCode   | String               | <p>Response Code <br>200- Success</p> |
| resDesc   | String               | Response Description                  |
| data      | SerialNoDataResponse | Response Data                         |

| SerialNoDataResponse | Type                           | Description/Example |
| -------------------- | ------------------------------ | ------------------- |
| serialsNoSuccess     | SerialNoCreateResponse (Array) | Success List        |
| serialsNoFailed      | SerialNoCreateResponse (Array) | Failed List         |

| SerialNoCreateResponse | Type   | Description/Example  |
| ---------------------- | ------ | -------------------- |
| id                     | String | Serial no ID         |
| name                   | String | Serial no Name       |
| warehouseCode          | String | Warehouse Code       |
| description            | String | Response description |
| {% endtab %}           |        |                      |

{% tab title="Ex. Request JSON" %}

```json
{
  "serialsNo": [
    {
      "name": "SE0001",
      "warehouseCode": "W0001"
    },
    {
      "name": "SE0002",
      "warehouseCode": "W0001"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Delete Serial No

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Product/DeleteSerialNo`

Delete serial no of product.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Product ID  |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name      | Type           | Description            |
| --------- | -------------- | ---------------------- |
| serialsNo | String (Array) | List of Serial no Name |

{% tabs %}
{% tab title="Response" %}

| Parameter    | Type   | Description/Example                   |
| ------------ | ------ | ------------------------------------- |
| resCode      | String | <p>Response Code <br>200- Success</p> |
| resDesc      | String | Response Description                  |
| {% endtab %} |        |                                       |

{% tab title="Ex. Request JSON" %}

```json
{
  "serialsNo": [
    "SE0001",
    "SE0002"
  ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.zortout.com/api-reference/product.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
