# Introduction

ZORT API is protocol to allow your service (3rd party service) connect to ZORT platform to synchronize ZORT data. Ex. Products, Purchase orders and Orders

### Postman Collection

Link : [Download here](https://drive.google.com/file/d/1CrWa95ky9SLyEv8Z_lbO3FzuVTkTrB9y/view?usp=sharing) (Version 4.0)

### API Endpoint URL

{% hint style="info" %}
<https://open-api.zortout.com/v4>
{% endhint %}

### Common Request Parameters

#### Header

<table><thead><tr><th width="255.64116950102402">Parameter</th><th width="150">Required</th></tr></thead><tbody><tr><td>storename</td><td>Yes</td></tr><tr><td>apikey</td><td>Yes</td></tr><tr><td>apisecret</td><td>Yes</td></tr><tr><td>X-Request-ID</td><td>No</td></tr></tbody></table>

{% hint style="info" %}
`X-Request-ID` is a unique identifier that is attached to each API request and response. It is primarily used for **tracking, debugging, and logging** API calls across distributed systems. This ID helps developers and system administrators correlate logs between different services, trace request flow, and debug issues effectively.
{% endhint %}


# Data Definition

### Common Response

<table><thead><tr><th width="172.2468059198294">Response Code (resCode)</th><th width="150">Status</th><th width="150">Description</th></tr></thead><tbody><tr><td>200</td><td>Success</td><td>Success</td></tr><tr><td>201</td><td>Success</td><td>Success with already ready to ship. (For API "READYTOSHIP" Only).</td></tr><tr><td>100</td><td>Error</td><td>General Error</td></tr><tr><td>500</td><td>Error</td><td>Server Error</td></tr><tr><td>600</td><td>Error</td><td>Error with 3rd Party. (For API "READYTOSHIP" Only</td></tr><tr><td>700</td><td>Error</td><td>Error with inventory is not enough.</td></tr><tr><td>900</td><td>Error</td><td>Error with duplicate number.</td></tr></tbody></table>


# Webhook

ZORT have webhook to callback when some events are triggered. The system will send request by "POST" method to your endpoint URL that set in the system.

### Common Request Parameters

{% hint style="info" %}
Your Endpoint URL
{% endhint %}

Every request will be sent with Header to endpoint URL.

#### Header

| Parameter     | Description     |
| ------------- | --------------- |
| Authorization | Basic {key1}    |
| key1          | Key Reference 1 |
| key2          | Key Reference 2 |
| key3          | Key Reference 3 |

{% hint style="danger" %}
A trigger with by API request will be not sent to webhook that use the same API Key.
{% endhint %}

### How To Set Webhook

* Set manually in ZORT portal.

1. Login to ZORT.
2. Go to menu Setting --> Integration --> API Reference --> Webhook.
3. Input key and endpoint URL and click "Verify and Save".

* Set by calling API.

You can send request to update webhook information.

## UPDATEWEBHOOK

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

Update webhook information.

#### 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                                                                                                                                                      |
| -------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key1<mark style="color:red;">\*</mark> | String | Key Reference 1                                                                                                                                                  |
| key2<mark style="color:red;">\*</mark> | String | Key Reference 2                                                                                                                                                  |
| key3<mark style="color:red;">\*</mark> | String | Key Reference 3                                                                                                                                                  |
| addproducturl                          | String | <p>Endpoint URL when product is created.<br>If this value is null or blank, this trigger will be not active.</p>                                                 |
| updateproducturl                       | String | <p>Endpoint URL when product is modified.<br>If this value is null or blank, this trigger will be not active.</p>                                                |
| deleteproducturl                       | String | <p>Endpoint URL when product is deleted.<br>If this value is null or blank, this trigger will be not active.</p>                                                 |
| updatequantityurl                      | String | <p>Endpoint URL when product quantity is changed.<br>If this value is null or blank, this trigger will be not active.</p>                                        |
| addorderurl                            | String | <p>Endpoint URL when order is created.<br>If this value is null or blank, this trigger will be not active.</p>                                                   |
| updateorderurl                         | String | <p>Endpoint URL when order is modified or an order status is changed.<br>If this value is null or blank, this trigger will be not active.</p>                    |
| updateordertrackingurl                 | String | <p>Endpoint URL when tracking no in order is changed.<br>If this value is null or blank, this trigger will be not active.</p>                                    |
| updateorderpaymenturl                  | String | <p>Endpoint URL when payments in order is changed.<br>If this value is null or blank, this trigger will be not active.</p>                                       |
| addpurchaseurl                         | String | <p>Endpoint URL when purchase is created.<br>If this value is null or blank, this trigger will be not active.</p>                                                |
| updatepurchaseurl                      | String | <p>Endpoint URL when purchase is modified or a purchase status is changed.<br>If this value is null or blank, this trigger will be not active.</p>               |
| updatepurchasepaymenturl               | String | <p>Endpoint URL when payments in purchase is changed.<br>If this value is null or blank, this trigger will be not active.</p>                                    |
| addreturnorderurl                      | String | <p>Endpoint URL when return order is created.<br>If this value is null or blank, this trigger will be not active.</p>                                            |
| updatereturnorderurl                   | String | <p>Endpoint URL when return order is modified or a return order status is changed.<br>If this value is null or blank, this trigger will be not active.</p>       |
| updatereturnorderpaymenturl            | String | <p>Endpoint URL when payments in return order is changed.<br>If this value is null or blank, this trigger will be not active.</p>                                |
| addreturnpurchaseurl                   | String | <p>Endpoint URL when return purchase is created.<br>If this value is null or blank, this trigger will be not active.</p>                                         |
| updatereturnpurchaseurl                | String | <p>Endpoint URL when return purchase is modified or a return purchase status is changed.<br>If this value is null or blank, this trigger will be not active.</p> |
| updatereturnpurchasepaymenturl         | String | <p>Endpoint URL when payments in return purchase is changed.<br>If this value is null or blank, this trigger will be not active.</p>                             |
| addtransferurl                         | String | <p>Endpoint URL when transfer is created.<br>If this value is null or blank, this trigger will be not active.</p>                                                |
| updatetransferurl                      | String | <p>Endpoint URL when transfer is modified or a transfer status is changed.<br>If this value is null or blank, this trigger will be not active.</p>               |
| deletewarehouseurl                     | String | <p>Endpoint URL when warehouse is deleted.<br>If this value is null or blank, this trigger will be not active.</p>                                               |
| updatewarehouseurl                     | String | <p>Endpoint URL when warehouse is modified.<br>If this value is null or blank, this trigger will be not active.</p>                                              |
| addwarehouseurl                        | String | <p>Endpoint URL when warehouse is created.<br>If this value is null or blank, this trigger will be not active.</p>                                               |
| deletecontacturl                       | String | <p>Endpoint URL when contact is deleted.<br>If this value is null or blank, this trigger will be not active.</p>                                                 |
| updatecontacturl                       | String | <p>Endpoint URL when contact is modified.<br>If this value is null or blank, this trigger will be not active.</p>                                                |
| addcontacturl                          | String | <p>Endpoint URL when contact is created.<br>If this value is null or blank, this trigger will be not active.</p>                                                 |

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

<table><thead><tr><th width="155.00000000000003">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 %}

* You can get current webhook information by calling "**GETWEBHOOK**" method.

## GETWEBHOOK

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

Get webhook information.

#### 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="320">Parameter</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>key1</td><td>String</td><td>Key Reference 1</td></tr><tr><td>key2</td><td>String</td><td>Key Reference 2</td></tr><tr><td>key3</td><td>String</td><td>Key Reference 3</td></tr><tr><td>addproducturl</td><td>String</td><td>Endpoint URL when product is created.</td></tr><tr><td>updateproducturl</td><td>String</td><td>Endpoint URL when product is modified.</td></tr><tr><td>deleteproducturl</td><td>String</td><td>Endpoint URL when product is deleted.</td></tr><tr><td>updatequantityurl</td><td>String</td><td>Endpoint URL when product quantity is changed.</td></tr><tr><td>addorderurl</td><td>String</td><td>Endpoint URL when order is create</td></tr><tr><td>updateorderurl</td><td>String</td><td>Endpoint URL when order is modified or an order status is changed.</td></tr><tr><td>updateordertrackingurl</td><td>String</td><td>Endpoint URL when tracking no in order is changed.</td></tr><tr><td>updateorderpaymenturl</td><td>String</td><td>Endpoint URL when payments in order is changed.</td></tr><tr><td>addpurchaseurl</td><td>String</td><td>Endpoint URL when purchase is created</td></tr><tr><td>updatepurchaseurl</td><td>String</td><td>Endpoint URL when purchase is modified or a purchase status is changed.</td></tr><tr><td>updatepurchasepaymenturl</td><td>String</td><td>Endpoint URL when payments in purchase is changed.</td></tr><tr><td>addreturnorderurl</td><td>String</td><td>Endpoint URL when return order is created.</td></tr><tr><td>updatereturnorderurl</td><td>String</td><td>Endpoint URL when return order is modified or a return order status is changed.</td></tr><tr><td>updatereturnorderpaymenturl</td><td>String</td><td>Endpoint URL when payments in return order is changed.</td></tr><tr><td>addreturnpurchaseurl</td><td>String</td><td>Endpoint URL when return purchase is created.</td></tr><tr><td>updatereturnpurchaseurl</td><td>String</td><td>Endpoint URL when return purchase is modified or a return purchase status is changed.</td></tr><tr><td>updatereturnpurchasepaymenturl</td><td>String</td><td>Endpoint URL when payments in return purchase is changed.</td></tr><tr><td>addtransferurl</td><td>String</td><td>Endpoint URL when transfer is created.</td></tr><tr><td>updatetransferurl</td><td>String</td><td>Endpoint URL when transfer is modified or a transfer status is changed.</td></tr><tr><td>addcontacturl</td><td>String</td><td>Endpoint URL when contact is created.</td></tr><tr><td>updatecontacturl</td><td>String</td><td>Endpoint URL when contact is modified.</td></tr><tr><td>deletecontacturl</td><td>String</td><td>Endpoint URL when contact is deleted.<br>If this value is null or blank, this trigger will be not active.</td></tr><tr><td>addwarehouseurl</td><td>String</td><td>Endpoint URL when warehouse is created.</td></tr><tr><td>updatewarehouseurl</td><td>String</td><td>Endpoint URL when warehouse is modified.</td></tr><tr><td>deletewarehouseurl</td><td>String</td><td>Endpoint URL when warehouse is deleted.<br>If this value is null or blank, this trigger will be not active.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Trigger

{% hint style="success" %}

#### **Product Trigger**

{% endhint %}

## ADDPRODUCT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a product is created.

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| method<mark style="color:red;">\*</mark> | String | ADDPRODUCT  |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}

## UPDATEPRODUCT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a product is modified.

#### Query Parameters

| Name                                     | Type   | Description   |
| ---------------------------------------- | ------ | ------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATEPRODUCT |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}

## UPDATEPRODUCTQUANTITY

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a product quantity is changed.

#### Query Parameters

| Name                                     | Type   | Description           |
| ---------------------------------------- | ------ | --------------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATEPRODUCTQUANTITY |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "sku": "P0001",
  "name": "Product1",
  "stock": "20.00",
  "availablestock": "10.00"
}
```

{% endtab %}
{% endtabs %}

## DELETEPRODUCT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a product is deleted.

#### Query Parameters

| Name                                     | Type   | Description   |
| ---------------------------------------- | ------ | ------------- |
| method<mark style="color:red;">\*</mark> | String | DELETEPRODUCT |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "sku": "P0001"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}

#### Order Trigger

{% endhint %}

## ADDORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when an order is created.

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| method<mark style="color:red;">\*</mark> | String | ADDORDER    |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "SO-0001",
  "orderdate": "/Date(1644944400000)/",
  "orderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "customerbranchname": null,
  "customerbranchno": null,
  "shippingdate": null,
  "shippingchannel": null,
  "shippingamount": null,
  "shippingvat": null,
  "shippingname": null,
  "shippingaddress": null,
  "shippingphone": null,
  "shippingemail": null,
  "trackingno": null,
  "saleschannel": null,
  "description": null,
  "reference": null,
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "isCOD": false
}
```

{% endtab %}
{% endtabs %}

## UPDATEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when an order is modified or an order status is changed.

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| method<mark style="color:red;">\*</mark> | String | UPDATEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "SO-0001",
  "orderdate": "/Date(1644944400000)/",
  "orderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "customerbranchname": null,
  "customerbranchno": null,
  "shippingdate": null,
  "shippingchannel": null,
  "shippingamount": null,
  "shippingvat": null,
  "shippingname": null,
  "shippingaddress": null,
  "shippingphone": null,
  "shippingemail": null,
  "trackingno": null,
  "saleschannel": null,
  "description": null,
  "reference": null,
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "isCOD": false
}
```

{% endtab %}
{% endtabs %}

## UPDATEORDERPAYMENT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when payments in order is changed.

#### Query Parameters

| Name                                            | Type   | Description                                                     |
| ----------------------------------------------- | ------ | --------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | UPDATEORDERPAYMENT                                              |
| id<mark style="color:red;">\*</mark>            | Int    | Order ID                                                        |
| number<mark style="color:red;">\*</mark>        | String | Order Number                                                    |
| paymentstatus<mark style="color:red;">\*</mark> | String | Payment Status (Pending, Paid, Partial Payment, Excess Payment) |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "SO-0001",
  "orderdate": "/Date(1644944400000)/",
  "orderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "customerbranchname": null,
  "customerbranchno": null,
  "shippingdate": null,
  "shippingchannel": null,
  "shippingamount": null,
  "shippingvat": null,
  "shippingname": null,
  "shippingaddress": null,
  "shippingphone": null,
  "shippingemail": null,
  "trackingno": null,
  "saleschannel": null,
  "description": null,
  "reference": null,
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "isCOD": false
}
```

{% endtab %}
{% endtabs %}

## UPDATEORDERTRACKING

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a tracking no in order is changed.

#### Query Parameters

| Name                                     | Type   | Description         |
| ---------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATEORDERTRACKING |
| id<mark style="color:red;">\*</mark>     | Int    | Order ID            |
| number<mark style="color:red;">\*</mark> | String | Order Number        |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
[
  {
    "trackingno": "THP0001",
    "trackingurl": "",
    "shippingdate": null
  }
]
```

{% endtab %}
{% endtabs %}

## DELETEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when an order is deleted.

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| method<mark style="color:red;">\*</mark> | String | DELETEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "SO-0001"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Purchase Order Trigger**
{% endhint %}

## ADDPURCHASEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a purchase is created.

#### Query Parameters

| Name                                     | Type   | Description      |
| ---------------------------------------- | ------ | ---------------- |
| method<mark style="color:red;">\*</mark> | String | ADDPURCHASEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "PO-0001",
  "purchaseorderdate": "/Date(1644944400000)/",
  "purchaseorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": null,
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success"
}
```

{% endtab %}
{% endtabs %}

## UPDATEPURCHASEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a purchase is modified or a purchase status is changed.

#### Query Parameters

| Name                                     | Type   | Description         |
| ---------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATEPURCHASEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "PO-0001",
  "purchaseorderdate": "/Date(1644944400000)/",
  "purchaseorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": null,
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success"
}
```

{% endtab %}
{% endtabs %}

## UPDATEPURCHASEORDERPAYMENT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when payments in purchase is changed.

#### Query Parameters

| Name                                            | Type   | Description                                                     |
| ----------------------------------------------- | ------ | --------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | UPDATEPURCHASEORDERPAYMENT                                      |
| id<mark style="color:red;">\*</mark>            | Int    | PurchaseOrder ID                                                |
| number<mark style="color:red;">\*</mark>        | String | PurchaseOrder Number                                            |
| paymentstatus<mark style="color:red;">\*</mark> | String | Payment Status (Pending, Paid, Partial Payment, Excess Payment) |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "PO-0001",
  "purchaseorderdate": "/Date(1644944400000)/",
  "purchaseorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": null,
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success"
}
```

{% endtab %}
{% endtabs %}

## DELETEPURCHASEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when an purchase is deleted.

#### Query Parameters

| Name                                     | Type   | Description         |
| ---------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark> | String | DELETEPURCHASEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "PO-0001"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Return Order Trigger**
{% endhint %}

## ADDRETURNORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a return order is created.

#### Query Parameters

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| method<mark style="color:red;">\*</mark> | String | ADDRETURNORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "CN-0001",
  "returnorderdate": "/Date(1644944400000)/",
  "returnorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": "SO-0001",
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "referenceid": 2345
}
```

{% endtab %}
{% endtabs %}

## UPDATERETURNORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a return order is modified or a return order status is changed.

#### Query Parameters

| Name                                     | Type   | Description       |
| ---------------------------------------- | ------ | ----------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATERETURNORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "CN-0001",
  "returnorderdate": "/Date(1644944400000)/",
  "returnorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": "SO-0001",
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "referenceid": 2345
}
```

{% endtab %}
{% endtabs %}

## UPDATERETURNORDERPAYMENT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when payments in return order is changed.

#### Query Parameters

| Name                                            | Type   | Description                                                     |
| ----------------------------------------------- | ------ | --------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | UPDATERETURNORDERPAYMENT                                        |
| id<mark style="color:red;">\*</mark>            | Int    | ReturnOrder ID                                                  |
| number<mark style="color:red;">\*</mark>        | String | ReturnOrder Number                                              |
| paymentstatus<mark style="color:red;">\*</mark> | String | Payment Status (Pending, Paid, Partial Payment, Excess Payment) |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "CN-0001",
  "returnorderdate": "/Date(1644944400000)/",
  "returnorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Customer Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": "SO-0001",
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "referenceid": 2345
}
```

{% endtab %}
{% endtabs %}

## DELETERETURNORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when an return order is deleted.

#### Query Parameters

| Name                                     | Type   | Description       |
| ---------------------------------------- | ------ | ----------------- |
| method<mark style="color:red;">\*</mark> | String | DELETERETURNORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "CN-0001"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Return Purchase Order Trigger**
{% endhint %}

## ADDRETURNPURCHASEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a return purchase is created.

#### Query Parameters

| Name                                     | Type   | Description            |
| ---------------------------------------- | ------ | ---------------------- |
| method<mark style="color:red;">\*</mark> | String | ADDRETURNPURCHASEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "DN-0001",
  "returnpurchaseorderdate": "/Date(1644944400000)/",
  "returnpurchaseorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Contact Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": "PO-0001",
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "referenceid": 2345
}
```

{% endtab %}
{% endtabs %}

## UPDATERETURNPURCHASEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a return purchase is modified or a return purchase status is changed.

#### Query Parameters

| Name                                     | Type   | Description               |
| ---------------------------------------- | ------ | ------------------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATERETURNPURCHASEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "DN-0001",
  "returnpurchaseorderdate": "/Date(1644944400000)/",
  "returnpurchaseorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Contact Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": "PO-0001",
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "referenceid": 2345
}
```

{% endtab %}
{% endtabs %}

## UPDATERETURNPURCHASEORDERPAYMENT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when payments in return purchase is changed.

#### Query Parameters

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | UPDATERETURNPURCHASEORDERPAYMENT |
| id<mark style="color:red;">\*</mark>            | Int    | ReturnPurchaseOrder ID           |
| number<mark style="color:red;">\*</mark>        | String | ReturnPurchaseOrder Number       |
| paymentstatus<mark style="color:red;">\*</mark> | String |                                  |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "DN-0001",
  "returnpurchaseorderdate": "/Date(1644944400000)/",
  "returnpurchaseorderdateString": "2022-02-16",
  "customerid": 123,
  "customername": "Contact Name",
  "customeridnumber": null,
  "customerphone": null,
  "customeremail": null,
  "customeraddress": null,
  "description": null,
  "reference": "PO-0001",
  "vattype": 1,
  "list": [
    {
      "productid": 2345,
      "sku": "P0001",
      "name": "Product 1",
      "number": 1,
      "pricepernumber": 100,
      "discount": null,
      "totalprice": 100
    },
    {
      "productid": 4567,
      "sku": "P0002",
      "name": "Product 2",
      "number": 1,
      "pricepernumber": 50,
      "discount": null,
      "totalprice": 50
    }
  ],
  "discount": null,
  "vatamount": null,
  "amount": 150,
  "paymentamount": 150,
  "paymentstatus": "Paid",
  "status": "Success",
  "referenceid": 2345
}
```

{% endtab %}
{% endtabs %}

## DELETERETURNPURCHASEORDER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when an return purchase is deleted.

#### Query Parameters

| Name                                     | Type   | Description               |
| ---------------------------------------- | ------ | ------------------------- |
| method<mark style="color:red;">\*</mark> | String | DELETERETURNPURCHASEORDER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "DO-0001"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Transfer Trigger**
{% endhint %}

## ADDTRANSFER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a transfer is created.

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| method<mark style="color:red;">\*</mark> | String | ADDTRANSFER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "TF-0001",
  "status": "Success",
  "transferdate": "2021-01- 25",
  "fromwarehousecode": "W0001",
  "towarehousecode": "W0002",
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": "5"
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": "3"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## UPDATETRANSFER

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a transfer is modified or a transfer status is changed.

#### Query Parameters

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATETRANSFER |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "number": "TF-0001",
  "status": "Success",
  "transferdate": "2021-01- 25",
  "fromwarehousecode": "W0001",
  "towarehousecode": "W0002",
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": "5"
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": "3"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Contact Trigger**
{% endhint %}

## ADDCONTACT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a contact is created.

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| method<mark style="color:red;">\*</mark> | String | ADDCONTACT  |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": "1234,
  "code": "C0001",
  "name": "Contact1",
  "idnumber": "123456789",
  "email": "testemail@zortout.com",
  "phone": "021234567"
}
```

{% endtab %}
{% endtabs %}

## UPDATECONTACT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a contact is modified.

#### Query Parameters

| Name                                     | Type   | Description   |
| ---------------------------------------- | ------ | ------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATECONTACT |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": "1234,
  "code": "C0001",
  "name": "Contact1",
  "idnumber": "123456789",
  "email": "testemail@zortout.com",
  "phone": "021234567"
}
```

{% endtab %}
{% endtabs %}

## DELETECONTACT

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

#### Query Parameters

| Name                                     | Type   | Description   |
| ---------------------------------------- | ------ | ------------- |
| method<mark style="color:red;">\*</mark> | String | DELETECONTACT |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": "1234,
  "code": "C0001
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Warehouse Trigger**
{% endhint %}

## ADDWAREHOUSE

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a warehouse is created.

#### Query Parameters

| Name                                     | Type   | Description  |
| ---------------------------------------- | ------ | ------------ |
| method<mark style="color:red;">\*</mark> | String | ADDWAREHOUSE |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "code": "W0001",
  "name": "Warehouse1"
}
```

{% endtab %}
{% endtabs %}

## UPDATEWAREHOUSE

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a warehouse is modified.

#### Query Parameters

| Name                                     | Type   | Description     |
| ---------------------------------------- | ------ | --------------- |
| method<mark style="color:red;">\*</mark> | String | UPDATEWAREHOUSE |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "code": "W0001",
  "name": "Warehouse1"
}
```

{% endtab %}
{% endtabs %}

## DELETEWAREHOUSE

<mark style="color:green;">`POST`</mark> `{Your Endpoint URL}`

Send request when a warehouse is deleted.

#### Query Parameters

| Name                                     | Type   | Description     |
| ---------------------------------------- | ------ | --------------- |
| method<mark style="color:red;">\*</mark> | String | DELETEWAREHOUSE |

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| payload<mark style="color:red;">\*</mark> | String | <p>Payload (JSON format)</p><p>See detail in Ex. Payload JSON.</p> |

{% tabs %}
{% tab title="Ex. Payload JSON" %}

```json
{
  "id": 1234,
  "code": "W0001"
}
```

{% endtab %}
{% endtabs %}


# 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 %}


# 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 %} |        |                                       |


# Warehouse

## Get Warehouses

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

Get list of warehouses/branches.

#### 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      | Warehouse (Array) | Warehouse List(Array)                 |
| count     | Int               | Total warehouse number by filter      |

| Warehouse (Array) | Type   | Description/Example |
| ----------------- | ------ | ------------------- |
| id                | Int    | Warehouse ID        |
| name              | String | Warehouse Name      |
| code              | String | Warehouse Code      |
| address           | String | Warehouse Addressr  |
| {% endtab %}      |        |                     |
| {% endtabs %}     |        |                     |

## Add Warehouse

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

Add warehouse/branch.

#### 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       |
| -------------------------------------- | ------ | ----------------- |
| code<mark style="color:red;">\*</mark> | String | Warehouse Code    |
| name<mark style="color:red;">\*</mark> | String | Warehouse Name    |
| address                                | String | Warehouse Address |

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

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

```json
{
  "code": "W0001",
  "name": "Warehouse1"
}
```

{% endtab %}
{% endtabs %}


# Contact

## Get Contacts

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

Get list of contacts.

#### Query Parameters

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

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

<table><thead><tr><th width="183.0455190308588">Parameter</th><th width="157.5770517201441">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>res</td><td>Response</td><td>Response Code <br>200- Success</td></tr><tr><td>list</td><td>Contact (Array)</td><td>Contact List (Array)</td></tr><tr><td>count</td><td>Int</td><td>Total contact number by filter</td></tr></tbody></table>

