# Bundle

## Get Bundles

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

Get list of bundle products.

#### Query Parameters

| Name          | Type   | Description                                             |
| ------------- | ------ | ------------------------------------------------------- |
| warehousecode | String | Warehouse Code                                          |
| keyword       | String | Keyword to search at least 3 characters                 |
| 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                              |
| bundleidlist                                | String | <p>Bundle ID List <br>Ex. 1234,5678</p> |

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

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

| Bundle (Array)    | Type    | Description/Example                                                                                       |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| id                | Int     | Bundle ID                                                                                                 |
| name              | String  | Bundle Name                                                                                               |
| sku               | String  | Bundle Sku                                                                                                |
| sellprice         | String  | Sell 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>4 - Use Product Vat</p> |
| stock             | String  | Stock                                                                                                     |
| availablestock    | String  | Available Stock                                                                                           |
| imagepath         | String  | Image Url                                                                                                 |
| active            | Boolean | Active status                                                                                             |
| {% endtab %}      |         |                                                                                                           |
| {% endtabs %}     |         |                                                                                                           |

## Get Bundle Detail

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

Get list of products in bundle.

#### Query Parameters

| Name                                 | Type   | Description    |
| ------------------------------------ | ------ | -------------- |
| id<mark style="color:red;">\*</mark> | Int    | Bundle 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                   | Bundle ID                                                                                                 |
| name              | String                | Bundle Name                                                                                               |
| sku               | String                | Bundle Sku                                                                                                |
| sellprice         | String                | Sell 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>4 - Use Product Vat</p> |
| stock             | String                | Stock                                                                                                     |
| availablestock    | String                | Available Stock                                                                                           |
| imagepath         | String                | Image Url                                                                                                 |
| active            | Boolean               | Active status                                                                                             |
| list              | ProductBundle (Array) | Product List                                                                                              |
| imageList         | String (Array)        | Image Url List                                                                                            |

| ProductBundle (Array) | Type   | Description/Example                                                                |
| --------------------- | ------ | ---------------------------------------------------------------------------------- |
| id                    | Int    | Product ID                                                                         |
| name                  | String | Product Name                                                                       |
| sku                   | String | Product Sku                                                                        |
| sell\_vat\_status     | Int    | <p>Sell vat status<br>0 - Undefined<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%</p> |
| quantity              | Double | Product Quantity                                                                   |
| {% endtab %}          |        |                                                                                    |
| {% endtabs %}         |        |                                                                                    |

## Add Bundle

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

Add bundle.

#### 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                | Bundle Name                                                                                                                                                  |
| sku<mark style="color:red;">\*</mark>        | String                | Bundle Sku                                                                                                                                                   |
| sellprice<mark style="color:red;">\*</mark>  | String                | Sell 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>4 - Use Product Vat<br>Remark: Only Merchant With Addon "Advance Vat".</p> |
| list<mark style="color:red;">\*</mark>       | ProductBundle (Array) | Product List                                                                                                                                                 |
| ∟ id                                         | Int                   | <p>Product ID</p><p>\*Must have either id or sku</p>                                                                                                         |
| ∟ sku                                        | String                | <p>Product Sku Require if id = 0 or null</p><p>\*Must have either id or sku</p>                                                                              |
| ∟ quantity<mark style="color:red;">\*</mark> | Double                | Product Quantity                                                                                                                                             |

{% 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  | Bundle ID           |
| {% endtab %} |      |                     |

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

```json
{
    "sku": "SET0001",
    "name": "Bundle 001",
    "sellprice": 100,
    "list":    
    [
        {
            "sku": "P0001",
            "quantity": 2
        },
        {
            "id": 1234,
            "quantity": 3
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Update Bundle

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

Update bundle.

**Query Parameters**

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Bundle 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 | Bundle Name                                                                                                                                                  |
| sellprice         | String | Sell 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>4 - Use Product Vat<br>Remark: Only Merchant With Addon "Advance Vat".</p> |

{% 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
{
    "name": "Bundle 001",
    "sellprice": 100
}
```

{% endtab %}
{% endtabs %}

## Active Bundle

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

Active Bundle

**Query Parameters**

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Bundle 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 Bundle

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

\<Description of the endpoint>

**Query Parameters**

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Bundle 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  |

| Name   | Type   | Description      |
| ------ | ------ | ---------------- |
| `name` | string | Name of the user |
| `age`  | number | Age of the user  |

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

| Parameter     | Type   | Description/Example                   |
| ------------- | ------ | ------------------------------------- |
| resCode       | String | <p>Response Code <br>200- Success</p> |
| resDesc       | String | Response Description                  |
| {% 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/bundle.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.