<table><thead><tr><th width="162.102472199407">Contact (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Contact ID</td></tr><tr><td>name</td><td>String</td><td>Contact Name</td></tr><tr><td>code</td><td>String</td><td>Contact Code</td></tr><tr><td>idnumber</td><td>String</td><td>Contact ID Number/Tax ID</td></tr><tr><td>phone</td><td>String</td><td>Contact Phone</td></tr><tr><td>email</td><td>String</td><td>Contact Email</td></tr><tr><td>address</td><td>String</td><td>Contact Address</td></tr><tr><td>branchname</td><td>String</td><td>Branch Name</td></tr><tr><td>branchno</td><td>String</td><td>Branch No</td></tr><tr><td>facebook</td><td>String</td><td>Facebook</td></tr><tr><td>line</td><td>String</td><td>LINE</td></tr><tr><td>instagram</td><td>String</td><td>Instagram</td></tr><tr><td>imagepath</td><td>String</td><td>Image Url</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr></tbody></table>

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

## Get Contact Detail

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

Get contact detail

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Contact 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>Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Contact ID</td></tr><tr><td>name</td><td>String</td><td>Contact Name</td></tr><tr><td>code</td><td>String</td><td>Contact Code</td></tr><tr><td>idnumber</td><td>String</td><td>Contact ID Number/Tax ID</td></tr><tr><td>phone</td><td>String</td><td>Contact Phone</td></tr><tr><td>email</td><td>String</td><td>Contact Email</td></tr><tr><td>address</td><td>String</td><td>Contact Address</td></tr><tr><td>branchname</td><td>String</td><td>Branch Name</td></tr><tr><td>branchno</td><td>String</td><td>Branch No</td></tr><tr><td>facebook</td><td>String</td><td>Facebook</td></tr><tr><td>line</td><td>String</td><td>LINE</td></tr><tr><td>instagram</td><td>String</td><td>Instagram</td></tr><tr><td>imagepath</td><td>String</td><td>Image Url</td></tr><tr><td>subContactList</td><td>SubContact (Array)</td><td>Subcontact List (Array)</td></tr><tr><td>shippingList</td><td>ShippingAddress (Array)</td><td>Shipping Address List (Array)</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr></tbody></table>

<table><thead><tr><th width="202.16370106761565">SubContact (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>name</td><td>String</td><td>Subcontact Name</td></tr><tr><td>position</td><td>String</td><td>Subcontact Position</td></tr><tr><td>phone</td><td>String</td><td>Subcontact Phone</td></tr><tr><td>mobile</td><td>String</td><td>Subcontact Mobile</td></tr><tr><td>email</td><td>String</td><td>Subcontact Email</td></tr><tr><td>isMain</td><td>Boolean</td><td>Main Status</td></tr></tbody></table>

<table><thead><tr><th>ShippingAddress (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>name</td><td>String</td><td>Shipping Name</td></tr><tr><td>address</td><td>String</td><td>Shipping Address</td></tr><tr><td>phone</td><td>String</td><td>Shipping Phone</td></tr><tr><td>email</td><td>String</td><td>Shipping Email</td></tr><tr><td>isMain</td><td>Boolean</td><td>Main Status</td></tr></tbody></table>

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

## Add Contact

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

Add contact.

#### 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                                                                        |
| -------------------------------------- | ---------------- | ---------------------------------------------------------------------------------- |
| code<mark style="color:red;">\*</mark> | String           | Contact Code                                                                       |
| name<mark style="color:red;">\*</mark> | String           | Contact Name                                                                       |
| idnumber                               | String           | Contact ID Number/Tax ID                                                           |
| phone                                  | String           | Contact Phone                                                                      |
| email                                  | String           | Contact Email                                                                      |
| address                                | String           | Contact Address                                                                    |
| branchname                             | String           | Branch Name                                                                        |
| branchno                               | String           | Branch No                                                                          |
| facebook                               | String           | Facebook                                                                           |
| line                                   | String           | Line                                                                               |
| instagram                              | String           | Instagram                                                                          |
| ∟ value                                | String           | Property Value                                                                     |
| ∟ 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>                             |
| properties                             | Property (Array) | Custom Properties List                                                             |

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

<table><thead><tr><th width="245.48063250061637">Parameter</th><th width="153.33333333333331">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>resCode</td><td>String</td><td>Response Code <br>200- Succes</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 |
| ------------ | ---- | ------------------- |
| id           | Int  | Contact ID          |
| {% endtab %} |      |                     |

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

```json
{
  "code": "C0001",
  "name": "Contact1",
  "idnumber": "123456789",
  "email": "testemail@zortout.com",
  "phone": "021234567"
}
```

{% endtab %}
{% endtabs %}

## Update Contact

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

Edit contact info

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Contact 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              |
| -------------------------------------- | ------ | ------------------------ |
| idnumber                               | String | Contact ID Number/Tax ID |
| code<mark style="color:red;">\*</mark> | String | Contact Code             |
| facebook                               | String | Facebook                 |
| name                                   | String | Contact Name             |
| branchname                             | String | Branch Name              |
| line                                   | String | Line                     |
| address                                | String | Contact Address          |
| phone                                  | String | Contact Phone            |
| email                                  | String | Contact Email            |
| instagram                              | String | Instagram                |
| branchno                               | String | Branch No                |

{% 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
{
  "code": "C0001",
  "name": "Contact1",
  "idnumber": "123456789",
  "email": "testemail@zortout.com",
  "phone": "021234567"
}
```

{% endtab %}
{% endtabs %}


# Order

## Get Orders

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

Get list of orders.

#### Query Parameters

| Name                                                            | Type   | Description                                                                                                                                                    |
| --------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| orderdateafter                                                  | String | <p>Order Date After .....<br>(yyyy-MM-dd)</p>                                                                                                                  |
| orderdatebefore                                                 | String | <p>Order Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                                 |
| toamount                                                        | Double | Maximum amount                                                                                                                                                 |
| fromamount                                                      | Double | Minimum amount                                                                                                                                                 |
| updatedatetimeafter                                             | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>                                                                                                      |
| updatedatetimebefore                                            | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>                                                                                                     |
| createdatetimeafter                                             | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>                                                                                                      |
| createdatetimebefore                                            | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>                                                                                                     |
| paymentafter                                                    | String | <p>Paid Date After .....<br>(yyyy-MM-dd)</p>                                                                                                                   |
| paymentbefore                                                   | String | <p>Paid Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                                  |
| updatedafter                                                    | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>                                                                                                                |
| updatedbefore                                                   | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                               |
| createdafter                                                    | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>                                                                                                                |
| createdbefore                                                   | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                               |
| serialno                                                        | Int    | <p>Show serial no status<br>0 - No (Default)<br>1 - Yes</p>                                                                                                    |
| paymentstatus                                                   | String | <p>Payment status<br>0 - Pending<br>1 - Paid<br>2 - Voided<br>3 - Partial Payment<br>4 - Excess Payment<br>Ex. "0,1,3,4"</p>                                   |
| status                                                          | String | <p>Status<br>0 - Pending<br>1 - Success<br>2 - Voided<br>3 - Waiting<br>4 - Returned<br>5 - Packed<br>6 - Shipping<br>7 - Failed Shipment<br>Ex. "0,1,3,4"</p> |
| createusername                                                  | String | Created by (Username)                                                                                                                                          |
| warehousecode                                                   | String | Warehouse Code                                                                                                                                                 |
| warehouseCodeList                                               | String | <p>Warehouse Code List<br>Ex. "W0001,W0002"</p>                                                                                                                |
| topaymentamount                                                 | Double | Maximum payment amount                                                                                                                                         |
| frompaymentamount                                               | Double | Minimum payment amount                                                                                                                                         |
| keyword                                                         | String | Keyword to search                                                                                                                                              |
| saleschannel                                                    | String | Sales channel                                                                                                                                                  |
| expirylot                                                       | Int    | <p>Show expiry lot status<br>0 - No (Default)<br>1 - Yes</p>                                                                                                   |
| sortdirection                                                   | String | <p>Sorting Type By id<br>DESC - Descending (Default)<br>ASC - Ascending</p>                                                                                    |
| options                                                         | String | <p>Optional features to include in the response. Use comma-separated values.<br>Available options:                                                             |
| <br>- returnorders : Return orders<br>- vouchers : Vouchers</p> |        |                                                                                                                                                                |
| limit                                                           | Int    | Limit per page (Max = 500)                                                                                                                                     |
| page                                                            | Int    | Page (Default = 1)                                                                                                                                             |

#### 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                                                 |
| orderidlist                                 | String | <p>List Of Order ID <br>Ex. “123,124,125”</p>              |
| numberlist                                  | String | <p>List Of Order Number <br>Ex. “SO-001,SO-002,SO-003”</p> |

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

| Parameter          | Type          | Description/Example                   |
| ------------------ | ------------- | ------------------------------------- |
| res                | Response      | <p>Response Code <br>200- Success</p> |
| list               | Order (Array) | Order List (Array)                    |
| count              | Int           | Total order number by filter          |
| totalAmount        | Double        | Total amountby filter                 |
| totalPaymentAmount | Double        | Total payment amountby filter         |

<table><thead><tr><th width="150">Order (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Order ID</td></tr><tr><td>number</td><td>String</td><td>Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Customer ID</td></tr><tr><td>customercode</td><td>String</td><td>Customer Code</td></tr><tr><td>customername</td><td>String</td><td>Customer Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Customer ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Customer Email</td></tr><tr><td>customerphone</td><td>String</td><td>Customer Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Customer Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Customer Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Customer Branch No</td></tr><tr><td>status</td><td>String</td><td>Status (Pending, Waiting, Returned, Packed, Shipping, Success, Partial Transfer, Voided, Failed Shipment)</td></tr><tr><td>paymentstatus</td><td>String</td><td>Payment Status (Pending, Paid, Partial Payment, Excess Payment)</td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td></td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingchannel</td><td>String</td><td>Shipping Channel</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status<br>0 - No Shipping Vat <br>1 - Have Shipping Vat</td></tr><tr><td>shippingdate</td><td>Date</td><td>Shipping Date</td></tr><tr><td>shippingdateString</td><td>String</td><td>Shipping Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>shippingname</td><td>String</td><td>Shipping Name</td></tr><tr><td>shippingaddress</td><td>String</td><td>Shipping Address</td></tr><tr><td>shippingphone</td><td>String</td><td>Shipping Phone</td></tr><tr><td>shippingemail</td><td>String</td><td>Shipping Email</td></tr><tr><td>trackingno</td><td>String</td><td>Tracking No</td></tr><tr><td>trackingList</td><td>TrackingNo (Array)</td><td>Tracking No List</td></tr><tr><td>orderdate</td><td>Date</td><td>Order Date</td></tr><tr><td>orderdateString</td><td>String</td><td>Order Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Buyer Discount.<br>Discount includes sellerdiscount and platformdiscount.<br>Ex.5.00, 10%</td></tr><tr><td>sellerdiscount</td><td>Double</td><td>Seller Discount</td></tr><tr><td>sellerdiscount_pretax</td><td>Double</td><td>Pretax Seller Discount</td></tr><tr><td>sellerdiscount_vat</td><td>Double</td><td>Seller Discount Vat</td></tr><tr><td>platformdiscount</td><td>Double</td><td>Platform Discount.<br>This discount is subsidized from Marketplace for buyer. (Ex. Lazada, Shopee, Tiktok)</td></tr><tr><td>platformdiscount_pretax</td><td>Double</td><td>Pretax Platform Discount</td></tr><tr><td>platformdiscount_vat</td><td>Double</td><td>Platform Discount Vat</td></tr><tr><td>voucheramount</td><td>Double</td><td>Subsidized Amount from Marketplace for seller.</td></tr><tr><td>voucheramount_pretax</td><td>Double</td><td>Subsidized Pretax amount from Marketplace for seller.</td></tr><tr><td>voucheramount_vat</td><td>Double</td><td>Subsidized Vat amount from Marketplace for seller.</td></tr><tr><td>shippingVoucher</td><td>Double</td><td>Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_pretax</td><td>Double</td><td>Pretax Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_vat</td><td>Double</td><td>Shipping Voucher Vat</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of order discount. (Include discount and voucheramount).<br>discountamount = discount - voucheramount<br>discountamount = sellerdiscount + platformdiscount - voucheramount</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude VAT<br>3 – Include VAT</td></tr><tr><td>saleschannel</td><td>String</td><td>Sales Channel</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>OrderProduct (Array)</td><td>Product List</td></tr><tr><td>totalproductamount</td><td>Double</td><td>Total Product Price of Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>expiredate</td><td>Date</td><td>Expired Date</td></tr><tr><td>expiredateString</td><td>String</td><td>Expired Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>successDate</td><td>Date</td><td>The date that order was completed.</td></tr><tr><td>successDateString</td><td>String</td><td>The date text that order was completed.<br>(yyyy-MM-dd)</td></tr><tr><td>receivedate</td><td>Date</td><td>The date that buyer receive order from Marketplace. (Only customized merchant)</td></tr><tr><td>receivedateString</td><td>String</td><td>The date text that buyer receive order from Marketplace. (Only customized merchant)<br>(yyyy-MM-dd)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>isCOD</td><td>Boolean</td><td>COD Status</td></tr><tr><td>integrationName</td><td>String</td><td>Integration Channel Name (Only Order from Integrated Channel.)</td></tr><tr><td>integrationShop</td><td>String</td><td>Integration Shop Name (Only Order from Integrated Channel.)</td></tr><tr><td>integrationCustomerId</td><td>String</td><td>Integration Customer ID (Only Order from Integrated Channel - Shopee and Tiktok only)</td></tr><tr><td>integrationCustomer</td><td>String</td><td>Integration Customer User (Only Order from Integrated Channel - Shopee and Tiktok only)</td></tr><tr><td>agent</td><td>Agent</td><td>Agent Detail</td></tr><tr><td>uniquenumber</td><td>String</td><td>Unique Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr><tr><td>returnOrders</td><td>ReturnOrderReference (Array)</td><td>Return Order Reference List<br>(when options contain "returnOrders")</td></tr><tr><td>vouchers</td><td>Voucher (Array)</td><td>Voucher List<br>(when options contain "vouchers")</td></tr></tbody></table>

<table><thead><tr><th width="151">OrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr><tr><td>producttype</td><td>Int</td><td>Product Type<br>0 - Product (Default)<br>1 - Service</td></tr><tr><td>bundleid</td><td>Int (Nullable)</td><td>Bundle ID</td></tr><tr><td>bundleitemid</td><td>Int (Nullable)</td><td>ID of bundle group in product line.</td></tr><tr><td>bundlenumber</td><td>Double (Nullable)</td><td>Bundle Quantity</td></tr><tr><td>bundleCode</td><td>String</td><td>Bundle Code/Sku</td></tr><tr><td>bundleName</td><td>String</td><td>Bundle Name</td></tr><tr><td>integrationItemId</td><td>String</td><td>Item Id of Integration.</td></tr><tr><td>integrationVariantId</td><td>String</td><td>Variant Id of Integration.</td></tr><tr><td>vat_status</td><td>Int</td><td>Sell vat status<br>0 - Follow Vat Type in Order<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%</td></tr><tr><td>serialnolist</td><td>SerialNo (Array)</td><td>Serial no List</td></tr><tr><td>expirylotlist</td><td>ExpiryLot (Array)</td><td>Expiry lot List</td></tr></tbody></table>

<table><thead><tr><th width="160.43423319931074">Payment (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Payment ID</td></tr><tr><td>name</td><td>String</td><td>Payment Method Name</td></tr><tr><td>amount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>paymentdatetime</td><td>Datetime</td><td>Payment Datetime</td></tr><tr><td>paymentdatetimeString</td><td>String</td><td>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr></tbody></table>

| SerialNo (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Serial no ID        |
| name             | String | Serial no Name      |

| ExpiryLot (Array) | Type   | Description/Example |
| ----------------- | ------ | ------------------- |
| id                | Int    | Expiry lot ID       |
| name              | String | Expiry lot Name     |
| number            | Double | Expiry lot Quantity |
| expiryDate        | Date   | Expired Date        |

| Agent   | Type   | Description/Example |
| ------- | ------ | ------------------- |
| id      | Int    | Agent ID            |
| name    | String | Agent Name          |
| phone   | String | Agent Phone         |
| email   | String | Agent Email         |
| address | String | Agent Address       |

| TrackingNo (Array) | Type   | Description/Example                 |
| ------------------ | ------ | ----------------------------------- |
| id                 | Int    | Tracking No ID                      |
| trackingno         | String | Tracking No                         |
| trackingurl        | String | Tracking No Url                     |
| shippingdate       | Date   | Shipping Date                       |
| shippingchannel    | String | Shipping Channel                    |
| status             | String | Tracking No Status (Normal, Voided) |

| Property (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Property ID         |
| name             | String | Property Name       |
| value            | String | Property Value      |

| ReturnOrderReference (Array) | Type   | Description/Example |
| ---------------------------- | ------ | ------------------- |
| id                           | Int    | Return Order ID     |
| number                       | String | Return Order Number |

| Voucher (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| id              | Int    | Voucher ID          |
| name            | String | Voucher Name        |
| amount          | Double | Voucher Amount      |
| {% endtab %}    |        |                     |
| {% endtabs %}   |        |                     |

## Get Order Detail

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

Get order detail.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Order 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>id</td><td>Int</td><td>Order ID</td></tr><tr><td>number</td><td>String</td><td>Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Customer ID</td></tr><tr><td>customercode</td><td>String</td><td>Customer Code</td></tr><tr><td>customername</td><td>String</td><td>Customer Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Customer ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Customer Email</td></tr><tr><td>customerphone</td><td>String</td><td>Customer Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Customer Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Customer Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Customer Branch No</td></tr><tr><td>status</td><td>String</td><td>Status (Pending, Waiting, Returned, Packed, Shipping, Success, Partial Transfer, Voided, Failed Shipment)</td></tr><tr><td>paymentstatus</td><td>String</td><td>Payment Status (Pending, Paid, Partial Payment, Excess Payment)</td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td></td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingchannel</td><td>String</td><td>Shipping Channel</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status <br>0 - No Shipping Vat <br>1 - Have Shipping Vat</td></tr><tr><td>shippingdate</td><td>Date</td><td>Shipping Date</td></tr><tr><td>shippingdateString</td><td>String</td><td>Shipping Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>shippingname</td><td>String</td><td>Shipping Name</td></tr><tr><td>shippingaddress</td><td>String</td><td>Shipping Address</td></tr><tr><td>shippingphone</td><td>String</td><td>Shipping Phone</td></tr><tr><td>shippingemail</td><td>String</td><td>Shipping Email</td></tr><tr><td>trackingno</td><td>String</td><td>Tracking No</td></tr><tr><td>trackingList</td><td>TrackingNo (Array)</td><td>Tracking No List</td></tr><tr><td>orderdate</td><td>Date</td><td>Order Date</td></tr><tr><td>orderdateString</td><td>String</td><td>Order Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Buyer Discount.<br>Discount includes sellerdiscount and platformdiscount.<br>Ex.5.00, 10%</td></tr><tr><td>sellerdiscount</td><td>Double</td><td>Seller Discount</td></tr><tr><td>sellerdiscount_pretax</td><td>Double</td><td>Pretax Seller Discount</td></tr><tr><td>sellerdiscount_vat</td><td>Double</td><td>Seller Discount Vat</td></tr><tr><td>platformdiscount</td><td>Double</td><td>Platform Discount.<br>This discount is subsidized from Marketplace for buyer. (Ex. Lazada, Shopee, Tiktok)</td></tr><tr><td>platformdiscount_pretax</td><td>Double</td><td>Pretax Platform Discount</td></tr><tr><td>platformdiscount_vat</td><td>Double</td><td>Platform Discount Vat</td></tr><tr><td>voucheramount</td><td>Double</td><td>Subsidized Amount from Marketplace for seller.</td></tr><tr><td>voucheramount_pretax</td><td>Double</td><td>Subsidized Pretax amount from Marketplace for seller.</td></tr><tr><td>voucheramount_vat</td><td>Double</td><td>Subsidized Vat amount from Marketplace for seller.</td></tr><tr><td>shippingVoucher</td><td>Double</td><td>Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_pretax</td><td>Double</td><td>Pretax Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_vat</td><td>Double</td><td>Shipping Voucher Vat</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of order discount. (Include discount and voucheramount).<br>discountamount = discount - voucheramount<br>discountamount = sellerdiscount + platformdiscount - voucheramount</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</td></tr><tr><td>saleschannel</td><td>String</td><td>Sales Channel</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>OrderProduct (Array)</td><td>Product List</td></tr><tr><td>totalproductamount</td><td>Double</td><td>Total Product Price of Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>expiredate</td><td>Date</td><td>Expired Date</td></tr><tr><td>expiredateString</td><td>String</td><td>Expired Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>successDate</td><td>Date</td><td>The date that order was completed.</td></tr><tr><td>successDateString</td><td>String</td><td>The date text that order was completed.<br>(yyyy-MM-dd)</td></tr><tr><td>receivedate</td><td>Date</td><td>The date that buyer receive order from Marketplace. (Only customized merchant)</td></tr><tr><td>receivedateString</td><td>String</td><td>The date text that buyer receive order from Marketplace. (Only customized merchant)<br>(yyyy-MM-dd)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>isCOD</td><td>Boolean</td><td>COD Status</td></tr><tr><td>integrationName</td><td>String</td><td>Integration Channel Name (Only Order from Integrated Channel.)</td></tr><tr><td>integrationShop</td><td>String</td><td>Integration Shop Name (Only Order from Integrated Channel.)</td></tr><tr><td>integrationCustomerId</td><td>String</td><td>Integration Customer ID (Only Order from Integrated Channel - Shopee and Tiktok only)</td></tr><tr><td>integrationCustomer</td><td>String</td><td>Integration Custome User (Only Order from Integrated Channel - Shopee and Tiktok only)</td></tr><tr><td>agent</td><td>Agent</td><td>Agent Detail</td></tr><tr><td>uniquenumber</td><td>String</td><td>Unique Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr><tr><td>returnOrders</td><td>ReturnOrderReference (Array)</td><td>Return Order Reference List</td></tr><tr><td>vouchers</td><td>Voucher (Array)</td><td>Voucher List</td></tr></tbody></table>

<table><thead><tr><th width="163">OrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr><tr><td>producttype</td><td>Int</td><td>Product Type<br>0 - Product (Default)<br>1 - Service</td></tr><tr><td>bundleid</td><td>Int (Nullable)</td><td>Bundle ID</td></tr><tr><td>bundleitemid</td><td>Int (Nullable)</td><td>ID of bundle group in product line.</td></tr><tr><td>bundlenumber</td><td>Double (Nullable)</td><td>Bundle Quantity</td></tr><tr><td>bundleCode</td><td>String</td><td>Bundle Code/Sku</td></tr><tr><td>bundleName</td><td>String</td><td>Bundle Name</td></tr><tr><td>integrationItemId</td><td>String</td><td>Item Id of Integration.</td></tr><tr><td>integrationVariantId</td><td>String</td><td>Variant Id of Integration.</td></tr><tr><td>vat_status</td><td>Int</td><td>Sell vat status<br>0 - Follow Vat Type in Order<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%</td></tr><tr><td>serialnolist</td><td>SerialNo (Array)</td><td>Serial no List</td></tr><tr><td>expirylotlist</td><td>ExpiryLot (Array)</td><td>Expiry lot List</td></tr></tbody></table>

<table><thead><tr><th width="175.35455543358947">Payment (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Payment ID</td></tr><tr><td>name</td><td>String</td><td>Payment Method Name</td></tr><tr><td>amount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>paymentdatetime</td><td>Datetime</td><td>Payment Datetime</td></tr><tr><td>paymentdatetimeString</td><td>String</td><td>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr></tbody></table>

<table><thead><tr><th width="150">SerialNo (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Serial no ID</td></tr><tr><td>name</td><td>String</td><td>Serial no Name</td></tr></tbody></table>

<table><thead><tr><th width="155.33333333333331">ExpiryLot (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Expiry lot ID</td></tr><tr><td>name</td><td>String</td><td>Expiry lot Name</td></tr><tr><td>number</td><td>Double</td><td>Expiry lot Quantity</td></tr><tr><td>expiryDate</td><td>Date</td><td>Expired Date</td></tr></tbody></table>

<table><thead><tr><th width="191">Agent</th><th>Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Agent ID</td></tr><tr><td>name</td><td>String</td><td>Agent Name</td></tr><tr><td>phone</td><td>String</td><td>Agent Phone</td></tr><tr><td>email</td><td>String</td><td>Agent Email</td></tr><tr><td>address</td><td>String</td><td>Agent Address</td></tr></tbody></table>

| TrackingNo (Array) | Type   | Description/Example                 |
| ------------------ | ------ | ----------------------------------- |
| id                 | Int    | Tracking No ID                      |
| trackingno         | String | Tracking No                         |
| trackingurl        | String | Tracking No Url                     |
| shippingdate       | Date   | Shipping Date                       |
| shippingchannel    | String | Shipping Channel                    |
| status             | String | Tracking No Status (Normal, Voided) |

| Property (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Property ID         |
| name             | String | Property Name       |
| value            | String | Property Value      |

| ReturnOrderReference (Array) | Type   | Description/Example |
| ---------------------------- | ------ | ------------------- |
| id                           | Int    | Return Order ID     |
| number                       | String | Return Order Number |

| Voucher (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| id              | Int    | Voucher ID          |
| name            | String | Voucher Name        |
| amount          | Double | Voucher Amount      |
| {% endtab %}    |        |                     |
| {% endtabs %}   |        |                     |

## Get Voucher Detail

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

Get list of voucher subsidized by Marketplace.

#### Query Parameters

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

| Voucher (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| id              | Int    | ID                  |
| name            | String | Voucher Name        |
| amount          | Double | Amount              |
| {% endtab %}    |        |                     |
| {% endtabs %}   |        |                     |

## Get Expense Order Detail

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

Get list of expenses of order.

#### Query Parameters

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

| Expense (Array)       | Type     | Description/Example                                      |
| --------------------- | -------- | -------------------------------------------------------- |
| id                    | Int      | ID                                                       |
| name                  | String   | Expense Name                                             |
| amount                | Double   | Amount                                                   |
| paymentname           | String   | Payment Method Name                                      |
| paymentdatetime       | Datetime | Payment Datetime                                         |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p>      |
| isvat                 | Int      | <p>Vat Status</p><p>0 - No Vat</p><p>1 - Include Vat</p> |
| {% endtab %}          |          |                                                          |
| {% endtabs %}         |          |                                                          |

## Get Movement Order Detail

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

Get movement list of products according to each order.

#### Query Parameters

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

| MovementOrder (Array) | Type                 | Description/Example                              |
| --------------------- | -------------------- | ------------------------------------------------ |
| id                    | Int                  | ID                                               |
| list                  | OrderProduct (Array) | Movement List                                    |
| actionDate            | Date (Array)         | List of action date                              |
| actionDateString      | String (Array)       | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| orderid               | Int                  | Order ID                                         |

| OrderProduct (Array) | Type   | Description/Example    |
| -------------------- | ------ | ---------------------- |
| productid            | Int    | Product ID             |
| sku                  | String | Product Sku            |
| name                 | String | Product Name           |
| number               | Double | Product Quantity       |
| unittext             | String | Unit                   |
| pricepernumber       | Double | Product Price/Quantity |
| discount             | String | Discount Per Unit      |
| totalprice           | Double | Total Price            |
| {% endtab %}         |        |                        |
| {% endtabs %}        |        |                        |

## Get Movement Orders

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

Get movement list of products for orders.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| limit                                        | Int    | Limit per page (Max = 500)               |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |

#### 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      | MovementOrder (Array) | Movement Order List (Array)           |
| count     | Int                   | Total movement order number by filter |

| MovementOrder (Array) | Type                 | Description/Example                              |
| --------------------- | -------------------- | ------------------------------------------------ |
| id                    | Int                  | ID                                               |
| list                  | OrderProduct (Array) | Movement List                                    |
| actionDate            | Date (Array)         | List of action date                              |
| actionDateString      | String (Array)       | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| orderid               | Int                  | Order ID                                         |

| OrderProduct (Array) | Type   | Description/Example    |
| -------------------- | ------ | ---------------------- |
| productid            | Int    | Product ID             |
| sku                  | String | Product Sku            |
| name                 | String | Product Name           |
| number               | Double | Product Quantity       |
| unittext             | String | Unit                   |
| pricepernumber       | Double | Product Price/Quantity |
| discount             | String | Discount Per Unit      |
| totalprice           | Double | Total Price            |
| {% endtab %}         |        |                        |
| {% endtabs %}        |        |                        |

## Get Shipment Labels

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

Get shipment label list of orders.

#### 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                                                 |
| orderidlist                                 | String | <p>List Of Order ID <br>Ex. “123,124,125”</p>              |
| numberlist                                  | String | <p>List Of Order Number <br>Ex. “SO-001,SO-002,SO-003”</p> |

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

| ShipmentLabel (Array) | Type        | Description/Example                                                                                                               |
| --------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| linkurl               | String      | Url of Shipment Label                                                                                                             |
| type                  | String      | <p>Type of Shipment Label.<br>Ex. "general, lazada, shopee, jdcentral, tiktok, flashexpress, jtexpress, kerry, shopeeexpress"</p> |
| Format                | String      | Pdf, Html, Url                                                                                                                    |
| Data                  | String      | Shipment Label Data (Follow on Format)                                                                                            |
| list                  | Int (Array) | List Of Order ID                                                                                                                  |
| {% endtab %}          |             |                                                                                                                                   |
| {% endtabs %}         |             |                                                                                                                                   |

## Add Order

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

Add order.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |
| link         | Int    | <p>Link to generate.</p><p>0 – None (Default)<br>1 – Share link</p>                         |

#### 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

<table><thead><tr><th width="289">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>number<mark style="color:red;">*</mark></td><td>String</td><td>Order Number</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>Double</td><td>Net Amount</td></tr><tr><td>status</td><td>String</td><td>Status (Pending, Success) <br>Default - Pending</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>customercode</td><td>String</td><td>Customer Code</td></tr><tr><td>customername</td><td>String</td><td>Customer Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Customer ID Number/Tax ID</td></tr><tr><td>customerphone</td><td>String</td><td>Customer Phone</td></tr><tr><td>customeremail</td><td>String</td><td>Customer Email</td></tr><tr><td>customeraddress</td><td>String</td><td>Customer Address</td></tr><tr><td>customerbranchno</td><td>String</td><td>Customer Branch No</td></tr><tr><td>customerbranchname</td><td>String</td><td>Customer Branch Name</td></tr><tr><td>shippingaddress</td><td>String</td><td>Shipping Address</td></tr><tr><td>shippingname</td><td>String</td><td>Shipping Name</td></tr><tr><td>shippingdate</td><td>String</td><td><p>Shipping Date</p><p>Ex. “2021-09-15”</p></td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingchannel</td><td>String</td><td>Shipping Channel</td></tr><tr><td>trackingno</td><td>String</td><td>Tracking No</td></tr><tr><td>shippingemail</td><td>String</td><td>Shipping Email</td></tr><tr><td>shippingphone</td><td>String</td><td>Shipping Phone</td></tr><tr><td>paymentamount</td><td>Double</td><td><p>Payment Amount</p><p>("paymentmethod" must be required.)</p></td></tr><tr><td>paymentmethod</td><td>String</td><td>Payment Method</td></tr><tr><td>orderdate</td><td>String</td><td>Order Date<br>Ex. "2021-09-15"</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>saleschannel</td><td>String</td><td>Sales Channel</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex. 5.00, 10%</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>paymentdate</td><td>String</td><td>Payment Datetime <br>Ex. “2021-09-15 21:05”</td></tr><tr><td>list</td><td>OrderProduct (Array)</td><td>Product List</td></tr><tr><td>  ∟ sku<mark style="color:red;">*</mark></td><td>String</td><td>Product Sku</td></tr><tr><td>  ∟ name<mark style="color:red;">*</mark></td><td>String</td><td>Product Name</td></tr><tr><td>  ∟ number<mark style="color:red;">*</mark></td><td>Double</td><td>Product Quantity</td></tr><tr><td>  ∟ pricepernumber<mark style="color:red;">*</mark></td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>  ∟ discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>  ∟ vat_status</td><td>Int</td><td>Sell vat status<br>0 - Follow Vat Type in Order (Default)<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%<br>Remark: Only Merchant With Addon "Advance Vat".</td></tr><tr><td>  ∟ totalprice<mark style="color:red;">*</mark></td><td>Double</td><td>Total Price</td></tr><tr><td>  ∟ producttype</td><td>Int</td><td>Product Type<br>0 - Product (Default)<br>1 - Service</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</td></tr><tr><td>isCOD</td><td>Boolean</td><td>COD Status</td></tr><tr><td>agent</td><td>Agent</td><td>Agent Detail</td></tr><tr><td>  ∟ name</td><td>String</td><td>Agent Name</td></tr><tr><td>  ∟ phone</td><td>String</td><td>Agent Phone</td></tr><tr><td>  ∟ email</td><td>String</td><td>Agent Email</td></tr><tr><td>  ∟ address</td><td>String</td><td>Agent Address</td></tr><tr><td>expiredate</td><td>String</td><td>Expired Date<br>Ex. "2021-09-15"</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr><tr><td>  ∟ id</td><td>Int</td><td><p>Property ID</p><p>*Must have either id or name</p></td></tr><tr><td>  ∟ value</td><td>String</td><td>Property Value</td></tr><tr><td>  ∟ name</td><td>String</td><td><p>Property Name Require if id = 0 or null</p><p>*Must have either id or name</p></td></tr></tbody></table>

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

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

```json
{
  "number": "SO-0001",
  "orderdate": "2021-05-31",
  "amount": 68,
  "shippingamount": 10,
  "vatamount": 0,
  "paymentmethod": "Cash",
  "paymentamount": 50,
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": 24,
      "pricepernumber": 2,
      "discount": "0",
      "totalprice": 48
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": 1,
      "pricepernumber": 10,
      "discount": "0",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Update Order Status

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

Update status of order.

#### Query Parameters

| Name          | Type   | Description                                                                                 |
| ------------- | ------ | ------------------------------------------------------------------------------------------- |
| id            | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                       |
| status        | int    | <p>1 = Success (Default) <br>3 = Waiting<br>4 = Returned<br>5 = Packed <br>6 = Shipping</p> |
| warehousecode | String | Warehouse Code                                                                              |
| number        | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>         |
| actionDate    | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                            |

#### 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 %} |        |                                       |

## Update Order Payment

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

Update payment of order.

#### Query Parameters

| Name                                            | Type   | Description                                                                         |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                              | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| verifyslipid                                    | Int    | Verify Slip ID                                                                      |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                  |
| paymentamount<mark style="color:red;">\*</mark> | Double | Payment Amount                                                                      |
| paymentmethod<mark style="color:red;">\*</mark> | String | Payment Method                                                                      |
| number                                          | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Verify Slip

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

Verify slip of order.

#### Query Parameters

| Name                                       | Type   | Description                                                                         |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------- |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| filename<mark style="color:red;">\*</mark> | String | File Name                                                                           |
| number                                     | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 Partial Order

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

Update partial product of order.

#### Query Parameters

| Name          | Type   | Description                                                                         |
| ------------- | ------ | ----------------------------------------------------------------------------------- |
| id            | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| warehousecode | String | Warehouse Code                                                                      |
| number        | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actiondate    | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                    |

#### 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                                                                                   |
| ------------------------------------------ | -------------------- | --------------------------------------------------------------------------------------------- |
|                                            | OrderProduct (Array) | Product List                                                                                  |
| ∟ 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> |
| ∟ number<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                  |
| {% endtab %} |        |                                       |

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

```json
[
    {
      "sku": "P0001",
      "number": 24
    },
    {
      "productid": 1234,
      "number": 25
    }
]
```

{% endtab %}
{% endtabs %}

## Edit Order Info

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

Edit order info.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                                 |
| ------------------ | -------------- | ------------------------------------------- |
| number             | String         | Order Number                                |
| trackingno         | String         | Tracking No                                 |
| shippingemail      | String         | Shipping Email                              |
| shippingphone      | String         | Shipping Phone                              |
| shippingaddress    | String         | Shipping Address                            |
| shippingname       | String         | Shipping Name                               |
| shippingdate       | String         | <p>Shipping Date</p><p>Ex. “2021-09-15”</p> |
| shippingchannel    | String         | Shipping Channel                            |
| customeraddress    | String         | Customer Address                            |
| customerphone      | String         | Customer Phone                              |
| customeremail      | String         | Customer Email                              |
| customeridnumber   | String         | Customer ID Number/Tax ID                   |
| customername       | String         | Customer Name                               |
| orderdate          | String         | <p>Order Date<br>Ex. “2021-09-15”</p>       |
| tag                | String (Array) | Tag List (Array)                            |
| saleschannel       | String         | Sales Channel                               |
| description        | String         | Description                                 |
| customercode       | String         | Customer Code                               |
| customerbranchno   | String         | Customer Branch No                          |
| customerbranchname | String         | Customer Branch Name                        |
| agent              | Agent          | Agent Detail                                |
| ∟ name             | String         | Agent Name                                  |
| ∟ phone            | String         | Agent Phone                                 |
| ∟ email            | String         | Agent Email                                 |
| ∟ address          | String         | Agent Address                               |
| expiredate         | String         | <p>Expired Date<br>Ex. “2021-09-15”</p>     |
| reference          | String         | Reference                                   |

{% 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
{
  "number": "SO-0001",
  "orderdate": "2021-05-31"
}
```

{% endtab %}
{% endtabs %}

## Edit Order

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

Edit order.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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

<table><thead><tr><th width="299">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>number</td><td>String</td><td>Order Number</td></tr><tr><td>customerbranchno</td><td>String</td><td>Customer Branch No</td></tr><tr><td>customerbranchname</td><td>String</td><td>Customer Branch Name</td></tr><tr><td>customeraddress</td><td>String</td><td>Customer Address</td></tr><tr><td>customerphone</td><td>String</td><td>Customer Phone</td></tr><tr><td>customeremail</td><td>String</td><td>Customer Email</td></tr><tr><td>customeridnumber</td><td>String</td><td>Customer ID Number/Tax ID</td></tr><tr><td>customername</td><td>String</td><td>Customer Name</td></tr><tr><td>customercode</td><td>String</td><td>Customer Code</td></tr><tr><td>shippingphone</td><td>String</td><td>Shipping Phone</td></tr><tr><td>shippingaddress</td><td>String</td><td>Shipping Address</td></tr><tr><td>shippingname</td><td>String</td><td>Shipping Name</td></tr><tr><td>shippingdate</td><td>String</td><td><p>Shipping Date</p><p>Ex. “2021-09-15”</p></td></tr><tr><td>shippingchannel</td><td>String</td><td>Shipping Channel</td></tr><tr><td>expiredate</td><td>String</td><td>Expired Date<br>Ex. “2021-09-15”</td></tr><tr><td>orderdate</td><td>String</td><td>Order Date<br>Ex. “2021-09-15”</td></tr><tr><td>trackingno</td><td>String</td><td>Tracking No</td></tr><tr><td>shippingemail</td><td>String</td><td>Shipping Email</td></tr><tr><td>saleschannel</td><td>String</td><td>Sales Channel</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>Double</td><td>Net Amount</td></tr><tr><td>agent</td><td>Agent</td><td>Agent Detail</td></tr><tr><td>  ∟ name</td><td>String</td><td>Agent Name</td></tr><tr><td>  ∟ phone</td><td>String</td><td>Agent Phone</td></tr><tr><td>  ∟ email</td><td>String</td><td>Agent Email</td></tr><tr><td>  ∟ address</td><td>String</td><td>Agent Address</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex. 5.00, 10%</td></tr><tr><td>list</td><td>OrderProduct (Array)</td><td>Product List</td></tr><tr><td>  ∟ sku<mark style="color:red;">*</mark></td><td>String</td><td>Product Sku</td></tr><tr><td>  ∟ name<mark style="color:red;">*</mark></td><td>String</td><td>Product Name</td></tr><tr><td>  ∟ number<mark style="color:red;">*</mark></td><td>Double</td><td>Product Quantity</td></tr><tr><td>  ∟ pricepernumber<mark style="color:red;">*</mark></td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>  ∟ discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>  ∟ vat_status</td><td>Int</td><td>Sell vat status<br>0 - Follow Vat Type in Order (Default)<br>1 - No Vat<br>2- Have Vat<br>3 - Vat 0%<br>Remark: Only Merchant With Addon "Advance Vat".</td></tr><tr><td>  ∟ totalprice<mark style="color:red;">*</mark></td><td>Double</td><td>Total Price</td></tr></tbody></table>

{% 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
{
  "number": "SO-0001",
  "orderdate": "2021-05-31",
  "amount": 68,
  "shippingamount": 10,
  "vatamount": 0,
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": 24,
      "pricepernumber": 2,
      "discount": "0",
      "totalprice": 48
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": 1,
      "pricepernumber": 10,
      "discount": "0",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Void Order

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

Void order.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Void Order Payment

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

Delete payment in order.

#### Query Parameters

| Name                                        | Type   | Description                                                                         |
| ------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                          | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| paymentid<mark style="color:red;">\*</mark> | Int    | Payment ID                                                                          |
| number                                      | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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="161.4">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 %}

## Ready To Ship

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

Ready to ship. The status will be changed to “Waiting”. If the order is from marketplace, the system will try to update order in marketplace to “Ready to ship”.

#### Query Parameters

| Name                                       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                                                                                                                                                                                                                                                                                                                                                           |
| booking                                    | Int    | <p>Booking Request Status</p><p>0 - None (Default)</p><p>1 - Call shipment provider. The available shipment is “flashexpress” (Flash Express), “jtexpress” (J\&T) and “kerry” (Kerry). Support only non-marketplace order.</p>                                                                                                                                                                                                  |
| pickuptime                                 | String | <p>Shopee pickup datetime keyword for pickup.<br>Not Required for Shopee Pickup.</p><p>If this is blank, the system will choose earliest time. <br>Ex. "2026-01-31 14:00"</p>                                                                                                                                                                                                                                                   |
| address                                    | String | <p>Pickup location keyword for pickup.<br>Required if the shipment is Shopee Pickup.<br>Ex. "10420" - Postcode of pickup location.</p>                                                                                                                                                                                                                                                                                          |
| trackingno                                 | String | <p>Tracking No.</p><p>Not require if shipment by marketplace.</p>                                                                                                                                                                                                                                                                                                                                                               |
| shipment<mark style="color:red;">\*</mark> | String | <p>Shipment provider.<br><br>This is shipping channel, if the order is non-marketplace.<br>If this order is from marketplace, please specify marketplace shipment.<br>Ex.<br><strong>Shopee</strong> - "pickup" or "dropoff"<br><strong>Lazada</strong> - "lex" or default shipping channel of order.<br>If in order doesn't have shipping channel please use "lex".<br><strong>Tiktok Shop</strong>- "pickup" or "dropoff"</p> |
| warehousecode                              | String | Warehouse Code                                                                                                                                                                                                                                                                                                                                                                                                                  |
| number                                     | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>                                                                                                                                                                                                                                                                                                                                             |

#### 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                  |
| detail    | Detail | Response detail                       |

| Parameter (Detail) | Type   | Description/Example |
| ------------------ | ------ | ------------------- |
| id                 | Int    | Order ID            |
| number             | String | Order Number        |
| shippingchannel    | String | Shipping Channel    |
| trackingno         | String | Tracking No         |
| link               | String | Shipping Label Link |
| {% endtab %}       |        |                     |
| {% endtabs %}      |        |                     |

## Book Order Shipment

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

Call shipment provider. The available shipment is “flashexpress” (Flash Express), “jtexpress” (J\&T) and “kerry” (Kerry). The status will be changed to “Waiting”. Support only non- marketplace order.

#### Query Parameters

| Name                                       | Type    | Description                                                                                                                                                                                                                                                      |
| ------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                                         | Int     | <p>Order ID</p><p>\*Must have either id or number</p>                                                                                                                                                                                                            |
| shipment<mark style="color:red;">\*</mark> | String  | <p>Shipment provider. <br>thailandpost - Thailand Post<br>flashexpress – Flash Express <br>kerry – Kerry</p><p>shopeeexpress – Shopee Express<br>dhl - DHL</p>                                                                                                   |
| number                                     | String  | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>                                                                                                                                                                              |
| useShippingPoint                           | Boolean | <p>Define this shipment uses shipping point.<br>True : Shipping Point<br>False : Direct Payment (Default when shipment is valid.)</p><p><br><strong>Remark:</strong> Shipping Point is supported only Thailand Post, Flash Express, Shopee Exporess and DHL.</p> |
| isPickup                                   | Boolean | <p>Define this shipment is pickup.<br>True : Pickup (Default when Shipping Point of shipment is valid.)<br>False : Drop off</p>                                                                                                                                  |

#### 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 (Not Required)

if no request body, this order will use address of merchant profile and shipping/customer address in this order.

| Name              | Type                    | Description                                                              |
| ----------------- | ----------------------- | ------------------------------------------------------------------------ |
| senderName        | String                  | Sender Name                                                              |
| senderPhone       | String                  | Sender Phone                                                             |
| senderEmail       | String                  | Sender Email                                                             |
| senderAddress     | String                  | Sender Address                                                           |
| senderDistrict    | String                  | Sender District                                                          |
| senderCity        | String                  | Sender City                                                              |
| senderProvince    | String                  | Sender Province                                                          |
| senderPostcode    | String                  | Sender Postcode                                                          |
| recipientName     | String                  | Recipient Name                                                           |
| recipientPhone    | String                  | Recipient Phone                                                          |
| recipientEmail    | String                  | Recipient Email                                                          |
| recipientAddress  | String                  | Recipient Address                                                        |
| recipientDistrict | String                  | Recipient District                                                       |
| recipientCity     | String                  | Recipient City                                                           |
| recipientProvince | String                  | Recipient Province                                                       |
| recipientPostcode | String                  | Recipient Postcode                                                       |
| codAmount         | Double                  | <p>COD Amount <br>(Assign this value = 0, if this order is not COD.)</p> |
| parcelWeight      | Decimal (Not Required)  | Parcel Weight (Gram)                                                     |
| parcelWidth       | Decimall (Not Required) | Parcel Width (cm)                                                        |
| parcelLength      | Decimall (Not Required) | Parcel Length (cm)                                                       |
| parcelHeight      | Decimall (Not Required) | Parcel Height (cm)                                                       |

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

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

| Parameter (Detail) | Type   | Description/Example |
| ------------------ | ------ | ------------------- |
| id                 | Int    | Order ID            |
| number             | String | Order Number        |
| shippingchannel    | String | Shipping Channel    |
| trackingno         | String | Tracking No         |
| link               | String | Shipping Label Link |
| {% endtab %}       |        |                     |
| {% endtabs %}      |        |                     |

## Update Order Serial No

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

Update serial number of order.

#### Query Parameters

| Name                                       | Type   | Description                                                                                   |
| ------------------------------------------ | ------ | --------------------------------------------------------------------------------------------- |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                         |
| serialno<mark style="color:red;">\*</mark> | String | Serial Number                                                                                 |
| sku                                        | String | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |
| productid                                  | Int    | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| number                                     | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>           |

#### 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 %} |        |                                       |

## Update Order Expiry/Lot

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

Update expiry/lot of order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                   |
| ------------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| id                                          | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                         |
| lotnumber<mark style="color:red;">\*</mark> | Double | Lot Number                                                                                    |
| lot<mark style="color:red;">\*</mark>       | String | Lot Name                                                                                      |
| sku                                         | String | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |
| productid                                   | Int    | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| number                                      | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>           |

#### 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 %} |        |                                       |

## Add Expense Order

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

Add expense to order.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Order 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<mark style="color:red;">\*</mark>        | String | Expense Name                                                    |
| paymentname<mark style="color:red;">\*</mark> | String | Payment Method                                                  |
| amount<mark style="color:red;">\*</mark>      | Double | Amount                                                          |
| isvat                                         | Int    | <p>Vat Status<br>0 - No Vat (Default)</p><p>1 - Include Vat</p> |

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

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

## Add Order Tag

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

Add tag to order.

#### Query Parameters

| Name                                  | Type   | Description                                                                         |
| ------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                 |
| number                                | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 Order Tag

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

Delete tag of order.

#### Query Parameters

| Name                                  | Type   | Description                                                                         |
| ------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                 |
| number                                | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Add Voucher Order

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

Add voucher to order.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| id           | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                       |
| number       | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>         |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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 | <p>Voucher Name<br>- Voucher<br>- Coin<br>- Rebate</p> |
| amount | Double | Voucher Amount-                                        |

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

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

## Delete Voucher Order

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

Delete voucher of order.

#### Query Parameters

| Name                                        | Type   | Description                                                                         |
| ------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                          | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number                                      | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| voucherid<mark style="color:red;">\*</mark> | Int    | Voucher Order 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 %} |        |                                       |


# Purchase Order

## Get Purchase Orders

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

Get list of purchase orders.

#### Query Parameters

| Name                    | Type   | Description                                                                 |
| ----------------------- | ------ | --------------------------------------------------------------------------- |
| purchaseorderdateafter  | String | <p>Purchase Order Date After .....<br>(yyyy-MM-dd)</p>                      |
| purchaseorderdatebefore | String | <p>Purchase Order Date Before .....<br>(yyyy-MM-dd)</p>                     |
| toamount                | Double | Maximum amount                                                              |
| fromamount              | Double | Minimum amount                                                              |
| updatedatetimeafter     | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>                   |
| updatedatetimebefore    | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>                  |
| createdatetimeafter     | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>                   |
| createdatetimebefore    | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>                  |
| paymentafter            | String | <p>Paid Date After .....<br>(yyyy-MM-dd)</p>                                |
| paymentbefore           | String | <p>Paid Date Before .....<br>(yyyy-MM-dd)</p>                               |
| updatedafter            | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>                             |
| updatedbefore           | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>                            |
| createdafter            | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>                             |
| createdbefore           | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>                            |
| expirylot               | Int    | <p>Show expiry lot status<br>0 - No (Default)<br>1 - Yes</p>                |
| serialno                | Int    | <p>Show serial no status<br>0 - No (Default)<br>1 - Yes</p>                 |
| createusername          | String | Created by (Username)                                                       |
| warehousecode           | String | Warehouse Code                                                              |
| topaymentamount         | Double | Maximum payment amount                                                      |
| frompaymentamount       | Double | Minimum payment amount                                                      |
| keyword                 | String | Keyword to search                                                           |
| sortdirection           | String | <p>Sorting Type By id<br>DESC - Descending (Default)<br>ASC - Ascending</p> |
| limit                   | Int    | Limit per page (Max = 500)                                                  |
| page                    | Int    | Page (Default = 1)                                                          |

#### 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                                                          |
| purchaseorderidlist                         | String | <p>List Of Purchase Order ID <br>Ex. “123,124,125”</p>              |
| numberlist                                  | String | <p>List Of Purchase Order Number <br>Ex. “PO-001,PO-002,PO-003”</p> |

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

| Parameter          | Type                  | Description/Example                   |
| ------------------ | --------------------- | ------------------------------------- |
| res                | Response              | <p>Response Code <br>200- Success</p> |
| list               | PurchaseOrder (Array) | Purchase Order List (Array)           |
| count              | Int                   | Total purchase order number by filter |
| totalAmount        | Double                | Total amount by filter                |
| totalPaymentAmount | Double                | Total payment amount by filter        |

| PurchaseOrder (Array)   | Type                         | Description/Example                                                                 |
| ----------------------- | ---------------------------- | ----------------------------------------------------------------------------------- |
| id                      | Int                          | Purchase Order ID                                                                   |
| number                  | String                       | Purchase Order Number                                                               |
| customerid              | Int                          | Contact ID                                                                          |
| customercode            | String                       | Contact Code                                                                        |
| customername            | String                       | Contact Name                                                                        |
| customeridnumber        | String                       | Contact ID Number/Tax ID                                                            |
| customeremail           | String                       | Contact Email                                                                       |
| customerphone           | String                       | Contact Phone                                                                       |
| customeraddress         | String                       | Contact Address                                                                     |
| customerbranchname      | String                       | Contact Branch Name                                                                 |
| customerbranchno        | String                       | Contact Branch No                                                                   |
| status                  | String                       | <p>Status (Pending, Waiting,</p><p>Shipping, Success, Partial Transfer, Voided)</p> |
| paymentstatus           | String                       | Payment Status (Pending, Paid, Partial Payment, Excess Payment)                     |
| amount                  | Double                       | Net Amount                                                                          |
| amount\_pretax          | Double                       | Pretax Amount                                                                       |
| vatamount               | Double                       | Vat Amount                                                                          |
| shippingamount          | Double                       | Shipping Amount                                                                     |
| shippingamount\_pretax  | Double                       | Pretax Shipping Amount                                                              |
| shippingamount\_vat     | Double                       | Shipping Vat Amount                                                                 |
| purchaseorderdate       | Date                         | Purchase Order Date                                                                 |
| purchaseorderdateString | String                       | Purchase Order Date Text (yyyy-MM-dd)                                               |
| paymentamount           | Double                       | Payment Amount                                                                      |
| reference               | String                       | Reference                                                                           |
| description             | String                       | Description                                                                         |
| discount                | String                       | <p>Discount <br>Ex.5.00, 10%</p>                                                    |
| discountamount          | Double                       | Total summary of purchase order discount.                                           |
| discountamount\_pretax  | Double                       | Total summary of pretax purchase order discount.                                    |
| discountamount\_vat     | Double                       | Total summary of purchase order vat.                                                |
| vattype                 | Int                          | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p>     |
| warehousecode           | String                       | Warehouse Code                                                                      |
| list                    | PurchaseOrderProduct (Array) | Product List                                                                        |
| payments                | Payment (Array)              | Payment List                                                                        |
| tag                     | String (Array)               | Tag List (Array)                                                                    |
| createdatetime          | Datetime                     | Created Datetime                                                                    |
| createdatetimeString    | String                       | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                 |
| updatedatetime          | Datetime                     | Updated Datetime                                                                    |
| updatedatetimeString    | String                       | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                 |
| createuserid            | Int                          | Created User ID                                                                     |
| createusername          | String                       | Created User (Username)                                                             |
| createdby               | String                       | Created User (Display name)                                                         |
| uniquenumber            | String                       | Unique Number                                                                       |
| currency                | String                       | Currency                                                                            |
| properties              | Property (Array)             | Custom Properties List                                                              |

| PurchaseOrderProduct (Array) | Type              | Description/Example                                                                        |
| ---------------------------- | ----------------- | ------------------------------------------------------------------------------------------ |
| productid                    | Int               | Product ID                                                                                 |
| sku                          | String            | Product Sku                                                                                |
| name                         | String            | Product Name                                                                               |
| number                       | Double            | Product Quantity                                                                           |
| unittext                     | String            | Unit                                                                                       |
| pricepernumber               | Double            | Product Price/Quantity                                                                     |
| pricepernumber\_pretax       | Double            | Pretax Product Price/Quantity                                                              |
| pricepernumber\_vat          | Double            | Product Vat/Quantity                                                                       |
| discount                     | String            | Discount Per Unit                                                                          |
| discountamount               | Double            | Total discount of product line.                                                            |
| discountamount\_pretax       | Double            | Total pretax discount of product line.                                                     |
| discountamount\_vat          | Double            | Total discount vat of product line.                                                        |
| totalprice                   | Double            | Total Price                                                                                |
| totalprice\_pretax           | Double            | Pretax Total Price                                                                         |
| totalprice\_vat              | Double            | Total Vat                                                                                  |
| vat\_status                  | Int               | <p>Purchase vat status<br>0 - Follow Vat Type in Purchase<br>1 - No Vat<br>2- Have Vat</p> |
| producttype                  | Int               | <p>Product Type<br>0 - Product (Default)<br>1 - Service</p>                                |
| serialnolist                 | SerialNo (Array)  | Serial no List                                                                             |
| expirylotlist                | ExpiryLot (Array) | Expiry lot List                                                                            |

| Payment (Array)       | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Payment ID                                          |
| name                  | String   | Payment Method Name                                 |
| amount                | Double   | Payment Amount                                      |
| paymentdatetime       | Datetime | Payment Datetime                                    |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |

| SerialNo (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Serial no ID        |
| name             | String | Serial no Name      |

| ExpiryLot (Array) | Type   | Description/Example |
| ----------------- | ------ | ------------------- |
| id                | Int    | Expiry lot ID       |
| name              | String | Expiry lot Name     |
| number            | Double | Expiry lot Quantity |
| expiryDate        | Date   | Expired Date        |

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

## Get Purchase Order Detail

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

Get purchase order detail.

#### Query Parameters

| Name                                 | Type | Description       |
| ------------------------------------ | ---- | ----------------- |
| id<mark style="color:red;">\*</mark> | Int  | Purchase Order 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="258">Parameter</th><th width="194.53947368421055">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Purchase Order ID</td></tr><tr><td>number</td><td>String</td><td>Purchase Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Contact ID</td></tr><tr><td>customercode</td><td>String</td><td>Contact Code</td></tr><tr><td>customername</td><td>String</td><td>Contact Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Contact ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Contact Email</td></tr><tr><td>customerphone</td><td>String</td><td>Contact Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Contact Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Contact Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Contact Branch No</td></tr><tr><td>status</td><td>String</td><td><p>Status (Pending, Waiting,</p><p>Shipping, Success, Partial Transfer, Voided)</p></td></tr><tr><td>paymentstatus</td><td>String</td><td><p>Payment Status (Pending, Paid,</p><p>Partial Payment, Excess Payment)</p></td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td>Double</td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>purchaseorderdate</td><td>Date</td><td>Purchase Order Date</td></tr><tr><td>purchaseorderdateString</td><td>String</td><td>Purchase Order Date Text (yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex.5.00, 10%</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of purchase order discount.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax purchase order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of purchase order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>PurchaseOrderProduct (Array)</td><td>Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text<br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>uniquenumber</td><td>String</td><td>Unique Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr></tbody></table>

| PurchaseOrderProduct (Array) | Type              | Description/Example                                                                        |
| ---------------------------- | ----------------- | ------------------------------------------------------------------------------------------ |
| productid                    | Int               | Product ID                                                                                 |
| sku                          | String            | Product Sku                                                                                |
| name                         | String            | Product Name                                                                               |
| number                       | Double            | Product Quantity                                                                           |
| unittext                     | String            | Unit                                                                                       |
| pricepernumber               | Double            | Product Price/Quantity                                                                     |
| pricepernumber\_pretax       | Double            | Pretax Product Price/Quantity                                                              |
| pricepernumber\_vat          | Double            | Product Vat/Quantity                                                                       |
| discount                     | String            | Discount Per Unit                                                                          |
| discountamount               | Double            | Total discount of product line.                                                            |
| discountamount\_pretax       | Double            | Total pretax discount of product line.                                                     |
| discountamount\_vat          | Double            | Total discount vat of product line.                                                        |
| totalprice                   | Double            | Total Price                                                                                |
| totalprice\_pretax           | Double            | Pretax Total Price                                                                         |
| totalprice\_vat              | Double            | Total Vat                                                                                  |
| producttype                  | Int               | <p>Product Type<br>0 - Product (Default)<br>1 - Service</p>                                |
| vat\_status                  | Int               | <p>Purchase vat status<br>0 - Follow Vat Type in Purchase<br>1 - No Vat<br>2- Have Vat</p> |
| serialnolist                 | SerialNo (Array)  | Serial no List                                                                             |
| expirylotlist                | ExpiryLot (Array) | Expiry lot List                                                                            |

| Payment (Array)       | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Payment ID                                          |
| name                  | String   | Payment Method Name                                 |
| amount                | Double   | Payment Amount                                      |
| paymentdatetime       | Datetime | Payment Datetime                                    |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |

<table><thead><tr><th width="150">SerialNo (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Serial no ID</td></tr><tr><td>name</td><td>String</td><td>Serial no Name</td></tr></tbody></table>

<table><thead><tr><th width="159.00521512385916">ExpiryLot (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Expiry lot ID</td></tr><tr><td>name</td><td>String</td><td>Expiry lot Name</td></tr><tr><td>number</td><td>Double</td><td>Expiry lot Quantity</td></tr><tr><td>expiryDate</td><td>Date</td><td>Expired Date</td></tr></tbody></table>

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

## Get Movement Purchase Order Detail

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

Get movement list of products according to each purchase order.

#### Query Parameters

| Name                                 | Type | Description       |
| ------------------------------------ | ---- | ----------------- |
| id<mark style="color:red;">\*</mark> | Int  | Purchase Order 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>MovementPurchaseOrder (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>ID</td></tr><tr><td>list</td><td>PurchaseOrderProduct (Array)</td><td>Product List</td></tr><tr><td>actionDate</td><td>Date (Array)</td><td>List of action date</td></tr><tr><td>actionDateString</td><td>String (Array)</td><td>List of action date text <br>(yyyy-MM-dd)</td></tr><tr><td>purchaseorderid</td><td>Int</td><td>Purchase Order ID</td></tr></tbody></table>

| PurchaseOrderProduct (Array) | Type   | Description/Example    |
| ---------------------------- | ------ | ---------------------- |
| productid                    | Int    | Product ID             |
| sku                          | String | Product Sku            |
| name                         | String | Product Name           |
| number                       | Double | Product Quantity       |
| unittext                     | String | Unit                   |
| pricepernumber               | Double | Product Price/Quantity |
| discount                     | String | Discount Per Unit      |
| totalprice                   | Double | Total Price            |

{% endtab %}
{% endtabs %}

## Get Movement Purchase Orders

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

Get movement list of products for purchase orders.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |
| 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" %}

<table><thead><tr><th>Parameter</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>res</td><td>Response</td><td>Response Code <br>200- Success</td></tr><tr><td>list</td><td>MovementPurchaseOrder (Array)</td><td>Movement Purchase Order List (Array)</td></tr><tr><td>count</td><td>Int</td><td>Total movement order number by filter</td></tr></tbody></table>

| MovementPurchaseOrder (Array) | Type                         | Description/Example                              |
| ----------------------------- | ---------------------------- | ------------------------------------------------ |
| id                            | Int                          | ID                                               |
| list                          | PurchaseOrderProduct (Array) | Movement List                                    |
| actionDate                    | Date (Array)                 | List of action date                              |
| actionDateString              | String (Array)               | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| purchaseorderid               | Int                          | Purchase Order ID                                |

| PurchaseOrderProduct (Array) | Type   | Description/Example    |
| ---------------------------- | ------ | ---------------------- |
| productid                    | Int    | Product ID             |
| sku                          | String | Product Sku            |
| name                         | String | Product Name           |
| number                       | Double | Product Quantity       |
| unittext                     | String | Unit                   |
| pricepernumber               | Double | Product Price/Quantity |
| discount                     | String | Discount Per Unit      |
| totalprice                   | Double | Total Price            |

{% endtab %}
{% endtabs %}

## Get Expense Purchase Order Detail

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

Get list of expenses of purchase order.

#### Query Parameters

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

| Expense (Array)       | Type     | Description/Example                                   |
| --------------------- | -------- | ----------------------------------------------------- |
| id                    | Int      | ID                                                    |
| name                  | String   | Expense Name                                          |
| amount                | Double   | Amount                                                |
| paymentname           | String   | Payment Method Name                                   |
| paymentdatetime       | Datetime | Payment Datetime                                      |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p>   |
| isvat                 | Int      | <p>Vat Status<br>0 - No Vat</p><p>1 - Include Vat</p> |
| {% endtab %}          |          |                                                       |
| {% endtabs %}         |          |                                                       |

## Add Purchase Order

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

Add purchase order.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number<mark style="color:red;">\*</mark>           | String                       | Purchase Order Number                                                                                                                                                                                                                                                            |
| status                                             | String                       | <p>Status (Pending,Success) <br>Default – Pending</p>                                                                                                                                                                                                                            |
| reference                                          | String                       | Reference                                                                                                                                                                                                                                                                        |
| customercode                                       | String                       | Contact Code                                                                                                                                                                                                                                                                     |
| customername                                       | String                       | Contact Name                                                                                                                                                                                                                                                                     |
| customeridnumber                                   | String                       | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| customerphone                                      | String                       | Contact Phone                                                                                                                                                                                                                                                                    |
| customeremail                                      | String                       | Contact Email                                                                                                                                                                                                                                                                    |
| customeraddress                                    | String                       | Contact Address                                                                                                                                                                                                                                                                  |
| customerbranchno                                   | String                       | Contact Branch No                                                                                                                                                                                                                                                                |
| customerbranchname                                 | String                       | Contact Branch Name                                                                                                                                                                                                                                                              |
| paymentamount                                      | Double                       | <p>Payment Amount</p><p>("paymentmethod" must be required.)</p>                                                                                                                                                                                                                  |
| paymentmethod                                      | String                       | Payment Method                                                                                                                                                                                                                                                                   |
| purchaseorderdate                                  | String                       | <p>Purchase Order Date</p><p>Ex. “2021-09-15”</p>                                                                                                                                                                                                                                |
| vatamount                                          | Double                       | Vat Amount                                                                                                                                                                                                                                                                       |
| amount<mark style="color:red;">\*</mark>           | Double                       | Net Amount                                                                                                                                                                                                                                                                       |
| warehousecode                                      | String                       | Warehouse Code                                                                                                                                                                                                                                                                   |
| discount                                           | String                       | <p>Discount <br>Ex.5.00, 10%</p>                                                                                                                                                                                                                                                 |
| description                                        | String                       | Description                                                                                                                                                                                                                                                                      |
| list                                               | PurchaseOrderProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| ∟ sku<mark style="color:red;">\*</mark>            | String                       | Product Sku                                                                                                                                                                                                                                                                      |
| ∟ name<mark style="color:red;">\*</mark>           | String                       | Product Name                                                                                                                                                                                                                                                                     |
| ∟ number<mark style="color:red;">\*</mark>         | Double                       | Product Quantity                                                                                                                                                                                                                                                                 |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double                       | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ discount                                         | String                       | Discount Per Unit                                                                                                                                                                                                                                                                |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                       | Total Price                                                                                                                                                                                                                                                                      |
| ∟ producttype                                      | Int                          | <p>Product Type<br>0 - Product (Default)<br>1 - Service</p>                                                                                                                                                                                                                      |
| ∟ vat\_status                                      | Int                          | <p>Purchase vat status <br>0 - Follow Vat Type in Purchase (Default) </p><p>1 - No Vat </p><p>2- Have Vat<br>Remark: Only Merchant With Addon "Advance Vat".</p>                                                                                                                 |
| tag                                                | String (Array)               | Tag List (Array)                                                                                                                                                                                                                                                                 |
| vattype                                            | Int                          | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| shippingamount                                     | Double                       | Shipping Amount                                                                                                                                                                                                                                                                  |
| shippingvat                                        | Int                          | <p>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</p>                                                                                                                                                                                           |
| properties                                         | Property (Array)             | Custom Properties List                                                                                                                                                                                                                                                           |
| ∟ value                                            | String                       | Property Value                                                                                                                                                                                                                                                                   |
| ∟ 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>                                                                                                                                                                                                                           |

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

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

```json
{
  "number": "PO-0001",
  "purchaseorderdate": "2021-05-31",
  "amount": 58,
  "vatamount": 0,
  "paymentmethod": "Cash",
  "paymentamount": 50.0,
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": 24,
      "pricepernumber": 2,
      "discount": "0",
      "totalprice": 48
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": 1,
      "pricepernumber": 10,
      "discount": "0",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Update Purchase Order Status

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

Update status of purchase order.

#### Query Parameters

| Name          | Type   | Description                                                                                  |
| ------------- | ------ | -------------------------------------------------------------------------------------------- |
| id            | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| status        | Int    | <p>1 = Success (Default) <br>3 = Waiting <br>6 = Shipping</p>                                |
| warehousecode | String | Warehouse Code                                                                               |
| number        | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actionDate    | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                             |

#### 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>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 %}

## Update Purchase Order Payment

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

Update payment of purchase order.

#### Query Parameters

| Name                                            | Type   | Description                                                                                  |
| ----------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| id                                              | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                           |
| paymentamount<mark style="color:red;">\*</mark> | Double | Payment Amount                                                                               |
| paymentmethod<mark style="color:red;">\*</mark> | String | Payment Method                                                                               |
| number                                          | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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>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 %}

## Update Partial Purchase Order

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

Update partial product of purchase order.

#### Query Parameters

| Name          | Type   | Description                                                                                  |
| ------------- | ------ | -------------------------------------------------------------------------------------------- |
| id            | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| warehousecode | String | Warehouse Code                                                                               |
| number        | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actiondate    | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                             |

#### 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                                                                                   |
| ------------------------------------------ | ---------------------------- | --------------------------------------------------------------------------------------------- |
|                                            | PurchaseOrderProduct (Array) | Product List                                                                                  |
| ∟ 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> |
| ∟ number<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                  |
| {% endtab %} |        |                                       |

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

```json
[
    {
      "sku": "P0001",
      "number": 24
    },
    {
      "productid": 1234,
      "number": 25
    }
]
```

{% endtab %}
{% endtabs %}

## Edit Purchase Order Info

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

Edit purchase order info.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                                       |
| ------------------ | -------------- | ------------------------------------------------- |
| number             | String         | Purchase Order Number                             |
| purchaseorderdate  | String         | <p>Purchase Order Date</p><p>Ex. “2021-09-15”</p> |
| shippingdate       | String         | <p>Shipping Date</p><p>Ex. “2021-09-15”</p>       |
| customeraddress    | String         | Contact Address                                   |
| customerphone      | String         | Contact Phone                                     |
| customeremail      | String         | Contact Email                                     |
| customeridnumber   | String         | Contact ID Number/Tax ID                          |
| customername       | String         | Contact Name                                      |
| tag                | String (Array) | Tag List (Array)                                  |
| description        | String         | Description                                       |
| customercode       | String         | Contact Code                                      |
| customerbranchname | String         | Contact Branch Name                               |
| customerbranchno   | String         | Contact Branch No                                 |
| reference          | String         | Reference                                         |

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

<table><thead><tr><th>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 %}

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

```json
{
  "number": "PO-0001",
  "purchaseorderdate": "2021-05-31"
}
```

{% endtab %}
{% endtabs %}

## Edit Purchase Order

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

Edit purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number                                             | String                       | Purchase Order Number                                                                                                                                                                                                                                                            |
| purchaseorderdate                                  | String                       | <p>Purchase Order Date</p><p>Ex. “2021-09-15”</p>                                                                                                                                                                                                                                |
| shippingdate                                       | String                       | <p>Shipping Date</p><p>Ex. “2021-09-15”</p>                                                                                                                                                                                                                                      |
| customerbranchno                                   | String                       | Contact Branch No                                                                                                                                                                                                                                                                |
| customerbranchname                                 | String                       | Contact Branch Name                                                                                                                                                                                                                                                              |
| customeraddress                                    | String                       | Contact Address                                                                                                                                                                                                                                                                  |
| customerphone                                      | String                       | Contact Phone                                                                                                                                                                                                                                                                    |
| customeremail                                      | String                       | Contact Email                                                                                                                                                                                                                                                                    |
| customeridnumber                                   | String                       | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| customername                                       | String                       | Contact Name                                                                                                                                                                                                                                                                     |
| customercode                                       | String                       | Contact Code                                                                                                                                                                                                                                                                     |
| tag                                                | String (Array)               | Tag List (Array)                                                                                                                                                                                                                                                                 |
| description                                        | String                       | Description                                                                                                                                                                                                                                                                      |
| reference                                          | String                       | Reference                                                                                                                                                                                                                                                                        |
| discount                                           | String                       | <p>Discount <br>Ex.5.00, 10%</p>                                                                                                                                                                                                                                                 |
| vattype                                            | Int                          | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| vatamount                                          | Double                       | Vat Amount                                                                                                                                                                                                                                                                       |
| amount<mark style="color:red;">\*</mark>           | Double                       | Net Amount                                                                                                                                                                                                                                                                       |
| list                                               | PurchaseOrderProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| ∟ sku<mark style="color:red;">\*</mark>            | String                       | Product Sku                                                                                                                                                                                                                                                                      |
| ∟ name<mark style="color:red;">\*</mark>           | String                       | Product Name                                                                                                                                                                                                                                                                     |
| ∟ number<mark style="color:red;">\*</mark>         | Double                       | Product Quantity                                                                                                                                                                                                                                                                 |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double                       | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ discount                                         | String                       | Discount Per Unit                                                                                                                                                                                                                                                                |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                       | Total Price                                                                                                                                                                                                                                                                      |
| ∟ vat\_status                                      | Int                          | <p>Purchase vat status <br>0 - Follow Vat Type in Purchase (Default) </p><p>1 - No Vat </p><p>2- Have Vat<br>Remark: Only Merchant With Addon "Advance Vat".</p>                                                                                                                 |
| shippingvat                                        | Int                          | <p>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</p>                                                                                                                                                                                           |
| shippingamount                                     | Double                       | Shipping Amount                                                                                                                                                                                                                                                                  |

{% 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
{
  "number": "PO-0001",
  "purchaseorderdate": "2021-05-31",
  "amount": 58,
  "vatamount": 0,
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": 24,
      "pricepernumber": 2,
      "discount": "0",
      "totalprice": 48
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": 1,
      "pricepernumber": 10,
      "discount": "0",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Void Purchase Order&#x20;

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

Void purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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>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 %}

## Void Purchase Order Payment

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

Delete payment in purchase order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                  |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| id                                          | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| paymentid<mark style="color:red;">\*</mark> | Int    | Payment ID                                                                                   |
| number                                      | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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="156.21881667088084">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 %}

## Update Purchase Order Serial No

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

Update serial number of purchase order.

#### Query Parameters

| Name                                       | Type   | Description                                                                                          |
| ------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------- |
| id                                         | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                                       |
| serialno<mark style="color:red;">\*</mark> | String | Serial Number                                                                                        |
| sku                                        | String | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p><p></p> |
| productid                                  | Int    | <p>Product ID</p><p>\*Must have either productid or sku</p>                                          |
| number                                     | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>         |

#### 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 %} |        |                                       |

## Update Purchase Order Expiry/Lot

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

Update expiry/lot of purchase order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                   |
| ------------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| id                                          | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                                |
| expiredate                                  | String | Expired Date of Lot (yyyy-MM-dd)                                                              |
| lotnumber<mark style="color:red;">\*</mark> | Double | Lot Number                                                                                    |
| lot<mark style="color:red;">\*</mark>       | String | Lot Name                                                                                      |
| sku                                         | String | <p>Product Sku Require if productid = 0 or null</p><p>\*Must have either productid or sku</p> |
| productid                                   | Int    | <p>Product ID</p><p>\*Must have either productid or sku</p>                                   |
| number                                      | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>  |

#### 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 %} |        |                                       |

## Add Expense Purchase Order

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

Add expense to purchase order.

#### Query Parameters

| Name                                 | Type | Description       |
| ------------------------------------ | ---- | ----------------- |
| id<mark style="color:red;">\*</mark> | Int  | Purchase Order 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<mark style="color:red;">\*</mark>        | String | Expense Name                                                    |
| paymentname<mark style="color:red;">\*</mark> | String | Payment Method                                                  |
| amount<mark style="color:red;">\*</mark>      | Double | Amount                                                          |
| isvat                                         | Int    | <p>Vat Status<br>0 - No Vat (Default)</p><p>1 - Include Vat</p> |

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

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

## Add Purchase Order Tag

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

Add tag to purchase order.

#### Query Parameters

| Name                                  | Type   | Description                                                                                  |
| ------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                          |
| number                                | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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>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 %}

## Delete Purchase Order Tag

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

Delete tag of purchase order.

#### Query Parameters

| Name                                  | Type   | Description                                                                                  |
| ------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                          |
| number                                | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |


# Return Order

## Get Return Orders

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

Get list of return orders.

#### Query Parameters

| Name                  | Type   | Description                                              |
| --------------------- | ------ | -------------------------------------------------------- |
| returnorderdateafter  | String | <p>Return Order Date After …..<br>(yyyy-MM-dd)</p>       |
| returnorderdatebefore | String | <p>Return Order Date Before …..<br>(yyyy-MM-dd)</p>      |
| fromamount            | Double | Minimum amount                                           |
| updatedatetimeafter   | String | <p>Updated Datetime After …..<br>(yyyy-MM-dd HH:mm)</p>  |
| updatedatetimebefore  | String | <p>Updated Datetime Before …..<br>(yyyy-MM-dd HH:mm)</p> |
| createdatetimeafter   | String | <p>Created Datetime After …..<br>(yyyy-MM-dd HH:mm)</p>  |
| createdatetimebefore  | String | <p>Created Datetime Before …..<br>(yyyy-MM-dd HH:mm)</p> |
| paymentafter          | String | <p>Paid Date After …..<br>(yyyy-MM-dd)</p>               |
| paymentbefore         | String | <p>Paid Date Before …..<br>(yyyy-MM-dd)</p>              |
| updatedafter          | String | <p>Updated Date After …..<br>(yyyy-MM-dd)</p>            |
| updatedbefore         | String | <p>Updated Date Before …..<br>(yyyy-MM-dd)</p>           |
| createdafter          | String | <p>Created Date After …..<br>(yyyy-MM-dd)</p>            |
| createdbefore         | String | <p>Created Date Before …..<br>(yyyy-MM-dd)</p>           |
| keyword               | String | Keyword to search                                        |
| createusername        | String | Created by (Username)                                    |
| warehousecode         | String | Warehouse Code                                           |
| topaymentamount       | Double | Maximum payment amount                                   |
| frompaymentamount     | Double | Minimum payment amount                                   |
| toamount              | Double | Maximum amount                                           |
| referenceid           | Int    | Reference Order ID                                       |
| referencenumber       | String | Reference Order Number                                   |
| limit                 | Int    | Limit per page (Max = 500)                               |
| page                  | Int    | Page (Default = 1)                                       |

#### 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                                                        |
| numberlist                                   | String | <p>List Of Return Order Number <br>Ex. “CN-001,CN-002,CN-003”</p> |
| returnorderidlist                            | String | <p>List Of Return Order ID <br>Ex. “123,124,125”</p>              |

{% 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>res</td><td>Response</td><td>Response Code <br>200- Success</td></tr><tr><td>list</td><td>ReturnOrder (Array)</td><td>Return Order List (Array)</td></tr><tr><td>count</td><td>Int</td><td>Total return order number by filter</td></tr><tr><td>totalAmount</td><td>Double</td><td>Total amount by filter</td></tr><tr><td>totalPaymentAmount</td><td>Double</td><td>Total payment amount by filter</td></tr></tbody></table>

<table><thead><tr><th width="216.08133086876154">ReturnOrder (Array)</th><th width="150">Type </th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Return Order ID</td></tr><tr><td>number</td><td>String</td><td>Return Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Customer ID</td></tr><tr><td>customercode</td><td>String</td><td>Customer Code</td></tr><tr><td>customername</td><td>String</td><td>Customer Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Customer ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Customer Email</td></tr><tr><td>customerphone</td><td>String</td><td>Customer Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Customer Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Customer Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Customer Branch No</td></tr><tr><td>status</td><td>String</td><td>Status (Pending, Waiting, Shipping, Success, Partial Transfer, Voided)</td></tr><tr><td>paymentstatus</td><td>String</td><td>Payment Status (Pending, Paid, Partial Payment, Excess Payment)</td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td>Double</td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status<br>0 - No Shipping Vat <br>1 - Have Shipping Vat</td></tr><tr><td>trackingno</td><td>String</td><td>Tracking No</td></tr><tr><td>returnorderdate</td><td>Date</td><td>Return Order Date</td></tr><tr><td>returnorderdateString</td><td>String</td><td>Return Order Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex.5.00, 10%</td></tr><tr><td>sellerdiscount</td><td>Double</td><td>Seller Discount</td></tr><tr><td>sellerdiscount_pretax</td><td>Double</td><td>Pretax Seller Discount</td></tr><tr><td>sellerdiscount_vat</td><td>Double</td><td>Seller Discount Vat</td></tr><tr><td>platformdiscount</td><td>Double</td><td>Platform Discount</td></tr><tr><td>platformdiscount_pretax</td><td>Double</td><td>Pretax Platform Discount</td></tr><tr><td>platformdiscount_vat</td><td>Double</td><td>Platform Discount Vat</td></tr><tr><td>voucheramount</td><td>Double</td><td>Subsidized Amount from Marketplace for seller.</td></tr><tr><td>voucheramount_pretax</td><td>Double</td><td>Subsidized Pretax amount from Marketplace for seller.</td></tr><tr><td>voucheramount_vat</td><td>Double</td><td>Subsidized Vat amount from Marketplace for seller.</td></tr><tr><td>shippingVoucher</td><td>Double</td><td>Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_pretax</td><td>Double</td><td>Pretax Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_vat</td><td>Double</td><td>Shipping Voucher Vat</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of return order discount.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax return order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of return order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 –No Vat (Default) <br>2 – Exclude Vat<br>3 –Include Vat</td></tr><tr><td>saleschannel</td><td>String</td><td>Sales Channel</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>ReturnOrderProduct (Array)</td><td>Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>referenceid</td><td>Int</td><td>Reference Order ID</td></tr><tr><td>referencenumber</td><td>String</td><td>Reference Order Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr></tbody></table>

<table><thead><tr><th width="183.8957761593581">ReturnOrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr></tbody></table>

<table><thead><tr><th>Payment (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Payment ID</td></tr><tr><td>name</td><td>String</td><td>Payment Method Name</td></tr><tr><td>amount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>paymentdatetime</td><td>Datetime</td><td>Payment Datetime</td></tr><tr><td>paymentdatetimeString</td><td>String</td><td>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr></tbody></table>
{% endtab %}

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

```
{
   "number":"CN-0001",
   "customername":"CustomerName",
   "status":"Success",
   "amount":"105",
   "vatamount":"0",
   "returnorderdate":"2021-05-20",
   "paymentmethod":"KBANK",
   "paymentamount":"80",
   "list":[
      {
         "sku":"P0001",
         "name":"Product1",
         "number":"5",
         "pricepernumber":"20",
         "discount":"10%",
         "totalprice":"90"
      },
      {
         "sku":"P0002",
         "name":"Product2",
         "number":"3",
         "pricepernumber":"10",
         "discount":"5",
         "totalprice":"15"
      }
   ],
   "referencenumber":"SO-0001"
}
```

{% endtab %}
{% endtabs %}

## Get Return Order Detail

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

Get return order detail

#### Query Parameters

| Name                                 | Type | Description     |
| ------------------------------------ | ---- | --------------- |
| id<mark style="color:red;">\*</mark> | Int  | Return Order 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="184.11576505780658">Parameter </th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Return Order ID</td></tr><tr><td>number</td><td>String</td><td>Return Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Customer ID</td></tr><tr><td>customercode</td><td>String</td><td>Customer Code</td></tr><tr><td>customername</td><td>String</td><td>Customer Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Customer ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Customer Email</td></tr><tr><td>customerphone</td><td>String</td><td>Customer Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Customer Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Customer Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Customer Branch No</td></tr><tr><td>status</td><td>String</td><td>Status (Pending, Waiting, Shipping, Success, Partial Transfer, Voided)</td></tr><tr><td>paymentstatus</td><td>String</td><td>Payment Status (Pending, Paid, Partial Payment, Excess Payment)</td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td>Double</td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status<br>0 - No Shipping Vat <br>1 - Have Shipping Vat</td></tr><tr><td>trackingno</td><td>String</td><td>Tracking No</td></tr><tr><td>returnorderdate</td><td>Date</td><td>Return Order Date</td></tr><tr><td>returnorderdateString</td><td>String</td><td>Return Order Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex.5.00, 10%</td></tr><tr><td>sellerdiscount</td><td>Double</td><td>Seller Discount</td></tr><tr><td>sellerdiscount_pretax</td><td>Double</td><td>Pretax Seller Discount</td></tr><tr><td>sellerdiscount_vat</td><td>Double</td><td>Seller Discount Vat</td></tr><tr><td>platformdiscount</td><td>Double</td><td>Platform Discount</td></tr><tr><td>platformdiscount_pretax</td><td>Double</td><td>Pretax Platform Discount</td></tr><tr><td>platformdiscount_vat</td><td>Double</td><td>Platform Discount Vat</td></tr><tr><td>voucheramount</td><td>Double</td><td>Subsidized Amount from Marketplace for seller.</td></tr><tr><td>voucheramount_pretax</td><td>Double</td><td>Subsidized Pretax amount from Marketplace for seller.</td></tr><tr><td>voucheramount_vat</td><td>Double</td><td>Subsidized Vat amount from Marketplace for seller.</td></tr><tr><td>shippingVoucher</td><td>Double</td><td>Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_pretax</td><td>Double</td><td>Pretax Shipping Voucher Amount</td></tr><tr><td>shippingVoucher_vat</td><td>Double</td><td>Shipping Voucher Vat</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of return order discount.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax return order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of return order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 –No Vat (Default)<br>2 – Exclude Vat <br>3 –Include Vat</td></tr><tr><td>saleschannel</td><td>String</td><td>Sales Channel</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>ReturnOrderProduct (Array)</td><td>Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>referenceid</td><td>Int</td><td>Reference Order ID</td></tr><tr><td>referencenumber</td><td>String</td><td>Reference Order Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr></tbody></table>

<table><thead><tr><th>ReturnOrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr></tbody></table>

<table><thead><tr><th width="185.75190839694653">Payment (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Payment ID</td></tr><tr><td>name</td><td>String</td><td>Payment Method Name</td></tr><tr><td>amount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>paymentdatetime</td><td>Datetime</td><td>Payment Datetime</td></tr><tr><td>paymentdatetimeString</td><td>String</td><td>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Get Movement Return Order Detail

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

Get movement list of products according to each return order.

#### Query Parameters

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

| MovementReturnOrder (Array) | Type                       | Description/Example                              |
| --------------------------- | -------------------------- | ------------------------------------------------ |
| id                          | Int                        | ID                                               |
| list                        | ReturnOrderProduct (Array) | Movement List                                    |
| actionDate                  | Date (Array)               | List of action date                              |
| actionDateString            | String (Array)             | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| returnorderid               | Int                        | Return Order ID                                  |

<table><thead><tr><th>ReturnOrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Get Movement Return Orders

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

Get movement list of products for return orders.

#### Query Parameters

| Name                                         | Type   | Description                            |
| -------------------------------------------- | ------ | -------------------------------------- |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After …..<br>(yyyy-MM-dd)</p>  |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before …..<br>(yyyy-MM-dd)</p> |
| limit                                        | Int    | Limit per page (Max = 500)             |
| page                                         | Int    | Page (Default = 1)                     |
| 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                   |
| --------- | --------------------------- | ------------------------------------- |
| res       | Response                    | <p>Response Code <br>200- Success</p> |
| list      | MovementReturnOrder (Array) | Movement Return Order List (Array)    |
| count     | Int                         | Total movement order number by filter |

| MovementReturnOrder (Array) | Type                       | Description/Example                              |
| --------------------------- | -------------------------- | ------------------------------------------------ |
| id                          | Int                        | ID                                               |
| list                        | ReturnOrderProduct (Array) | Movement List                                    |
| actionDate                  | Date (Array)               | List of action date                              |
| actionDateString            | String (Array)             | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| returnorderid               | Int                        | Return Order ID                                  |

<table><thead><tr><th>ReturnOrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Add Return Order

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

Add return order.

#### 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                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number<mark style="color:red;">\*</mark>           | String                     | Return Order Number                                                                                                                                                                                                                                                              |
| customercode                                       | String                     | Customer Code                                                                                                                                                                                                                                                                    |
| customername                                       | String                     | Customer Name                                                                                                                                                                                                                                                                    |
| customeridnumber                                   | String                     | Customer ID Number/Tax ID                                                                                                                                                                                                                                                        |
| customerphone                                      | String                     | Customer Phone                                                                                                                                                                                                                                                                   |
| customeremail                                      | String                     | Customer Email                                                                                                                                                                                                                                                                   |
| customeraddress                                    | String                     | Customer Address                                                                                                                                                                                                                                                                 |
| customerbranchno                                   | String                     | Customer Branch No                                                                                                                                                                                                                                                               |
| customerbranchname                                 | String                     | Customer Branch Name                                                                                                                                                                                                                                                             |
| paymentmethod                                      | String                     | Payment Method                                                                                                                                                                                                                                                                   |
| returnorderdate                                    | String                     | <p>Return Order Date</p><p>Ex. “2021-09-15”</p>                                                                                                                                                                                                                                  |
| vatamount                                          | Double                     | Vat Amount                                                                                                                                                                                                                                                                       |
| amount <mark style="color:red;">\*</mark>          | Double                     | Net Amount                                                                                                                                                                                                                                                                       |
| status                                             | String                     | <p>Status(Pending,Success) <br>Default – Pending</p>                                                                                                                                                                                                                             |
| reference                                          | String                     | Reference                                                                                                                                                                                                                                                                        |
| paymentamount                                      | Double                     | <p>Payment Amount</p><p>("paymentmethod" must be required.)</p>                                                                                                                                                                                                                  |
| ∟ sku <mark style="color:red;">\*</mark>           | String                     | Product Sku                                                                                                                                                                                                                                                                      |
| list                                               | ReturnOrderProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| warehousecode                                      | String                     | Warehouse Code                                                                                                                                                                                                                                                                   |
| vattype                                            | Int                        | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| discount                                           | String                     | <p>Discount <br>Ex.5.00, 10%</p>                                                                                                                                                                                                                                                 |
| description                                        | String                     | Description                                                                                                                                                                                                                                                                      |
| ∟ name <mark style="color:red;">\*</mark>          | String                     | Product Name                                                                                                                                                                                                                                                                     |
| ∟ number<mark style="color:red;">\*</mark>         | Double                     | Product Quantity                                                                                                                                                                                                                                                                 |
| ∟ totalprice <mark style="color:red;">\*</mark>    | Double                     | Total Price                                                                                                                                                                                                                                                                      |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double                     | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ discount                                         | String                     | Discount Per Unit                                                                                                                                                                                                                                                                |
| referencenumber                                    | String                     | Reference Order Number                                                                                                                                                                                                                                                           |
| referenceid                                        | Int                        | Reference Order ID                                                                                                                                                                                                                                                               |
| shippingvat                                        | Int                        | <p>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</p>                                                                                                                                                                                           |
| shippingamount                                     | Double                     | Shipping Amount                                                                                                                                                                                                                                                                  |
| saleschannel                                       | String                     | Sales Channel                                                                                                                                                                                                                                                                    |

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

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

```json
{
  "number": "CN-0001",
  "customername": "Customer Name",
  "status": "Success",
  "amount": "105",
  "vatamount": "0",
  "returnorderdate": "2021-05-20",
  "paymentmethod": "KBANK",
  "paymentamount": "80",
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": "5",
      "pricepernumber": "20",
      "discount": "10%",
      "totalprice": "90"
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": "3",
      "pricepernumber": "10",
      "discount": "5",
      "totalprice": "15"
    }
  ],
  "referencenumber": "SO-0001"
}
```

{% endtab %}
{% endtabs %}

## Update Return Order Status

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

Update status of return order.

#### Query Parameters

| Name          | Type   | Description                                                                                |
| ------------- | ------ | ------------------------------------------------------------------------------------------ |
| id            | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| status        | Int    | <p>1 = Success (Default) <br>3 = Waiting <br>6 = Shipping</p>                              |
| warehousecode | String | Warehouse Code                                                                             |
| number        | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actionDate    | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                           |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Secret  |
| 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 %} |        |                                       |

## Update Return Order Payment

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

Update payment of return order.

#### Query Parameters

| Name                                            | Type   | Description                                                                                |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| id                                              | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                         |
| paymentamount<mark style="color:red;">\*</mark> | Double | Payment Amount                                                                             |
| paymentmethod<mark style="color:red;">\*</mark> | String | Payment Method                                                                             |
| number                                          | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Void Return Order&#x20;

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

Void return order.

#### Query Parameters

| Name   | Type   | Description                                                                                |
| ------ | ------ | ------------------------------------------------------------------------------------------ |
| id     | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Void Return Order Payment

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

Delete payment in return order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| id                                          | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| number                                      | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| paymentid<mark style="color:red;">\*</mark> | Int    | Payment 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 %} |        |                                       |

## Add Return Order Tag

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

Add tag to return order.

#### Query Parameters

| Name                                  | Type   | Description                                                                                |
| ------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| id                                    | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| number                                | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                        |

#### 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 Return Order Tag

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

Delete tag of return order.

#### Query Parameters

| Name                                  | Type   | Description                                                                                |
| ------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| id                                    | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                        |
| number                                | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |


# Return Purchase Order

## Get Return Purchase Orders

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

Get list of return purchase orders.

#### Query Parameters

| Name                          | Type   | Description                                                    |
| ----------------------------- | ------ | -------------------------------------------------------------- |
| returnpurchaseorderdateafter  | String | <p>Return Purchase Order Date After .....<br>(yyyy-MM-dd)</p>  |
| returnpurchaseorderdatebefore | String | <p>Return Purchase Order Date Before .....<br>(yyyy-MM-dd)</p> |
| topaymentamount               | Double | Maximum payment amount                                         |
| frompaymentamount             | Double | Minimum payment amount                                         |
| toamount                      | Double | Maximum amount                                                 |
| fromamount                    | Double | Minimum amount                                                 |
| updatedatetimeafter           | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>      |
| updatedatetimebefore          | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>     |
| createdatetimeafter           | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>      |
| createdatetimebefore          | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>     |
| paymentafter                  | String | <p>Paid Date After .....<br>(yyyy-MM-dd)</p>                   |
| paymentbefore                 | String | <p>Paid Date Before .....<br>(yyyy-MM-dd)</p>                  |
| updatedafter                  | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>                |
| updatedbefore                 | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>               |
| createdafter                  | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>                |
| createdbefore                 | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>               |
| limit                         | Int    | Limit per page (Max = 500)                                     |
| page                          | Int    | Page (Default = 1)                                             |
| keyword                       | String | Keyword to search                                              |
| createusername                | String | Created by (Username)                                          |
| 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                                                      |
| returnpurchaseorderidlist                   | String | List Of Return Purchase Order ID Ex. “123,124,125”              |
| numberlist                                  | String | List Of Return Purchase Order Number Ex. “DN-001,DN-002,DN-003” |

{% 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>res</td><td>Response</td><td>Response Code <br>200- Success</td></tr><tr><td>list</td><td>ReturnPurchaseOrder (Array)</td><td>Return Purchase Order List (Array)</td></tr><tr><td>count</td><td>Int</td><td>Total return purchase order number by filter</td></tr><tr><td>totalAmount</td><td>Double</td><td>Total amount by filter</td></tr><tr><td>totalPaymentAmount</td><td>Double</td><td>Total payment amount by filter</td></tr></tbody></table>

<table><thead><tr><th width="166.38324777353165">ReturnPurchaseOrder (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Return Purchase Order ID</td></tr><tr><td>number</td><td>String</td><td>Return Purchase Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Contact ID</td></tr><tr><td>customercode</td><td>String</td><td>Contact Code</td></tr><tr><td>customername</td><td>String</td><td>Contact Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Contact ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Contact Email</td></tr><tr><td>customerphone</td><td>String</td><td>Contact Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Contact Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Contact Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Contact Branch No</td></tr><tr><td>status</td><td>String</td><td><p>Status (Pending,</p><p>Waiting, Shipping, Success, Partial Transfer, Voided)</p></td></tr><tr><td>paymentstatus</td><td>String</td><td>Payment Status (Pending, Paid, Partial Payment, Excess Payment)</td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td></td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status <br>0 - No Shipping Vat <br>1 - Have Shipping Vat</td></tr><tr><td>returnpurchaseorderdate</td><td>Date</td><td>Return Purchase Order Date</td></tr><tr><td>returnpurchaseorderdateString</td><td>String</td><td>Return Purchase Order Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex.5.00, 10%</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of return purchase order discount.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax return purchase order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of return purchase order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat <br>3 – Include Vat</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>ReturnPurchaseOrderProduct (Array)</td><td>Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>referenceid</td><td>Int</td><td>Reference Purchase Order ID</td></tr><tr><td>referencenumber</td><td>String</td><td>Reference Purchase Order Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr></tbody></table>

<table><thead><tr><th width="221.55578110023964">ReturnPurchaseOrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr></tbody></table>

<table><thead><tr><th width="235.92198438788907">Payment (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Payment ID</td></tr><tr><td>name</td><td>String</td><td>Payment Method Name</td></tr><tr><td>amount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>paymentdatetime</td><td>Datetime</td><td>Payment Datetime</td></tr><tr><td>paymentdatetimeString</td><td>String</td><td>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Get Return Purchase Order Detail

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

Get return purchase order detail.

#### Query Parameters

| Name                                 | Type | Description              |
| ------------------------------------ | ---- | ------------------------ |
| id<mark style="color:red;">\*</mark> | Int  | Return Purchase Order 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="207.33333333333331">Parameter</th><th>Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Return Purchase Order ID</td></tr><tr><td>number</td><td>String</td><td>Return Purchase Order Number</td></tr><tr><td>customerid</td><td>Int</td><td>Contact ID</td></tr><tr><td>customercode</td><td>String</td><td>Contact Code</td></tr><tr><td>customername</td><td>String</td><td>Contact Name</td></tr><tr><td>customeridnumber</td><td>String</td><td>Contact ID Number/Tax ID</td></tr><tr><td>customeremail</td><td>String</td><td>Contact Email</td></tr><tr><td>customerphone</td><td>String</td><td>Contact Phone</td></tr><tr><td>customeraddress</td><td>String</td><td>Contact Address</td></tr><tr><td>customerbranchname</td><td>String</td><td>Contact Branch Name</td></tr><tr><td>customerbranchno</td><td>String</td><td>Contact Branch No</td></tr><tr><td>status</td><td>String</td><td><p>Status (Pending,</p><p>Waiting, Shipping, Success, Partial Transfer, Voided)</p></td></tr><tr><td>paymentstatus</td><td>String</td><td>Payment Status (Pending, Paid, Partial Payment, Excess Payment)</td></tr><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>amount_pretax</td><td></td><td>Pretax Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping Amount</td></tr><tr><td>shippingamount_pretax</td><td>Double</td><td>Pretax Shipping Amount</td></tr><tr><td>shippingamount_vat</td><td>Double</td><td>Shipping Vat Amount</td></tr><tr><td>shippingvat</td><td>Int</td><td>Shipping Vat Status <br>0 - No Shipping Vat <br>1 - Have Shipping Vat</td></tr><tr><td>returnpurchaseorderdate</td><td>Date</td><td>Return Purchase Order Date</td></tr><tr><td>returnpurchaseorderdateString</td><td>String</td><td>Return Purchase Order Date Text <br>(yyyy-MM-dd)</td></tr><tr><td>paymentamount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>reference</td><td>String</td><td>Reference</td></tr><tr><td>description</td><td>String</td><td>Description</td></tr><tr><td>discount</td><td>String</td><td>Discount <br>Ex.5.00, 10%</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of return purchase order discount.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total summary of pretax return purchase order discount.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total summary of return purchase order vat.</td></tr><tr><td>vattype</td><td>Int</td><td>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat <br>3 – Include Vat</td></tr><tr><td>warehousecode</td><td>String</td><td>Warehouse Code</td></tr><tr><td>list</td><td>ReturnPurchaseOrderProduct (Array)</td><td>Product List</td></tr><tr><td>payments</td><td>Payment (Array)</td><td>Payment List</td></tr><tr><td>tag</td><td>String (Array)</td><td>Tag List (Array)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetime String</td><td>String</td><td>Created Datetime Text (yyyy-MM-dd HH:mm)</td></tr><tr><td>updatedatetime</td><td>Datetime</td><td>Updated Datetime</td></tr><tr><td>updatedatetimeString</td><td>String</td><td>Updated Datetime Text (yyyy-MM-dd HH:mm)</td></tr><tr><td>createuserid</td><td>Int</td><td>Created User ID</td></tr><tr><td>createusername</td><td>String</td><td>Created User (Username)</td></tr><tr><td>createdby</td><td>String</td><td>Created User (Display name)</td></tr><tr><td>referenceid</td><td>Int</td><td>Reference Purchase Order ID</td></tr><tr><td>referencenumber</td><td>String</td><td>Reference Purchase Order Number</td></tr><tr><td>currency</td><td>String</td><td>Currency</td></tr></tbody></table>

<table><thead><tr><th width="256.1492570884217">ReturnPurchaseOrderProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr></tbody></table>

<table><thead><tr><th width="211.03517943691122">Payment (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Payment ID</td></tr><tr><td>name</td><td>String</td><td>Payment Method Name</td></tr><tr><td>amount</td><td>Double</td><td>Payment Amount</td></tr><tr><td>paymentdatetime</td><td>Datetime</td><td>Payment Datetime</td></tr><tr><td>paymentdatetimeString</td><td>String</td><td>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Get Movement Return Purchase Order Detail

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

Get movement list of products according to each return purchase order.

#### Query Parameters

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

| MovementReturnPurchaseOrder (Array) | Type                               | Description/Example                              |
| ----------------------------------- | ---------------------------------- | ------------------------------------------------ |
| id                                  | Int                                | ID                                               |
| list                                | ReturnPurchaseOrderProduct (Array) | Movement List                                    |
| actionDate                          | Date (Array)                       | List of action date                              |
| actionDateString                    | String (Array)                     | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| returnpurchaseorderid               | Int                                | Return Purchase Order ID                         |

| ReturnPurchaseOrderProduct (Array) | Type   | Description/Example    |
| ---------------------------------- | ------ | ---------------------- |
| productid                          | Int    | Product ID             |
| sku                                | String | Product Sku            |
| name                               | String | Product Name           |
| number                             | Double | Product Quantity       |
| unittext                           | String | Unit                   |
| pricepernumber                     | Double | Product Price/Quantity |
| discount                           | String | Discount Per Unit      |
| totalprice                         | Double | Total Price            |
| {% endtab %}                       |        |                        |
| {% endtabs %}                      |        |                        |

## Get Movement Return Purchase Orders

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

Get movement list of products for return purchase orders.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| limit                                        | Int    | Limit per page (Max = 500)               |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |

#### 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      | MovementReturnPurchaseOrder (Array) | Movement Return Purchase Order List (Array) |
| count     | Int                                 | Total movement order number by filter       |

| MovementReturnPurchaseOrder (Array) | Type                               | Description/Example                              |
| ----------------------------------- | ---------------------------------- | ------------------------------------------------ |
| id                                  | Int                                | ID                                               |
| list                                | ReturnPurchaseOrderProduct (Array) | Movement List                                    |
| actionDate                          | Date (Array)                       | List of action date                              |
| actionDateString                    | String (Array)                     | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| returnpurchaseorderid               | Int                                | Return Purchase Order ID                         |

| ReturnPurchaseOrderProduct (Array) | Type   | Description/Example    |
| ---------------------------------- | ------ | ---------------------- |
| productid                          | Int    | Product ID             |
| sku                                | String | Product Sku            |
| name                               | String | Product Name           |
| number                             | Double | Product Quantity       |
| unittext                           | String | Unit                   |
| pricepernumber                     | Double | Product Price/Quantity |
| discount                           | String | Discount Per Unit      |
| totalprice                         | Double | Total Price            |
| {% endtab %}                       |        |                        |
| {% endtabs %}                      |        |                        |

## Add Return Purchase Order

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

Add return purchase order.

#### 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                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number<mark style="color:red;">\*</mark>           | String                       | Return Purchase Order Number                                                                                                                                                                                                                                                     |
| vatamount                                          | Double                       | Vat Amount                                                                                                                                                                                                                                                                       |
| amount<mark style="color:red;">\*</mark>           | Double                       | Net Amount                                                                                                                                                                                                                                                                       |
| status                                             | String                       | <p>Status (Pending,Success) <br>Default - Pending</p>                                                                                                                                                                                                                            |
| reference                                          | String                       | Reference                                                                                                                                                                                                                                                                        |
| customercode                                       | String                       | Contact Code                                                                                                                                                                                                                                                                     |
| customername                                       | String                       | Contact Name                                                                                                                                                                                                                                                                     |
| customeridnumber                                   | String                       | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| customerphone                                      | String                       | Contact Phone                                                                                                                                                                                                                                                                    |
| customeremail                                      | String                       | Contact Email                                                                                                                                                                                                                                                                    |
| customeraddress                                    | String                       | Contact Address                                                                                                                                                                                                                                                                  |
| customerbranchno                                   | String                       | Contact Branch No                                                                                                                                                                                                                                                                |
| customerbranchname                                 | String                       | Contact Branch Name                                                                                                                                                                                                                                                              |
| returnpurchaseorderdate                            | String                       | <p>Return Purchase Order Date</p><p>Ex. “2021-09-15”</p>                                                                                                                                                                                                                         |
| warehousecode                                      | String                       | Warehouse Code                                                                                                                                                                                                                                                                   |
| discount                                           | String                       | <p>Discount <br>Ex. 5.00, 10%</p>                                                                                                                                                                                                                                                |
| description                                        | String                       | Description                                                                                                                                                                                                                                                                      |
| paymentamount                                      | Double                       | <p>Payment amount</p><p>("paymentmethod" must be required.)</p>                                                                                                                                                                                                                  |
| paymentmethod                                      | String                       | Payment Method                                                                                                                                                                                                                                                                   |
| list                                               | PurchaseOrderProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| referenceid                                        | Int                          | Reference Purchase Order ID                                                                                                                                                                                                                                                      |
| referencenumber                                    | String                       | Reference Purchase Order Number                                                                                                                                                                                                                                                  |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                       | ∟ Total Price                                                                                                                                                                                                                                                                    |
| ∟ discount                                         | String                       | Discount Per Unit                                                                                                                                                                                                                                                                |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double                       | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ number<mark style="color:red;">\*</mark>         | Double                       | Product Quantity                                                                                                                                                                                                                                                                 |
| ∟ name<mark style="color:red;">\*</mark>           | String                       | Product Name                                                                                                                                                                                                                                                                     |
| ∟ sku<mark style="color:red;">\*</mark>            | String                       | Product Sku                                                                                                                                                                                                                                                                      |
| shippingvat                                        | Int                          | <p>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</p>                                                                                                                                                                                           |
| shippingamount                                     | Double                       | Shipping Amount                                                                                                                                                                                                                                                                  |
| vattype                                            | Int                          | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</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                                |

<table><thead><tr><th>Detail</th><th width="178">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Return Purchase Order ID</td></tr></tbody></table>
{% endtab %}

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

<pre class="language-json"><code class="lang-json"><strong>{
</strong>   "number": "DN-0001",
   "customername": "Customer Name",
   "status": "Success",
   "amount": 105,
   "vatamount": 0,
   "returnpurchaseorderdate": "2021-05- 20",
   "paymentmethod": "KBANK",
   "paymentamount": 80,
   "list":[
      {
         "sku": "P0001",
         "name": "Product1",
         "number": 5,
         "pricepernumber": 20,
         "discount": "10%",
         "totalprice": 90
      },
      {
         "sku": "P0002",
         "name": "Product2",
         "number": 3,
         "pricepernumber": 10,
         "discount": "5",
         "totalprice": 15
      }
   ],
   "referencenumber": "SO-0001"
}
</code></pre>

{% endtab %}
{% endtabs %}

## Update Return Purchase Order Status

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

Update status of return purchase order.

#### Query Parameters

| Name          | Type   | Description                                                                                         |
| ------------- | ------ | --------------------------------------------------------------------------------------------------- |
| id            | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| statu         | Int    | <p>1 = Success (Default) <br>3 = Waiting <br>6 = Shipping</p>                                       |
| warehousecode | String | Warehouse Code                                                                                      |
| number        | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actionDate    | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                                    |

#### 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 %} |        |                                       |

## Update Return Purchase Order Payment

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

Update payment of return purchase order.

#### Query Parameters

| Name                                            | Type   | Description                                                                                         |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| id                                              | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                                  |
| paymentamount<mark style="color:red;">\*</mark> | Double | Payment Amount                                                                                      |
| paymentmethod<mark style="color:red;">\*</mark> | String | Payment Method                                                                                      |
| number                                          | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Void Return Purchase Order&#x20;

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

Void return purchase order.

#### Path Parameters

| Name   | Type   | Description                                                                                         |
| ------ | ------ | --------------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Void Return Purchase Order Payment

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

Delete payment in return purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                         |
| ------ | ------ | --------------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Add Return Purchase Order Tag

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

Add tag to return purchase order.

#### Query Parameters

| Name                                  | Type   | Description                                                                                         |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                                 |
| number                                | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 Return Purchase Order Tag

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

Delete tag of return purchase order.

#### Query Parameters

| Name                                  | Type   | Description                                                                                         |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                                 |
| number                                | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |


# Transfer

## Get Transfers

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

Get list of transfer.

#### Query Parameters

| Name               | Type   | Description                                                                                                               |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| transferdateafter  | String | <p>Transfer Date After .....<br>(yyyy-MM-dd)</p>                                                                          |
| transferdatebefore | String | <p>Transfer Date Before .....<br>(yyyy-MM-dd)</p>                                                                         |
| limit              | Int    | Limit per page (Max = 500)                                                                                                |
| page               | Int    | Page (Default = 1)                                                                                                        |
| transferType       | String | <p>Transfer Type</p><p>- Transfer</p><p>- Initial</p><p>- Adjust</p><p>- Assembly</p><p>- Disassembly</p><p>- Reserve</p> |
| keyword            | String | Keyword to search                                                                                                         |
| warehousecode      | String | Warehouse Code                                                                                                            |
| updatedafter       | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>                                                                           |
| updatedbefore      | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>                                                                          |
| createdafter       | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>                                                                           |
| createdbefore      | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>                                                                          |

#### 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                                                    |
| transferidlist                              | String | <p>Transfer ID List <br>Ex. 1234,5678</p>                     |
| numberlist                                  | String | <p>List Of Transfer Number <br>Ex. “TF-001,TF-002,TF-003”</p> |

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

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

| Transfer (Array)     | Type                    | Description/Example                                                       |
| -------------------- | ----------------------- | ------------------------------------------------------------------------- |
| id                   | Int                     | Transfer ID                                                               |
| transferType         | String                  | Transfer Type (Transfer, Initial, Adjust, Assembly, Disassembly, Reserve) |
| number               | String                  | Transfer Number                                                           |
| status               | String                  | Status (Pending, Success, Partial Transfer)                               |
| transferdate         | Date                    | Transfer Date                                                             |
| transferdateString   | String                  | <p>Transfer Date Text <br>(yyyy-MM-dd)</p>                                |
| reference            | String                  | Reference                                                                 |
| description          | String                  | Description                                                               |
| fromwarehousecode    | String                  | From Warehouse (Code)                                                     |
| towarehousecode      | String                  | To Warehouse (Code)                                                       |
| list                 | TransferProduct (Array) | Product List                                                              |
| createdatetime       | Datetime                | Created Datetime                                                          |
| createdatetimeString | String                  | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                       |
| updatedatetime       | Datetime                | Updated Datetime                                                          |
| updatedatetimeString | String                  | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                       |
| tag                  | String (Array)          | Tag List (Array)                                                          |
| uniquenumber         | String                  | Unique Number                                                             |

<table><thead><tr><th>TransferProduct (Array)</th><th width="150">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>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Get Transfer Detail

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

Get transfer detail

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Transfer 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                                                       |
| -------------------- | ----------------------- | ------------------------------------------------------------------------- |
| id                   | Int                     | Transfer ID                                                               |
| transferType         | String                  | Transfer Type (Transfer, Initial, Adjust, Assembly, Disassembly, Reserve) |
| number               | String                  | Transfer Number                                                           |
| status               | String                  | Status (Pending, Success, Partial Transfer)                               |
| transferdate         | Date                    | Transfer Date                                                             |
| transferdateString   | String                  | <p>Transfer Date Text <br>(yyyy-MM-dd)</p>                                |
| reference            | String                  | Reference                                                                 |
| description          | String                  | Description                                                               |
| fromwarehousecode    | String                  | From Warehouse (Code)                                                     |
| towarehousecode      | String                  | To Warehouse (Code)                                                       |
| list                 | TransferProduct (Array) | Product List                                                              |
| createdatetime       | Datetime                | Created Datetime                                                          |
| createdatetimeString | String                  | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                       |
| updatedatetime       | Datetime                | Updated Datetime                                                          |
| updatedatetimeString | String                  | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                       |
| tag                  | String (Array)          | Tag List (Array)                                                          |
| uniquenumber         | String                  | Unique Number                                                             |

| TransferProduct (Array) | Type   | Description/Example |
| ----------------------- | ------ | ------------------- |
| productid               | Int    | Product ID          |
| sku                     | String | Product Sku         |
| name                    | String | Product Name        |
| number                  | Double | Product Quantity    |
| unittext                | String | Unit                |
| {% endtab %}            |        |                     |
| {% endtabs %}           |        |                     |

## Get Movement Transfer Detail

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

Get movement list of products according to each transfer.

#### Query Parameters

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

| MovementTransfer (Array) | Type                    | Description/Example                              |
| ------------------------ | ----------------------- | ------------------------------------------------ |
| id                       | Int                     | ID                                               |
| list                     | TransferProduct (Array) | Movement List                                    |
| actionDate               | Date (Array)            | List of action date                              |
| actionDateString         | String (Array)          | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| transferid               | Int                     | Transfer ID                                      |

| TransferProduct (Array) | Type   | Description/Example |
| ----------------------- | ------ | ------------------- |
| productid               | Int    | Product ID          |
| sku                     | String | Product Sku         |
| name                    | String | Product Name        |
| number                  | Double | Product Quantity    |
| unittext                | String | Unit                |
| {% endtab %}            |        |                     |
| {% endtabs %}           |        |                     |

## Get Movement Transfers

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

Get movement list of products for transfers.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| limit                                        | Int    | Limit per page (Max = 500)               |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |

#### 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      | MovementTransfer (Array) | Movement Transfer List (Array)        |
| count     | Int                      | Total movement order number by filter |

| MovementTransfer (Array) | Type                    | Description/Example                              |
| ------------------------ | ----------------------- | ------------------------------------------------ |
| id                       | Int                     | ID                                               |
| list                     | TransferProduct (Array) | Movement List                                    |
| actionDate               | Date (Array)            | List of action date                              |
| actionDateString         | String (Array)          | <p>List of action date text <br>(yyyy-MM-dd)</p> |
| transferid               | Int                     | Transfer ID                                      |

| TransferProduct (Array) | Type   | Description/Example |
| ----------------------- | ------ | ------------------- |
| productid               | Int    | Product ID          |
| sku                     | String | Product Sku         |
| name                    | String | Product Name        |
| number                  | Double | Product Quantity    |
| unittext                | String | Unit                |
| {% endtab %}            |        |                     |
| {% endtabs %}           |        |                     |

## Add Transfer

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

Add transfer.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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                                           |
| --------------------------------------------------- | ----------------------- | ----------------------------------------------------- |
| number<mark style="color:red;">\*</mark>            | String                  | Transfer Number                                       |
| towarehousecode<mark style="color:red;">\*</mark>   | String                  | To Warehouse (Code)                                   |
| fromwarehousecode<mark style="color:red;">\*</mark> | String                  | From Warehouse (Code)                                 |
| description                                         | String                  | Description                                           |
| transferdate                                        | String                  | <p>Transfer Date</p><p>Ex. “2021-09-15”</p>           |
| status                                              | String                  | <p>Status (Pending,Success) <br>Default - Pending</p> |
| list                                                | TransferProduct (Array) | Product List                                          |
| ∟ number                                            | Double                  | Product Quantity                                      |
| ∟ name                                              | String                  | Product Name                                          |
| ∟ sku                                               | String                  | Product Sku                                           |
| tag                                                 | String (Array)          | Tag List (Array)                                      |
| reference                                           | String                  | Reference                                             |

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

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

```json
{
  "number": "TF-0001",
  "status": "Success",
  "transferdate": "2021-01- 25",
  "fromwarehousecode": "W0001",
  "towarehousecode": "W0002",
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": "5"
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": "3"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Update Transfer Status

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

Update status of transfer.

#### Query Parameters

| Name       | Type   | Description                                                                            |
| ---------- | ------ | -------------------------------------------------------------------------------------- |
| id         | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| number     | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actionDate | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                       |

#### 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 %} |        |                                       |

## Update Partial Transfer

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

Update partial product of transfer

#### Query Parameters

| Name       | Type   | Description                                                                            |
| ---------- | ------ | -------------------------------------------------------------------------------------- |
| id         | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| number     | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| actiondate | String | <p>Date of product transfer.<br>(yyyy-MM-dd)</p>                                       |

#### 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                                                                                   |
| ------------------------------------------ | ----------------------- | --------------------------------------------------------------------------------------------- |
|                                            | TransferProduct (Array) | Product List                                                                                  |
| ∟ 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> |
| ∟ number<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                  |
| {% endtab %} |        |                                       |

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

```json
[
    {
      "sku": "P0001",
      "number": 24
    },
    {
      "productid": 1234,
      "number": 25
    }
]
```

{% endtab %}
{% endtabs %}

## Edit Transfer

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

Edit transfer.

#### Query Parameters

| Name   | Type   | Description                                                                            |
| ------ | ------ | -------------------------------------------------------------------------------------- |
| id     | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                                 |
| ------------ | ----------------------- | ------------------------------------------- |
| number       | String                  | Transfer Number                             |
| ∟ number     | String                  | Product Quantity                            |
| ∟ name       | String                  | Product Name                                |
| ∟ sku        | String                  | Product Sku                                 |
| list         | TransferProduct (Array) | Product List                                |
| description  | String                  | Description                                 |
| transferdate | String                  | <p>Transfer Date</p><p>Ex. “2021-09-15”</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
{
  "number": "TF-0001",
  "transferdate": "2021-01- 25",
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": "5"
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": "3"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Void Transfer&#x20;

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

Void transfer.

#### Query Parameters

| Name   | Type   | Description                                                                            |
| ------ | ------ | -------------------------------------------------------------------------------------- |
| id     | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |


# Quotation

## Get Quotations

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

Get list of quotations.

#### Query Parameters

| Name                 | Type   | Description                                                |
| -------------------- | ------ | ---------------------------------------------------------- |
| quotationafter       | String | <p>Quotation Date After .....<br>(yyyy-MM-dd)</p>          |
| quotationbefore      | String | <p>Quotation Date Before .....<br>(yyyy-MM-dd)</p>         |
| page                 | Int    | Page (Default = 1)                                         |
| keyword              | String | Keyword to search                                          |
| status               | String | <p>Status<br>0 - Pending<br>1 - Success<br>Ex. "0,1"</p>   |
| createusername       | String | Created by (Username)                                      |
| toamount             | Double | Maximum amount                                             |
| fromamount           | Double | Minimum amount                                             |
| updatedatetimeafter  | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| updatedatetimebefore | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| createdatetimeafter  | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| createdatetimebefore | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| updatedafter         | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>            |
| updatedbefore        | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>           |
| createdafter         | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>            |
| createdbefore        | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>           |
| 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                                                     |
| quotationidlist                             | String | <p>List Of Quotation ID <br>Ex. “123,124,125”</p>              |
| numberlist                                  | String | <p>List Of Quotation Number <br>Ex. “QT-001,QT-002,QT-003”</p> |

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

| Parameter   | Type          | Description/Example                   |
| ----------- | ------------- | ------------------------------------- |
| res         | Response      | <p>Response Code <br>200- Success</p> |
| list        | Order (Array) | Quotation List (Array)                |
| count       | Int           | Total quotation number by filter      |
| totalAmount | Double        | Total amount by filter                |

| Quotation (Array)      | Type                     | Description/Example                                                                        |
| ---------------------- | ------------------------ | ------------------------------------------------------------------------------------------ |
| id                     | Int                      | Quotation ID                                                                               |
| number                 | String                   | Quotation Number                                                                           |
| customerid             | Int                      | Customer ID                                                                                |
| customername           | String                   | Customer Name                                                                              |
| customeridnumber       | String                   | Customer ID Number/Tax ID                                                                  |
| customeremail          | String                   | Customer Email                                                                             |
| customerphone          | String                   | Customer Phone                                                                             |
| customeraddress        | String                   | Customer Address                                                                           |
| customerbranchname     | String                   | Customer Branch Name                                                                       |
| customerbranchno       | String                   | Customer Branch No                                                                         |
| reference              | String                   | Reference                                                                                  |
| status                 | String                   | Status (Pending, Success, Voided)                                                          |
| amount                 | Double                   | Net Amount                                                                                 |
| amount\_pretax         | Double                   | Pretax Amount                                                                              |
| vatamount              | Double                   | Vat Amount                                                                                 |
| shippingamount         | Double                   | Shipping Amount                                                                            |
| shippingamount\_pretax | Double                   | Pretax Shipping Amount                                                                     |
| shippingamount\_vat    | Double                   | Shipping Vat Amount                                                                        |
| shippingvat            | Int                      | <p>Shipping Vat Status<br>0 - No Shipping Vat <br>1 - Have Shipping Vat</p>                |
| quotationdate          | Date                     | Quotation Date                                                                             |
| orderdateString        | String                   | <p>Quotation Date Text <br>(yyyy-MM-dd)</p>                                                |
| description            | String                   | Description                                                                                |
| discount               | String                   | <p>Discount.<br>Discount includes sellerdiscount and platformdiscount.<br>Ex.5.00, 10%</p> |
| discountamount         | Double                   | Total summary of quotation discount.                                                       |
| discountamount\_pretax | Double                   | Total summary of pretax quotation discount.                                                |
| discountamount\_vat    | Double                   | Total summary of quotation vat.                                                            |
| vattype                | Int                      | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p>            |
| saleschannel           | String                   | Sales Channel                                                                              |
| list                   | QuotationProduct (Array) | Product List                                                                               |
| tag                    | String (Array)           | Tag List (Array)                                                                           |
| createdatetime         | DateTime                 | Created Datetime                                                                           |
| createdatetimeString   | String                   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                        |
| updatedatetime         | DateTime                 | Updated Datetime                                                                           |
| updatedatetimeString   | String                   | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                        |
| approvedate            | Date                     | Approved Date                                                                              |
| approvedateString      | String                   | <p>Approved Date Text</p><p>(yyyy-MM-dd)</p>                                               |
| expiredate             | Date                     | Expired Date                                                                               |
| expiredateString       | String                   | <p>Expired Date Text</p><p>(yyyy-MM-dd)</p>                                                |
| createuserid           | Int                      | Created User ID                                                                            |
| createusername         | String                   | Created User (Username)                                                                    |
| createdby              | String                   | Created User (Display name)                                                                |
| uniquenumber           | String                   | Unique Number                                                                              |
| currency               | String                   | Currency                                                                                   |

| Quotation Product (Array) | Type           | Description/Example                    |
| ------------------------- | -------------- | -------------------------------------- |
| productid                 | Int            | Product ID                             |
| sku                       | String         | Product Sku                            |
| name                      | String         | Product Name                           |
| number                    | Double         | Product Quantity                       |
| unittext                  | String         | Unit                                   |
| pricepernumber            | Double         | Product Price/Quantity                 |
| pricepernumber\_pretax    | Double         | Pretax Product Price/Quantity          |
| pricepernumber\_vat       | Double         | Product Vat/Quantity                   |
| discount                  | String         | Discount Per Unit                      |
| discountamount            | Double         | Total discount of product line.        |
| discountamount\_pretax    | Double         | Total pretax discount of product line. |
| discountamount\_vat       | Double         | Total discount vat of product line.    |
| totalprice                | Double         | Total Price                            |
| totalprice\_pretax        | Double         | Pretax Total Price                     |
| totalprice\_vat           | Double         | Total Vat                              |
| bundleid                  | Int (Nullable) | Bundle ID                              |
| bundleitemid              | Int (Nullable) | ID of bundle group in product line.    |
| {% endtab %}              |                |                                        |
| {% endtabs %}             |                |                                        |

## Get Quotation Detail

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

Get quotation detail.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                      | Quotation ID                                                                               |
| number                 | String                   | Quotation Number                                                                           |
| customerid             | Int                      | Customer ID                                                                                |
| customername           | String                   | Customer Name                                                                              |
| customeridnumber       | String                   | Customer ID Number/Tax ID                                                                  |
| customeremail          | String                   | Customer Email                                                                             |
| customerphone          | String                   | Customer Phone                                                                             |
| customeraddress        | String                   | Customer Address                                                                           |
| customerbranchname     | String                   | Customer Branch Name                                                                       |
| customerbranchno       | String                   | Customer Branch No                                                                         |
| reference              | String                   | Reference                                                                                  |
| status                 | String                   | Status (Pending, Success, Voided)                                                          |
| amount                 | Double                   | Net Amount                                                                                 |
| amount\_pretax         | Double                   | Pretax Amount                                                                              |
| vatamount              | Double                   | Vat Amount                                                                                 |
| shippingamount         | Double                   | Shipping Amount                                                                            |
| shippingamount\_pretax | Double                   | Pretax Shipping Amount                                                                     |
| shippingamount\_vat    | Double                   | Shipping Vat Amount                                                                        |
| shippingvat            | Int                      | <p>Shipping Vat Status <br>0 - No Shipping Vat <br>1 - Have Shipping Vat</p>               |
| quotationdate          | Date                     | Quotation Date                                                                             |
| quotationdateString    | String                   | <p>Quotation Date Text</p><p>(yyyy-MM-dd)</p>                                              |
| description            | String                   | Description                                                                                |
| discount               | String                   | <p>Discount.<br>Discount includes sellerdiscount and platformdiscount.<br>Ex.5.00, 10%</p> |
| discountamount         | Double                   | Total summary of quotation discount.                                                       |
| discountamount\_pretax | Double                   | Total summary of pretax quotation discount.                                                |
| discountamount\_vat    | Double                   | Total summary of quotation vat.                                                            |
| vattype                | Int                      | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p>            |
| saleschannel           | String                   | Sales Channel                                                                              |
| list                   | QuotationProduct (Array) | Product List                                                                               |
| tag                    | String (Array)           | Tag List (Array)                                                                           |
| createdatetime         | Datetime                 | Created Datetime                                                                           |
| createdatetimeString   | String                   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                        |
| updatedatetime         | Datetime                 | Updated Datetime                                                                           |
| updatedatetimeString   | String                   | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                        |
| approvedate            | Date                     | Approved Date                                                                              |
| approvedateString      | String                   | <p>Approved Date Text</p><p>(yyyy-MM-dd)</p>                                               |
| expiredate             | Date                     | Expired Date                                                                               |
| expiredateString       | String                   | <p>Expired Date Text</p><p>(yyyy-MM-dd)</p>                                                |
| createuserid           | Int                      | Created User ID                                                                            |
| createusername         | String                   | Created User (Username)                                                                    |
| createdby              | String                   | Created User (Display name)                                                                |
| uniquenumber           | String                   | Unique Number                                                                              |
| currency               | String                   | Currency                                                                                   |

| QuotationProduct (Array) | Type           | Description/Example                    |
| ------------------------ | -------------- | -------------------------------------- |
| productid                | Int            | Product ID                             |
| sku                      | String         | Product Sku                            |
| name                     | String         | Product Name                           |
| number                   | Double         | Product Quantity                       |
| unittext                 | String         | Unit                                   |
| pricepernumber           | Double         | Product Price/Quantity                 |
| pricepernumber\_pretax   | Double         | Pretax Product Price/Quantity          |
| pricepernumber\_vat      | Double         | Product Vat/Quantity                   |
| discount                 | String         | Discount Per Unit                      |
| discountamount           | Double         | Total discount of product line.        |
| discountamount\_pretax   | Double         | Total pretax discount of product line. |
| discountamount\_vat      | Double         | Total discount vat of product line.    |
| totalprice               | Double         | Total Price                            |
| totalprice\_pretax       | Double         | Pretax Total Price                     |
| totalprice\_vat          | Double         | Total Vat                              |
| bundleid                 | Int (Nullable) | Bundle ID                              |
| bundleitemid             | Int (Nullable) | ID of bundle group in product line.    |
| {% endtab %}             |                |                                        |
| {% endtabs %}            |                |                                        |

## Add Quotation

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

Add quotation.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number<mark style="color:red;">\*</mark>           | String                   | Quotation Number                                                                                                                                                                                                                                                                 |
| status                                             | String                   | <p>Status (Pending,Success) <br>Default - Pending</p>                                                                                                                                                                                                                            |
| reference                                          | String                   | Reference                                                                                                                                                                                                                                                                        |
| customername                                       | String                   | Customer Name                                                                                                                                                                                                                                                                    |
| customeridnumber                                   | String                   | Customer ID Number/Tax ID                                                                                                                                                                                                                                                        |
| customerphone                                      | String                   | Customer Phone                                                                                                                                                                                                                                                                   |
| customeremail                                      | String                   | Customer Email                                                                                                                                                                                                                                                                   |
| customeraddress                                    | String                   | Customer Address                                                                                                                                                                                                                                                                 |
| customerbranchno                                   | String                   | Customer Branch No                                                                                                                                                                                                                                                               |
| customerbranchname                                 | String                   | Customer Branch Name                                                                                                                                                                                                                                                             |
| saleschannel                                       | String                   | Sales Channel                                                                                                                                                                                                                                                                    |
| discount                                           | String                   | <p>Discount <br>Ex. 5.00, 10%</p>                                                                                                                                                                                                                                                |
| description                                        | String                   | Description                                                                                                                                                                                                                                                                      |
| quotationdate                                      | Date                     | <p>Quotation Date<br>Ex. "2021-09-15"</p>                                                                                                                                                                                                                                        |
| shippingvat                                        | Int                      | <p>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</p>                                                                                                                                                                                           |
| shippingamount                                     | Double                   | Shipping Amount                                                                                                                                                                                                                                                                  |
| vattype                                            | Int                      | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| vatamount                                          | Double                   | Vat Amount                                                                                                                                                                                                                                                                       |
| amount<mark style="color:red;">\*</mark>           | Double                   | Net Amount                                                                                                                                                                                                                                                                       |
| ∟ sku<mark style="color:red;">\*</mark>            | String                   | Product Sku                                                                                                                                                                                                                                                                      |
| list                                               | QuotationProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                   | Total Price                                                                                                                                                                                                                                                                      |
| ∟ discount                                         | String                   | Discount Per Unit                                                                                                                                                                                                                                                                |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double                   | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ number<mark style="color:red;">\*</mark>         | Double                   | Product Quantity                                                                                                                                                                                                                                                                 |
| ∟ name<mark style="color:red;">\*</mark>           | String                   | Product Name                                                                                                                                                                                                                                                                     |
| tag                                                | String (Array)           | Tag List (Array)                                                                                                                                                                                                                                                                 |

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

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

```json
{
  "number": "QT-0001",
  "quotationdate": "2021-05-31",
  "amount": 68,
  "shippingamount": 10,
  "vatamount": 0,
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": 24,
      "pricepernumber": 2,
      "discount": "0",
      "totalprice": 48
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": 1,
      "pricepernumber": 10,
      "discount": "0",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Approve Quotation

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

Approve quotation.

#### Query Parameters

| Name        | Type   | Description                                                                             |
| ----------- | ------ | --------------------------------------------------------------------------------------- |
| id          | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number      | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| approvedate | String | <p>Approve Date</p><p>(yyyy-MM-dd)</p>                                                  |

#### 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 %} |        |                                       |

## Edit Quotation Info

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

Edit quotation info.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                               |
| ------------------ | -------------- | ----------------------------------------- |
| number             | String         | Quotation Number                          |
| customerphone      | String         | Customer Phone                            |
| customeremail      | String         | Customer Email                            |
| customeridnumber   | String         | Customer ID Number/Tax ID                 |
| customername       | String         | Customer Name                             |
| quotationdate      | String         | <p>Quotation Date<br>Ex. "2021-09-15"</p> |
| reference          | String         | Reference                                 |
| customerbranchno   | String         | Customer Branch No                        |
| customerbranchname | String         | Customer Branch Name                      |
| customeraddress    | String         | Customer Address                          |
| saleschannel       | String         | Sales Channel                             |
| description        | String         | Description                               |
| tag                | String (Array) | Tag List (Array)                          |

{% 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
{
  "number": "QT-0001",
  "quotationdate": "2021-05-31"
}
```

{% endtab %}
{% endtabs %}

## Edit Quotation

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

Edit quotation.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number                                             | String                   | Quotation Number                                                                                                                                                                                                                                                                 |
| customerbranchname                                 | String                   | Customer Branch Name                                                                                                                                                                                                                                                             |
| customeraddress                                    | String                   | Customer Address                                                                                                                                                                                                                                                                 |
| customerphone                                      | String                   | Customer Phone                                                                                                                                                                                                                                                                   |
| customeremail                                      | String                   | Customer Email                                                                                                                                                                                                                                                                   |
| customeridnumber                                   | String                   | Customer ID Number/Tax ID                                                                                                                                                                                                                                                        |
| customername                                       | String                   | Customer Name                                                                                                                                                                                                                                                                    |
| quotationdate                                      | String                   | <p>Quotation Date<br>Ex. "2021-09-15"</p>                                                                                                                                                                                                                                        |
| reference                                          | String                   | Reference                                                                                                                                                                                                                                                                        |
| customerbranchno                                   | String                   | Customer Branch No                                                                                                                                                                                                                                                               |
| saleschannel                                       | String                   | Sales Channel                                                                                                                                                                                                                                                                    |
| description                                        | String                   | Description                                                                                                                                                                                                                                                                      |
| tag                                                | String (Array)           | Tag List (Array)                                                                                                                                                                                                                                                                 |
| vattype                                            | Int                      | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| vatamount                                          | Double                   | Vat Amount                                                                                                                                                                                                                                                                       |
| amount<mark style="color:red;">\*</mark>           | Double                   | Net Amount                                                                                                                                                                                                                                                                       |
| ∟ name<mark style="color:red;">\*</mark>           | String                   | Product Name                                                                                                                                                                                                                                                                     |
| ∟ sku<mark style="color:red;">\*</mark>            | String                   | Product Sku                                                                                                                                                                                                                                                                      |
| list                                               | QuotationProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| discount                                           | String                   | <p>Discount <br>Ex. 5.00, 10%</p>                                                                                                                                                                                                                                                |
| shippingvat                                        | Int                      | <p>Shipping Vat Status <br>0 - No Shipping Vat (Default) <br>1 – Have Shipping Vat</p>                                                                                                                                                                                           |
| shippingamount                                     | Double                   | Shipping Amount                                                                                                                                                                                                                                                                  |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double                   | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ number<mark style="color:red;">\*</mark>         | Double                   | Product Quantity                                                                                                                                                                                                                                                                 |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                   | Total Price                                                                                                                                                                                                                                                                      |
| ∟ discount                                         | String                   | Discount Per Unit                                                                                                                                                                                                                                                                |

{% 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
{
  "number": "QT-0001",
  "quotationdate": "2021-05-31",
  "amount": 68,
  "shippingamount": 10,
  "vatamount": 0,
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": 24,
      "pricepernumber": 2,
      "discount": "0",
      "totalprice": 48
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": 1,
      "pricepernumber": 10,
      "discount": "0",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Void Quotation

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

Void quotation.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Add Quotation Tag

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

Add tag to quotation.

#### Query Parameters

| Name                                  | Type   | Description                                                                             |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                     |
| number                                | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 Quotation Tag

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

Delete tag of quotation.

#### Query Parameters

| Name                                  | Type   | Description                                                                             |
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| id                                    | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| tag<mark style="color:red;">\*</mark> | String | Tag                                                                                     |
| number                                | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |


# Finance

## Get Incomes

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

Get list of incomes.

#### Query Parameters

| Name                 | Type   | Description                                                |
| -------------------- | ------ | ---------------------------------------------------------- |
| incomedateafter      | String | <p>Income Date After .....<br>(yyyy-MM-dd)</p>             |
| incomedatebefore     | String | <p>Income Date Before .....<br>(yyyy-MM-dd)</p>            |
| createdafter         | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>            |
| createdbefore        | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>           |
| updatedafter         | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>            |
| updatedbefore        | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>           |
| paymentafter         | String | <p>Paid Date After .....<br>(yyyy-MM-dd)</p>               |
| page                 | Int    | Page (Default = 1)                                         |
| keyword              | String | Keyword to search                                          |
| updatedatetimebefore | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| updatedatetimeafter  | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| createdatetimebefore | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| createdatetimeafter  | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| paymentbefore        | String | <p>Paid Date Before .....<br>(yyyy-MM-dd)</p>              |
| 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                                     |
| incomeidlist                                | String | <p>List Of Income ID <br>Ex. “123,124,125”</p> |

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

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

| IncomeTransaction (Array) | Type               | Description/Example                                                             |
| ------------------------- | ------------------ | ------------------------------------------------------------------------------- |
| id                        | Int                | Income ID                                                                       |
| contactid                 | Int                | Contact ID                                                                      |
| contactname               | String             | Contact Name                                                                    |
| contactidnumber           | String             | Contact ID Number/Tax ID                                                        |
| contactemail              | String             | Contact Email                                                                   |
| contactphone              | String             | Contact Phone                                                                   |
| contactaddress            | String             | Contact Address                                                                 |
| contactbranchname         | String             | Contact Branch Name                                                             |
| contactbranchno           | String             | Contact Branch No                                                               |
| paymentstatus             | String             | Payment Status (Pending, Paid, Partial Payment, Excess Payment)                 |
| amount                    | Double             | Net Amount                                                                      |
| amount\_pretax            | Double             | Pretax Amount                                                                   |
| vatamount                 | Double             | Vat Amount                                                                      |
| incomedate                | Date               | <p>Income Date<br>(yyyy-MM-dd)</p>                                              |
| incomedateString          | String             | Income Date Text (yyyy-MM-dd)                                                   |
| paymentamount             | Double             | Payment Amount                                                                  |
| reference                 | String             | Reference                                                                       |
| description               | String             | Description                                                                     |
| discount                  | String             | <p>Discount<br>Ex.5.00, 10%</p>                                                 |
| vattype                   | Int                | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p> |
| list                      | IncomeItem (Array) | Item List                                                                       |
| payments                  | Payment (Array)    | Payment List                                                                    |
| tag                       | String (Array)     | Tag List (Array)                                                                |
| createdatetime            | Datetime           | Created Datetime                                                                |
| createdatetimeString      | String             | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                             |
| updatedatetime            | Datetime           | Updated Datetime                                                                |
| updatedatetimeString      | String             | <p>Updated Datetime Text<br>(yyyy-MM-dd HH:mm)</p>                              |
| createuserid              | Int                | Created User ID                                                                 |
| createusername            | String             | Created User (Username)                                                         |
| createdby                 | String             | Created User (Display name)                                                     |
| uniquenumber              | String             | Unique Number                                                                   |

| IncomeItem (Array) | Type   | Description/Example |
| ------------------ | ------ | ------------------- |
| id                 | Int    | Item ID             |
| name               | String | Item Name           |
| categoryname       | String | Item Category       |
| totalprice         | Double | Total Price         |
| totalprice\_pretax | Double | Pretax Total Price  |
| totalprice\_vat    | Double | Total Vat           |

| Payment (Array)       | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Payment ID                                          |
| name                  | String   | Payment Method Name                                 |
| amount                | Double   | Payment Amount                                      |
| paymentdatetime       | Datetime | Payment Datetime                                    |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |
| {% endtab %}          |          |                                                     |
| {% endtabs %}         |          |                                                     |

## Get Income Detail

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

Get income detail.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Income 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                                                             |
| -------------------- | ------------------ | ------------------------------------------------------------------------------- |
| id                   | Int                | Income ID                                                                       |
| contactid            | Int                | Contact ID                                                                      |
| contactname          | String             | Contact Name                                                                    |
| contactidnumber      | String             | Contact ID Number/Tax ID                                                        |
| contactemail         | String             | Contact Email                                                                   |
| contactphone         | String             | Contact Phone                                                                   |
| contactaddress       | String             | Contact Address                                                                 |
| contactbranchname    | String             | Contact Branch Name                                                             |
| contactbranchno      | String             | Contact Branch No                                                               |
| paymentstatus        | String             | Payment Status (Pending, Paid, Partial Payment, Excess Payment)                 |
| amount               | Double             | Net Amount                                                                      |
| amount\_pretax       | Double             | Pretax Amount                                                                   |
| vatamount            | Double             | Vat Amount                                                                      |
| incomedate           | Date               | <p>Income Date Text <br>(yyyy-MM-dd)</p>                                        |
| incomedateString     | String             | Income Date Text (yyyy-MM-dd)                                                   |
| paymentamount        | Double             | Payment Amount                                                                  |
| reference            | String             | Reference                                                                       |
| description          | String             | Description                                                                     |
| discount             | String             | <p>Discount<br>Ex.5.00, 10%</p>                                                 |
| vattype              | Int                | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p> |
| list                 | IncomeItem (Array) | Item List                                                                       |
| payments             | Payment (Array)    | Payment List                                                                    |
| tag                  | String (Array)     | Tag List (Array)                                                                |
| createdatetime       | Datetime           | Created Datetime                                                                |
| createdatetimeString | String             | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                             |
| updatedatetime       | Datetime           | Updated Datetime                                                                |
| updatedatetimeString | String             | <p>Updated Datetime Text<br>(yyyy-MM-dd HH:mm)</p>                              |
| createuserid         | Int                | Created User ID                                                                 |
| createusername       | String             | Created User (Username)                                                         |
| createdby            | String             | Created User (Display name)                                                     |
| uniquenumber         | String             | Unique Number                                                                   |

| IncomeItem (Array) | Type   | Description/Example |
| ------------------ | ------ | ------------------- |
| id                 | Int    | Item ID             |
| name               | String | Item Name           |
| categoryname       | String | Item Category       |
| totalprice         | Double | Total Price         |
| totalprice\_pretax | Double | Pretax Total Price  |
| totalprice\_vat    | Double | Total Vat           |

| Payment (Array)       | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Payment ID                                          |
| name                  | String   | Payment Method Name                                 |
| amount                | Double   | Payment Amount                                      |
| paymentdatetime       | Datetime | Payment Datetime                                    |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |
| {% endtab %}          |          |                                                     |
| {% endtabs %}         |          |                                                     |

## Add Income

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

Add income.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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                                                                                                                                                                                                                                                                      |
| ---------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| contactname                                    | String             | Contact Name                                                                                                                                                                                                                                                                     |
| contactidnumber                                | String             | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| contactphone                                   | String             | Contact Phone                                                                                                                                                                                                                                                                    |
| contactemail                                   | String             | Contact Email                                                                                                                                                                                                                                                                    |
| contactaddress                                 | String             | Contact Address                                                                                                                                                                                                                                                                  |
| customerbranchno                               | String             | Contact Branch No                                                                                                                                                                                                                                                                |
| contactbranchname                              | String             | Contact Branch Name                                                                                                                                                                                                                                                              |
| amount<mark style="color:red;">\*</mark>       | Double             | Net Amount                                                                                                                                                                                                                                                                       |
| vatamount                                      | Double             | Vat Amount                                                                                                                                                                                                                                                                       |
| vattype                                        | Int                | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| incomedate                                     | String             | <p>Income Date<br>Ex. "2021-09-15"</p>                                                                                                                                                                                                                                           |
| paymentmethod                                  | String             | Payment Method                                                                                                                                                                                                                                                                   |
| paymentamount                                  | Double             | <p>Payment Amount</p><p>("paymentmethod" must be required.)</p>                                                                                                                                                                                                                  |
| paymentdate                                    | String             | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                                                                                                                                                                                                               |
| description                                    | String             | Description                                                                                                                                                                                                                                                                      |
| discount                                       | String             | <p>Discount <br>Ex. 5.00, 10%</p>                                                                                                                                                                                                                                                |
| tag                                            | String (Array)     | Tag List (Array)                                                                                                                                                                                                                                                                 |
| list                                           | IncomeItem (Array) | Item List                                                                                                                                                                                                                                                                        |
| ∟ name<mark style="color:red;">\*</mark>       | String             | Item Name                                                                                                                                                                                                                                                                        |
| ∟ categoryname                                 | String             | Item Category                                                                                                                                                                                                                                                                    |
| ∟ totalprice<mark style="color:red;">\*</mark> | Double             | Total Price                                                                                                                                                                                                                                                                      |
| reference                                      | String             | Reference                                                                                                                                                                                                                                                                        |

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

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

```json
{
  "incomedate": "2021-05-31",
  "amount": 58,
  "vatamount": 0,
  "paymentmethod": "Cash",
  "list": [
    {
      "name": "Income1",
      "categoryname": "Others",
      "totalprice": 48
    },
    {
      "name": "Income2",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Update Income Payment

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

Update payment of income.

#### Query Parameters

| Name                                            | Type   | Description                                        |
| ----------------------------------------------- | ------ | -------------------------------------------------- |
| id<mark style="color:red;">\*</mark>            | Int    | Income ID                                          |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p> |
| paymentamount<mark style="color:red;">\*</mark> | Double | Payment Amount                                     |
| paymentmethod<mark style="color:red;">\*</mark> | String | Payment Method                                     |

#### 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 %} |        |                                       |

## Get Expenses

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

Get list of expenses.

#### Query Parameters

| Name                 | Type   | Description                                                |
| -------------------- | ------ | ---------------------------------------------------------- |
| expensedateafter     | String | <p>Expense Date After .....<br>(yyyy-MM-dd)</p>            |
| limit                | Int    | Limit per page (Max = 500)                                 |
| page                 | Int    | Page (Default = 1)                                         |
| keyword              | String | Keyword to search                                          |
| updatedatetimebefore | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| updatedatetimeafter  | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| createdatetimebefore | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| createdatetimeafter  | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| paymentbefore        | String | <p>Paid Date Before .....<br>(yyyy-MM-dd)</p>              |
| paymentafter         | String | <p>Paid Date After .....<br>(yyyy-MM-dd)</p>               |
| updatedbefore        | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>           |
| updatedafter         | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>            |
| createdbefore        | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>           |
| createdafter         | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>            |
| expensedatebefore    | String | <p>Expense Date Before .....<br>(yyyy-MM-dd)</p>           |

#### 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                                      |
| expenseidlist                               | String | <p>List Of Expense ID <br>Ex. “123,124,125”</p> |

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

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

| ExpenseTransaction (Array) | Type                | Description/Example                                                             |
| -------------------------- | ------------------- | ------------------------------------------------------------------------------- |
| id                         | Int                 | Expense ID                                                                      |
| contactid                  | Int                 | Contact ID                                                                      |
| contactname                | String              | Contact Name                                                                    |
| contactidnumber            | String              | Contact ID Number/Tax ID                                                        |
| contactemail               | String              | Contact Email                                                                   |
| contactphone               | String              | Contact Phone                                                                   |
| contactaddress             | String              | Contact Address                                                                 |
| contactbranchname          | String              | Contact Branch Name                                                             |
| contactbranchno            | String              | Contact Branch No                                                               |
| paymentstatus              | String              | Payment Status (Pending, Paid, Partial Payment, Excess Payment)                 |
| amount                     | Double              | Net Amount                                                                      |
| amount\_pretax             | Double              | Pretax Amount                                                                   |
| vatamount                  | Double              | Vat Amount                                                                      |
| expensedate                | Date                | <p>Expense Date Text <br>(yyyy-MM-dd)</p>                                       |
| expensedateString          | String              | Expense Date Text (yyyy-MM-dd)                                                  |
| paymentamount              | Double              | Payment Amount                                                                  |
| reference                  | String              | Reference                                                                       |
| description                | String              | Description                                                                     |
| discount                   | String              | <p>Discount<br>Ex.5.00, 10%</p>                                                 |
| vattype                    | Int                 | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p> |
| list                       | ExpenseItem (Array) | Item List                                                                       |
| payments                   | Payment (Array)     | Payment List                                                                    |
| tag                        | String (Array)      | Tag List (Array)                                                                |
| createdatetime             | Datetime            | Created Datetime                                                                |
| createdatetimeString       | String              | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                             |
| updatedatetime             | Datetime            | Updated Datetime                                                                |
| updatedatetimeString       | String              | <p>Updated Datetime Text<br>(yyyy-MM-dd HH:mm)</p>                              |
| createuserid               | Int                 | Created User ID                                                                 |
| createusername             | String              | Created User (Username)                                                         |
| createdby                  | String              | Created User (Display name)                                                     |
| uniquenumber               | String              | Unique Number                                                                   |

| ExpenseItem (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | Item ID             |
| name                | String | Item Name           |
| categoryname        | String | Item Category       |
| totalprice          | Double | Total Price         |
| totalprice\_pretax  | Double | Pretax Total Price  |
| totalprice\_vat     | Double | Total Vat           |

| Payment (Array)       | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Payment ID                                          |
| name                  | String   | Payment Method Name                                 |
| amount                | Double   | Payment Amount                                      |
| paymentdatetime       | Datetime | Payment Datetime                                    |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |
| {% endtab %}          |          |                                                     |
| {% endtabs %}         |          |                                                     |

## Get Expense Detail

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

Get expense detail.

#### Query Parameters

| Name                                 | Type | Description |
| ------------------------------------ | ---- | ----------- |
| id<mark style="color:red;">\*</mark> | Int  | Expense 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                                                             |
| -------------------- | ------------------- | ------------------------------------------------------------------------------- |
| id                   | Int                 | Expense ID                                                                      |
| contactid            | Int                 | Contact ID                                                                      |
| contactname          | String              | Contact Name                                                                    |
| contactidnumber      | String              | Contact ID Number/Tax ID                                                        |
| contactemail         | String              | Contact Email                                                                   |
| contactphone         | String              | Contact Phone                                                                   |
| contactaddress       | String              | Contact Address                                                                 |
| contactbranchname    | String              | Contact Branch Name                                                             |
| contactbranchno      | String              | Contact Branch No                                                               |
| paymentstatus        | String              | Payment Status (Pending, Paid, Partial Payment, Excess Payment)                 |
| amount               | Double              | Net Amount                                                                      |
| amount\_pretax       | Double              | Pretax Amount                                                                   |
| vatamount            | Double              | Vat Amount                                                                      |
| expensedate          | Date                | Expense Date                                                                    |
| expensedateString    | String              | Expense Date Text (yyyy-MM-dd)                                                  |
| paymentamount        | Double              | Payment Amount                                                                  |
| reference            | String              | Reference                                                                       |
| description          | String              | Description                                                                     |
| discount             | String              | <p>Discount <br>Ex.5.00, 10%</p>                                                |
| vattype              | Int                 | <p>Vat Type <br>1 – No Vat (Default) <br>2 – Exclude Vat<br>3 – Include Vat</p> |
| list                 | ExpenseItem (Array) | Item List                                                                       |
| payments             | Payment (Array)     | Payment List                                                                    |
| tag                  | String (Array)      | Tag List (Array)                                                                |
| createdatetime       | Datetime            | Created Datetime                                                                |
| createdatetimeString | String              | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                             |
| updatedatetime       | Datetime            | Updated Datetime                                                                |
| updatedatetimeString | String              | <p>Updated Datetime Text<br>(yyyy-MM-dd HH:mm)</p>                              |
| createuserid         | Int                 | Created User ID                                                                 |
| createusername       | String              | Created User (Username)                                                         |
| createdby            | String              | Created User (Display name)                                                     |
| uniquenumber         | String              | Unique Number                                                                   |

| ExpenseItem (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | Item ID             |
| name                | String | Item Name           |
| categoryname        | String | Item Category       |
| totalprice          | Double | Total Price         |
| totalprice\_pretax  | Double | Pretax Total Price  |
| totalprice\_vat     | Double | Total Vat           |

| Payment (Array)       | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Payment ID                                          |
| name                  | String   | Payment Method Name                                 |
| amount                | Double   | Payment Amount                                      |
| paymentdatetime       | Datetime | Payment Datetime                                    |
| paymentdatetimeString | String   | <p>Payment Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |
| {% endtab %}          |          |                                                     |
| {% endtabs %}         |          |                                                     |

## Add Expense

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

Add expense.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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                                                                                                                                                                                                                                                                      |
| ---------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| contactname                                    | String              | Contact Name                                                                                                                                                                                                                                                                     |
| contactidnumber                                | String              | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| contactphone                                   | String              | Contact Phone                                                                                                                                                                                                                                                                    |
| contactemail                                   | String              | Contact Email                                                                                                                                                                                                                                                                    |
| contactaddress                                 | String              | Contact Address                                                                                                                                                                                                                                                                  |
| contactbranchno                                | String              | Contact Branch No                                                                                                                                                                                                                                                                |
| contactbranchname                              | String              | Contact Branch Name                                                                                                                                                                                                                                                              |
| paymentamount                                  | Double              | <p>Payment Amount</p><p>("paymentmethod" must be required.)</p>                                                                                                                                                                                                                  |
| paymentmethod                                  | String              | Payment Method                                                                                                                                                                                                                                                                   |
| expensedate                                    | String              | <p>Expense Date<br>Ex. "2021-09-15"</p>                                                                                                                                                                                                                                          |
| vattype                                        | Int                 | <p>Vat Type <br>1 – No Vat<br>2 – Exclude Vat<br>3 – Include Vat<br>If vattype is not defined, the system will use vatamount to calculate and define automatically.<br>If vattype = 1, 2 or 3, the system will ignore vatamount and calculate vatamount value automatically.</p> |
| vatamount                                      | Double              | Vat Amount                                                                                                                                                                                                                                                                       |
| amount<mark style="color:red;">\*</mark>       | Double              | Net Amount                                                                                                                                                                                                                                                                       |
| ∟ name<mark style="color:red;">\*</mark>       | String              | Item Name                                                                                                                                                                                                                                                                        |
| list                                           | ExpenseItem (Array) | Item List                                                                                                                                                                                                                                                                        |
| tag                                            | String (Array)      | Tag List (Array)                                                                                                                                                                                                                                                                 |
| discount                                       | String              | <p>Discount <br>Ex. 5.00, 10%</p>                                                                                                                                                                                                                                                |
| description                                    | String              | Description                                                                                                                                                                                                                                                                      |
| paymentdate                                    | String              | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                                                                                                                                                                                                               |
| ∟ categoryname                                 | String              | Item Category                                                                                                                                                                                                                                                                    |
| ∟ totalprice<mark style="color:red;">\*</mark> | Double              | Total Price                                                                                                                                                                                                                                                                      |
| reference                                      | String              | Reference                                                                                                                                                                                                                                                                        |

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

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

```json
{
  "expensedate": "2021-05-31",
  "amount": 58,
  "vatamount": 0,
  "paymentmethod": "Cash",
  "list": [
    {
      "name": "Income1",
      "categoryname": "Others",
      "totalprice": 48
    },
    {
      "name": "Income2",
      "totalprice": 10
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Update Expense Payment

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

Update payment of expense.

#### Query Parameters

| Name                                            | Type   | Description                                        |
| ----------------------------------------------- | ------ | -------------------------------------------------- |
| id<mark style="color:red;">\*</mark>            | Int    | Expense ID                                         |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p> |
| paymentamount<mark style="color:red;">\*</mark> | Double | Payment Amount                                     |
| paymentmethod<mark style="color:red;">\*</mark> | String | Payment Method                                     |

#### 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 %} |        |                                       |

## Get Money Transfers

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

Get list of money transfer.

#### Query Parameters

| Name                 | Type   | Description                                                |
| -------------------- | ------ | ---------------------------------------------------------- |
| dateafter            | String | <p>Date After .....<br>(yyyy-MM-dd)</p>                    |
| page                 | Int    | Page (Default = 1)                                         |
| keyword              | String | Keyword to search                                          |
| createdatetimebefore | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p> |
| createdatetimeafter  | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>  |
| datebefore           | String | <p>Date Before .....<br>(yyyy-MM-dd)</p>                   |
| 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                                             |
| moneytransferidlist                         | String | <p>List Of Money Transfer ID <br>Ex. “123,124,125”</p> |

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

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

| Money Transfer (Array) | Type     | Description/Example                                 |
| ---------------------- | -------- | --------------------------------------------------- |
| id                     | Int      | Money Transfer ID                                   |
| status                 | String   | <p>Status </p><p>(Success, Voided)</p>              |
| amount                 | Double   | Amount                                              |
| actiondate             | Date     | <p>Date<br>(yyyy-MM-dd)</p>                         |
| actiondateString       | String   | <p>Date Text </p><p>(yyyy-MM-dd)</p>                |
| fromPaymentMethodId    | Int      | Payment Method ID for transferring money            |
| fromPaymentMethodName  | String   | Payment Method Name for transferring money          |
| toPaymentMethodId      | Int      | Payment Method ID for receiving money               |
| toPaymentMethodName    | String   | Payment Method Name for receiving money             |
| reference              | String   | Reference                                           |
| description            | String   | Description                                         |
| createdatetime         | Datetime | Created Datetime                                    |
| createdatetimeString   | String   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |
| createuserid           | Int      | Created User ID                                     |
| createusername         | String   | Created User (Username)                             |
| createdby              | String   | Created User (Display name)                         |
| uniquenumber           | String   | Unique Number                                       |
| {% endtab %}           |          |                                                     |
| {% endtabs %}          |          |                                                     |

## Get Money Transfer Detail

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

Get money transfer detail.

#### Query Parameters

| Name                                 | Type | Description       |
| ------------------------------------ | ---- | ----------------- |
| id<mark style="color:red;">\*</mark> | Int  | Money Transfer 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                   |
| --------- | --------------------- | ------------------------------------- |
| res       | Response              | <p>Response Code <br>200- Success</p> |
| list      | MoneyTransfer (Array) | Money Transfer List (Array)           |
| count     | Int                   | Total money transfer number by filter |

| MoneyTransfer (Array) | Type     | Description/Example                                 |
| --------------------- | -------- | --------------------------------------------------- |
| id                    | Int      | Money Transfer ID                                   |
| status                | String   | Status (Success, Voided)                            |
| amount                | Double   | Amount                                              |
| actiondate            | Date     | <p>Date<br>(yyyy-MM-dd)</p>                         |
| actiondateString      | String   | <p>Date Text <br>(yyyy-MM-dd)</p>                   |
| fromPaymentMethodId   | Int      | Payment Method ID for transferring money            |
| fromPaymentMethodName | String   | Payment Method Name for transferring money          |
| toPaymentMethodId     | Int      | Payment Method ID for receiving money               |
| toPaymentMethodName   | String   | Payment Method Name for receiving money             |
| reference             | String   | Reference                                           |
| description           | String   | Description                                         |
| createdatetime        | Datetime | Created Datetime                                    |
| createdatetimeString  | String   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p> |
| createuserid          | Int      | Created User ID                                     |
| createusername        | String   | Created User (Username)                             |
| createdby             | String   | Created User (Display name)                         |
| uniquenumber          | String   | Unique Number                                       |
| {% endtab %}          |          |                                                     |
| {% endtabs %}         |          |                                                     |

## Add Money Transfer.

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

Add money transfer.

#### Query Parameters

| Name         | Type   | Description                                                                                 |
| ------------ | ------ | ------------------------------------------------------------------------------------------- |
| uniquenumber | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |

#### 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 %} |        |                                       |

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

```json
{
    "fromPaymentMethodName": "Cash",
    "toPaymentMethodName": "Credit Card",
    "amount": 100,
    "reference": "Test Reference",
    "actiondate": "2023-08-07",
    "description": "Test Description"
}
```

{% endtab %}
{% endtabs %}


# File Upload

## Get Order Files

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

Get list of files in order.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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" %}

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |
| {% endtab %}        |        |                     |
| {% endtabs %}       |        |                     |

## Get Order File Detail

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

Get file detail and binary data of order.

#### Query Parameters

| Name                                     | Type   | Description                                                                         |
| ---------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| id                                       | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number                                   | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| fileid<mark style="color:red;">\*</mark> | Int    | File 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 |
| ------------- | ------ | ------------------- |
| id            | Int    | File ID             |
| content       | String | Base64 Encode Data  |
| fileName      | String | File Name           |
| type          | String | File Type           |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add File to Order

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

Add file to order.

#### Query Parameters

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| id     | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Get Purchase Order Files

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

Get list of files in purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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" %}

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |
| {% endtab %}        |        |                     |
| {% endtabs %}       |        |                     |

## Get Purchase Order File Detail

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

Get file detail and binary data of purchase order.

#### Query Parameters

| Name                                     | Type   | Description                                                                                  |
| ---------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| id                                       | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number                                   | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| fileid<mark style="color:red;">\*</mark> | Int    | File 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 |
| ------------- | ------ | ------------------- |
| id            | Int    | File ID             |
| content       | String | Base64 Encode Data  |
| fileName      | String | File Name           |
| type          | String | File Type           |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add File to Purchase Order

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

Add file to purchase order.

#### Query Parameters

| Name   | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| id     | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |

## Get Quotation Files

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

Get list of files in quotation.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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" %}

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |
| {% endtab %}        |        |                     |
| {% endtabs %}       |        |                     |

## Get Quotation File Detail

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

Get file detail and binary data of quotation.

#### Query Parameters

| Name                                     | Type   | Description                                                                             |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| id                                       | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number                                   | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| fileid<mark style="color:red;">\*</mark> | Int    | File 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 |
| ------------- | ------ | ------------------- |
| id            | Int    | File ID             |
| content       | String | Base64 Encode Data  |
| fileName      | String | File Name           |
| type          | String | File Type           |
| {% endtab %}  |        |                     |
| {% endtabs %} |        |                     |

## Add File to Quotation

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

Add file to quotation.

#### Query Parameters

| Name   | Type   | Description                                                                             |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| id     | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| number | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |

#### 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 %} |        |                                       |


# Document

## Get Documents

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

Get list of documents.

#### Query Parameters

| Name          | Type   | Description                                                                                                                                                                                       |
| ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page          | Int    | Page (Default = 1)                                                                                                                                                                                |
| limit         | Int    | Limit per page (Max = 200)                                                                                                                                                                        |
| createdafter  | String | <p>Created Date After ..... </p><p>(yyyy-MM-dd)</p>                                                                                                                                               |
| createdbefore | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                                                                  |
| searchnumber  | String | Document Number or Reference Number                                                                                                                                                               |
| documenttype  | Int    | <p>Document Type <br>1 – Receipt<br>2 – Tax Invoice<br>3 – Invoice<br>4 – Quotation<br>5 – Withholding Tax<br>If documenttype is not defined or equals 0, the system will show all documents.</p> |
| idtype        | Int    | <p>Related Transaction Type</p><p>1 – Order/Purchase Order<br>2 – Income/Expense<br>3 – Quotation<br>If idtype is not defined or equals 0, the system will show all.</p>                          |

#### 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                                                                                                                                                         |
| idlist                                      | String | <p>List Of Related Transaction ID</p><p>Ex. “123,124,125“<br>This will be active when idtype is defined and not equals 0. So this will be related on "idtype".</p> |

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

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

<table><thead><tr><th>Document (Array)</th><th width="158">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>Document ID</td></tr><tr><td>header</td><td>String</td><td>Document Header</td></tr><tr><td>documentnumber</td><td>String</td><td>Document Number</td></tr><tr><td>referenceid</td><td>Int</td><td>Reference ID of Document</td></tr><tr><td>referencetype</td><td>Int</td><td><p>Reference Type of Document</p><p>0 - Undefined</p><p>1 – Order <br>2 – Purchase Order</p><p>3 – Return Order<br>4 – Return Purchase Order<br>5 – Other Income</p><p>6 – Other Expense</p></td></tr><tr><td>referencenumber</td><td>String</td><td>Reference Number</td></tr><tr><td>linkurl</td><td>String</td><td>Document Url</td></tr><tr><td>documentdate</td><td>Date</td><td>Document Date</td></tr><tr><td>documentdateString</td><td>String</td><td>Document Date<br>(yyyy-MM-dd)</td></tr><tr><td>createdatetime</td><td>Datetime</td><td>Created Datetime</td></tr><tr><td>createdatetimeString</td><td>String</td><td>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</td></tr><tr><td>detail</td><td>Detail</td><td>Document Detail</td></tr></tbody></table>

| Detail              | Type                | Description/Example   |
| ------------------- | ------------------- | --------------------- |
| order               | Order               | Order                 |
| purchase            | PurchaseOrder       | Purchase Order        |
| returnOrder         | ReturnOrder         | Return Order          |
| returnPurchaseOrder | ReturnPurchaseOrder | Return Purchase Order |
| income              | Income              | Income                |
| expense             | Expense             | Expense               |
| quotation           | Quotation           | Quotation             |
| {% endtab %}        |                     |                       |
| {% endtabs %}       |                     |                       |

## Get Documents of Order

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

Get list of documents in order.

#### Query Parameters

| Name                                 | Type | Description                                                                                                                                               |
| ------------------------------------ | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | Int  | Order ID                                                                                                                                                  |
| documenttype                         | Int  | <p>Document Type <br>1 – Receipt<br>2 – Tax Invoice<br>3 – Invoice<br>If documenttype is not defined or equals 0, the system will show all documents.</p> |

#### 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      | Document (Array) | Document List (Array)                 |
| count     | Int              | Total document number by filter       |

| Document (Array)     | Type     | Description/Example                                                                                                                                                                          |
| -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                   | Int      | Document ID                                                                                                                                                                                  |
| header               | String   | Document Header                                                                                                                                                                              |
| documentnumber       | String   | Document Number                                                                                                                                                                              |
| referenceid          | Int      | Reference ID of Document                                                                                                                                                                     |
| referencetype        | Int      | <p>Reference Type of Document</p><p>0 - Undefined</p><p>1 – Order <br>2 – Purchase Order</p><p>3 – Return Order<br>4 – Return Purchase Order<br>5 – Other Income</p><p>6 – Other Expense</p> |
| referencenumber      | String   | Reference Number                                                                                                                                                                             |
| linkurl              | String   | Document Url                                                                                                                                                                                 |
| documentdate         | Date     | Document Date                                                                                                                                                                                |
| documentdateString   | String   | <p>Document Date<br>(yyyy-MM-dd)</p>                                                                                                                                                         |
| createdatetime       | Datetime | Created Datetime                                                                                                                                                                             |
| createdatetimeString | String   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                                                                                                                          |
| detail               | Detail   | Document Detail                                                                                                                                                                              |

| Detail              | Type                | Description/Example   |
| ------------------- | ------------------- | --------------------- |
| order               | Order               | Order                 |
| purchase            | PurchaseOrder       | Purchase Order        |
| returnOrder         | ReturnOrder         | Return Order          |
| returnPurchaseOrder | ReturnPurchaseOrder | Return Purchase Order |
| income              | Income              | Income                |
| expense             | Expense             | Expense               |
| quotation           | Quotation           | Quotation             |
| {% endtab %}        |                     |                       |
| {% endtabs %}       |                     |                       |

## Add Document of Order

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

Add document in order.

#### Query Parameters

| Name                                 | Type | Description                                                   |
| ------------------------------------ | ---- | ------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | Int  | Order ID                                                      |
| useexist                             | Int  | If this value = 1, the system will return existing documents. |

#### 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 %} |        |                                       |


# Merchant

## Get Sales Channels

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

Get list of sales channels.

#### 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      | Saleschannel (Array) | Sales channel List (Array)            |
| count     | Int                  | Total sales channel number by filter  |

| Saleschannel (Array) | Type   | Description/Example |
| -------------------- | ------ | ------------------- |
| id                   | Int    | Sales channel ID    |
| name                 | String | Sales channel Name  |
| {% endtab %}         |        |                     |
| {% endtabs %}        |        |                     |

## Get Payment Methods

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

Get list of payment methods/wallets.

#### 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      | PaymentMethod (Array) | Payment method List (Array)           |
| count     | Int                   | Total payment method number by filter |

| PaymentMethod (Array) | Type   | Description/Example |
| --------------------- | ------ | ------------------- |
| id                    | Int    | Payment method ID   |
| name                  | String | Payment method Name |
| {% endtab %}          |        |                     |
| {% endtabs %}         |        |                     |

## Get Shipping Channels

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

Get list of shipping channels.

#### 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      | Shippingchannel (Array) | Shipping channel List (Array)           |
| count     | Int                     | Total shipping channel number by filter |

| Shippingchannel (Array) | Type   | Description/Example   |
| ----------------------- | ------ | --------------------- |
| id                      | Int    | Shipping channel ID   |
| name                    | String | Shipping channel Name |
| {% endtab %}            |        |                       |
| {% endtabs %}           |        |                       |

## Get Merchant Profile

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

Get profile of merchant.

#### 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="207.33333333333331">Parameter</th><th>Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>ID</td></tr><tr><td>name</td><td>String</td><td>Name</td></tr><tr><td>phone</td><td>String</td><td>Phone</td></tr><tr><td>email</td><td>String</td><td>Email</td></tr><tr><td>address</td><td>String</td><td>Address</td></tr><tr><td>taxid</td><td>String</td><td>Tax ID</td></tr><tr><td>fax</td><td>String</td><td>Fax</td></tr><tr><td>website</td><td>String</td><td>Website</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Registration

To be our partner. You need to register your application. After you register, we will review your information within 5 business days.

### Registration URL

{% hint style="info" %}
<https://secure.zortout.com/Partner/Register>
{% endhint %}


# Authentication

Your platform can connect to ZORT API with several accounts. Your users can login by ZORT account and your platform can retrieve ZORT key (storename, apikey and apisecret) to connect ZORT API.

### Start Development

You will get **"Partner Key"** for using authentication via your email after we approve your application.

### Retrieve Application Key and Application Secret

1. Redirect to Authentication URL with Post method.

```
// Example Form

<html>
<body>
<form method="post" action="https://secure.zortout.com/Connect/Register"/>
partnersecretkey : <input type="text" name="partnersecretkey" value=""/><br/>
token : <input type="text" name="token" value=""/><br/>
returnurl : <input type="text" name="returnurl" value=""/><br/> 
<input type="submit"/>
</form>
</body>
</html>
```

2\. The system will redirect to returnurl after users login successfully with Post method and key parameters. (storename, apikey, apisecret)

## Callback URL

<mark style="color:green;">`POST`</mark> `{returnurl}`

#### Query Parameters

| Name                                     | Type   | Description                |
| ---------------------------------------- | ------ | -------------------------- |
| token1<mark style="color:red;">\*</mark> | String | storename                  |
| token2<mark style="color:red;">\*</mark> | String | apikey                     |
| token3<mark style="color:red;">\*</mark> | String | apisecret                  |
| token4                                   | String | Account name               |
| token5<mark style="color:red;">\*</mark> | String | Your token (reference key) |


# API Update

{% content-ref url="/pages/SQRmtyPig7FTad6qCmJX" %}
[\[14 May 2026\] Update](/announcements/api-update/14-may-2026-update)
{% endcontent-ref %}

{% content-ref url="/pages/dJYU7yq9iLGbiQTyh4Q4" %}
[\[22 Jan 2026\] Update](/announcements/api-update/22-jan-2026-update)
{% endcontent-ref %}

{% content-ref url="/pages/TFEaQHCOGQvvue494xKv" %}
[\[9 Dec 2025\] Update](/announcements/api-update/9-dec-2025-update)
{% endcontent-ref %}

{% content-ref url="/pages/PNksd7TZh6Ld5tUEWOoB" %}
[\[17 Apr 2025\] Update](/announcements/api-update/17-apr-2025-update)
{% endcontent-ref %}

{% content-ref url="/pages/IDsDGI5U5aIoybLRYnM9" %}
[\[15 Feb 2025\] Update](/announcements/api-update/15-feb-2025-update)
{% endcontent-ref %}


# \[14 May 2026] Update

This update is scheduled to launch on 2 June 2026.

### [GetOrders](/api-reference/order#get-orders)

> Add "**vouchers**" to the "**options**" parameter to retrieve voucher information for orders.

### [GetOrderDetail](/api-reference/order#get-order-detail)

> Add vouchers to get voucher list of order.


# \[22 Jan 2026] Update

### Add new Order API

> [Add Voucher Order](/api-reference/order#add-voucher-order)
>
> [Delete Voucher Order](/api-reference/order#delete-voucher-order)

### Add new Quotation API

> [Add Quotation Tag](/api-reference/quotation#add-quotation-tag)
>
> [Delete Quotation Tag](/api-reference/quotation#delete-quotation-tag)

### Add new File Upload API

> [Get Quotation Files](/api-reference/file-upload#get-quotation-files)
>
> [Get Quotation File Detail](/api-reference/file-upload#get-quotation-file-detail)
>
> [Add File to Quotation](/api-reference/file-upload#add-file-to-quotation)

### Add new Product API

> [Add Serial No](/api-reference/product#add-serial-no)
>
> [Delete Serial No](/api-reference/product#delete-serial-no)


# \[9 Dec 2025] Update

### Add totalAmount  in API of Order, Purchase Order, Return Order, Return Purchase Order and Quotation.

> [Get Orders](/api-reference/order#get-orders)
>
> [Get Purchase Orders](/api-reference/purchase-order#get-purchase-orders)
>
> [Get Return Orders](/api-reference/return-order#get-return-orders)
>
> [Get Return Purchase Orders](/api-reference/return-purchase-order#get-return-purchase-orders)
>
> [Get Quotations](/api-reference/quotation#get-quotations)

### Add totalPaymentAmount in API of Order, Purchase Order, Return Order and Return Purchase Order.

> [Get Orders](/api-reference/order#get-orders)
>
> [Get Purchase Orders](/api-reference/purchase-order#get-purchase-orders)
>
> [Get Return Orders](/api-reference/return-order#get-return-orders)
>
> [Get Return Purchase Orders](/api-reference/return-purchase-order#get-return-purchase-orders)


# \[17 Apr 2025] Update

### [GetOrders](/api-reference/order#get-orders)

> Add new parameter : "options" to include more response detail.

### [GetReturnOrders](/api-reference/return-order#get-return-orders)

> Add new parameter : "referenceid" to filter by Reference Order ID.
>
> Add new parameter : "referencenumber" to filter by Reference Order Number.

### Add new Product API

> [Active Product](/api-reference/product#active-product)
>
> [Disable Product](/api-reference/product#disable-product)

### Add new Bundle API

> [Active Bundle](/api-reference/bundle#active-bundle)
>
> [Delete Bundle](/api-reference/bundle#delete-bundle)


# \[15 Feb 2025] Update

We have introduced a new feature to include X-Request-ID in all API responses. This unique request identifier will help with tracking, debugging, and log correlation across our system.&#x20;

* Every API response will include an X-Request-ID header.&#x20;
* If a client provides X-Request-ID, it will be retained. Otherwise, a new one will be generated.&#x20;
* This will improve traceability and debugging in our system.

{% hint style="info" %}
**How It Works**&#x20;

**1️. Clients Send Requests**&#x20;

* Clients can include X-Request-ID in the request headers.
* If not provided, the system automatically generates a new one.

**2️. API Response Includes X-Request-ID**

* The response will always contain an X-Request-ID header.
* This ID remains consistent throughout the request lifecycle.

**3️. Logs Include X-Request-ID**

* Every request's X-Request-ID is logged for tracking and debugging.
  {% endhint %}


# \[2 Dec 2024] Important Update

### Important Announcement: Deprecation of API Version 3

Dear Developers,

We are committed to continuously improving our platform to provide you with the best tools and experiences. As part of this effort, we are announcing the deprecation of **API Version 3**, effective **February 28, 2025**.

**What Does This Mean for You?**

* Starting from **February 28, 2025**, API Version 3 will no longer be supported.
* Any integrations relying on Version 3 of the API will cease to function beyond this date.
* We encourage all developers to migrate to **API Version 4** (or the latest version available) to take advantage of enhanced features, better performance, and improved security.

**What Should You Do?**

1. **Review Documentation:** Visit our [Developer Documentation](https://developers.zortout.com/) to learn more about the latest API version.
2. **Start Migration:** Begin updating your integration to use the latest API version as soon as possible.
3. **Reach Out for Support:** If you have questions or require assistance during the migration, please don't hesitate to contact our support team at <support@zortout.com>.

**Why Are We Making This Change?**

As technology evolves, it’s important to phase out outdated systems to ensure the stability, security, and scalability of our platform. This deprecation is a necessary step to align with modern standards and continue delivering exceptional service.

We understand that changes like this can be disruptive, and we are here to support you every step of the way. Thank you for your understanding and continued collaboration.\
\
Sincerely, \
The ZORT Developer Team


# \[31 Oct 2024] Update

### [BookOrderShipment](/api-reference/order#book-order-shipment)

> Add new parameter : "useShippingPoint" and "isPickup".
>
> Add optional request body to send address of sender and recipient.

### [GetShipmentLabels](/api-reference/order#get-shipment-labels)

> Add "Data" and "Format" in response.


# \[10 Feb 2024] Update

### Add pretax and vat  in API of Order, Purchase Order, Return Order, Return Purchase Order, Quotation and Finance.

> [Get Orders](/api-reference/order#get-orders)
>
> [Get Order Detail](/api-reference/order#get-order-detail)
>
> [Get Purchase Orders](/api-reference/purchase-order#get-purchase-orders)
>
> [Get Purchase Order Detail](/api-reference/purchase-order#get-purchase-order-detail)
>
> [Get Return Orders](/api-reference/return-order#get-return-orders)
>
> [Get Return Order Detail](/api-reference/return-order#get-return-order-detail)
>
> [Get Return Purchase Orders](/api-reference/return-purchase-order#get-return-purchase-orders)
>
> [Get Return Purchase Order Detail](/api-reference/return-purchase-order#get-return-purchase-order-detail)
>
> [Get Quotations](/api-reference/quotation#get-quotations)
>
> [Get Quotation Detail](/api-reference/quotation#get-quotation-detail)
>
> [Get Incomes](/api-reference/finance#get-incomes)
>
> [Get Income Detail](/api-reference/finance#get-income-detail)
>
> [Get Expenses](/api-reference/finance#get-expenses)
>
> [Get Expense Detail](/api-reference/finance#get-expense-detail)


# \[1 Nov 2023] Update

### Add new webhook for Contact and Warehouse.

> [ADDCONTACT](/overview/webhook#addcontact)
>
> [UPDATECONTACT](/overview/webhook#updatecontact)
>
> [DELETECONTACT](/overview/webhook#deletecontact)
>
> [ADDWAREHOUSE](/overview/webhook#addwarehouse)
>
> [UPDATEWAREHOUSE](/overview/webhook#updatewarehouse)
>
> [DELETEWAREHOUSE](/overview/webhook#deletewarehouse)


# \[14 Oct 2023] Update

### Add "producttype" in Product API, Order API and Purchase Order API.

{% hint style="info" %}
"producttype" is showed type of product.&#x20;

0 = Product\
1 = Service
{% endhint %}

> [Get Products](/api-reference/product#get-products)
>
> [Get Product Detail](/api-reference/product#get-product-detail)
>
> [Add Product](/api-reference/product#add-product)
>
> [Get Orders](/api-reference/order#get-orders)
>
> [Get Order Detail](/api-reference/order#get-order-detail)
>
> [Add Order](/api-reference/order#add-order)
>
> [Get Purchase Orders](/api-reference/purchase-order#get-purchase-orders)
>
> [Get Purchase Order Detail](/api-reference/purchase-order#get-purchase-order-detail)
>
> [Add Purchase Order](/api-reference/purchase-order#add-purchase-order)


# \[15 Aug 2023] Update

### [GETMONEYTRANSFERS](/api-reference/finance#get-money-transfers)

> Add new API to get money transfer list.

### [GETMONEYTRANSFERDETAIL](/api-reference/finance#get-money-transfer-detail)

> Add new API to get money transfer detail.

### [ADDMONEYTRANSFER](https://developers.zortout.com/announcements/api-update/pages/dZRADKni9JNSAHWG1gHK#add-money-transfer.)

> Add new API to add money transfer.


# \[1 June 2023] Important Update

**We already launched new API version 4.**

{% hint style="info" %}
Please follow what API version 4 is changed from API version 3 as this link.

<https://developers-v3.zortout.com/announcements/api-update/4-may-2023-important-update>
{% endhint %}


# Marketplace Flow

Marketplace flow will describe how data flow from Marketplace (Ex. Lazada, Shopee) to ZORT platform to Open API.

#### ZORT x Lazada

![ZORT x Lazada Data](/files/RHScaPDHuNM6Dk75ORq4)

#### ZORT x Shopee

![ZORT x Shopee Data](/files/ssjIEKr864Kebda1QrH3)

#### Order Price Structure For Marketplace

{% hint style="info" %}
**Reference:** [GETORDERS](https://developers.zortout.com/api-reference/order#get-orders) and [GETORDERDETAIL](https://developers.zortout.com/api-reference/order#get-order-detail)
{% endhint %}

<table><thead><tr><th width="170.21792325415112">Order</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>amount</td><td>Double</td><td>Net Amount</td></tr><tr><td>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>discount</td><td>String</td><td>Discount.<br>Discount includes sellerdiscount and platformdiscount.</td></tr><tr><td>sellerdiscount</td><td>Double</td><td>Seller Discount</td></tr><tr><td>platformdiscount</td><td>Double</td><td>Platform Discount.<br>This discount is subsidized from Marketplace for buyer. (Ex. Lazada, Shopee, JDCentral)</td></tr><tr><td>voucheramount</td><td>Double</td><td>Subsidized Amount from Marketplace for seller.</td></tr><tr><td>discountamount</td><td>Double</td><td>Total summary of order discount. (Include discount and voucheramount).<br>discountamount = discount - voucheramount<br>discountamount = sellerdiscount + platformdiscount - voucheramount</td></tr></tbody></table>


