# 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/12VcfYyuMZoBVE51GtXfSLG3zTGU4Us5a/view?usp=sharing)

### API Endpoint URL

{% hint style="info" %}
<https://api.zortout.com/api.aspx>
{% 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></tbody></table>


# 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="warning" %}
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://api.zortout.com/api.aspx`

Update webhook information.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | "UPDATEWEBHOOK"     |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |

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

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

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

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

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

## GETWEBHOOK

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get webhook information.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETWEBHOOK"        |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | json (Default), xml |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

<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></tbody></table>

### 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

{% endtab %}
{% endtabs %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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 | 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload JSON" %}

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

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

{% hint style="success" %}
**Transfer**
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% 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="200: OK " %}
{% tabs %}
{% tab title="Ex. Payload 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 %}
{% endtab %}
{% endtabs %}


# Product

## Get Products

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of products.

#### Query Parameters

| Name                                      | Type   | Description                                             |
| ----------------------------------------- | ------ | ------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETPRODUCTS”                                           |
| format                                    | String | json (Default), xml                                     |
| version<mark style="color:red;">\*</mark> | String | 3                                                       |
| 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 = 2000)                             |

#### Headers

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

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

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

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

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

| 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         |
| 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          |
| 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         |
| properties      | Property (Array) | Custom Properties List |

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

## Get Product Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get product detail.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETPRODUCTDETAIL”  |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

| 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         |
| 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          |
| 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         |
| properties     | Property (Array) | Custom Properties List |

## Get Bundles

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of bundle products.

#### Query Parameters

| Name                                      | Type   | Description                                             |
| ----------------------------------------- | ------ | ------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETBUNDLES”                                            |
| format                                    | String | json (Default), xml                                     |
| version<mark style="color:red;">\*</mark> | String | 3                                                       |
| 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 = 2000)                             |

#### Headers

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

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

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

| Bundle (Array) | Type    | Description/Example |
| -------------- | ------- | ------------------- |
| id             | Int     | Bundle ID           |
| name           | String  | Bundle Name         |
| sku            | String  | Bundle Sku          |
| sellprice      | String  | Sell price          |
| stock          | String  | Stock               |
| availablestock | String  | Available Stock     |
| imagepath      | String  | Image Url           |
| active         | Boolean | Active status       |

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

## Get Bundle Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of products in bundle.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETBUNDLEDETAIL”   |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| id<mark style="color:red;">\*</mark>      | Int    | Bundle ID           |
| warehousecode                             | String | Warehouse Code      |

#### Headers

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

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

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

| ProductBundle (Array) | Type   | Description/Example |
| --------------------- | ------ | ------------------- |
| id                    | Int    | Product ID          |
| name                  | String | Product Name        |
| sku                   | String | Product Sku         |
| quantity              | Double | Product Quantity    |

| Parameter      | Type                  | Description/Example |
| -------------- | --------------------- | ------------------- |
| id             | Int                   | Bundle ID           |
| name           | String                | Bundle Name         |
| sku            | String                | Bundle Sku          |
| sellprice      | String                | Sell price          |
| 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      |

## Get Variations

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of variation products.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETVARIATIONS”             |
| format                                    | String | json (Default), xml         |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| page                                      | Int    | Page (Default = 1)          |
| limit                                     | Int    | Limit per page (Max = 2000) |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Add Product

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add product.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDPRODUCT”        |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |

#### 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                                                                     |
| 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                                                                      |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDPRODUCT&version=3>
{% endtab %}

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

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

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

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

## Update Product

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit product info.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “UPDATEPRODUCT”     |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |

#### 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          |
| purchaseprice                         | String        | Purchase price   |
| sellprice                             | String        | Sell price       |
| sku<mark style="color:red;">\*</mark> | String        | Product Sku      |
| category                              | String        | Category Name    |

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

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

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

## Update Product Image

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit product image.

#### Query Parameters

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| method<mark style="color:red;">\*</mark>  | String | “UPDATEPRODUCTIMAGE” |
| format                                    | String | json (Default), xml  |
| version<mark style="color:red;">\*</mark> | String | 3                    |
| id<mark style="color:red;">\*</mark>      | Int    | Product ID           |

#### Headers

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

#### Request Body

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

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

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

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

## Update Product Stock List

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Adjust current inventory of product.

#### Query Parameters

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| method<mark style="color:red;">\*</mark>        | String | “UPDATEPRODUCTSTOCKLIST” |
| format                                          | String | json (Default), xml      |
| version<mark style="color:red;">\*</mark>       | String | 3                        |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL :  <https://api.zortout.com/api.aspx?method=UPDATEPRODUCTSTOCKLIST&version=3&warehousecode=W0001>
{% endtab %}

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

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

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

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

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

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

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

## Increase Product Stock List

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Increase inventory of product.

#### Query Parameters

| Name                                            | Type   | Description                |
| ----------------------------------------------- | ------ | -------------------------- |
| method<mark style="color:red;">\*</mark>        | String | ”INCREASEPRODUCTSTOCKLIST” |
| format                                          | String | json (Default), xml        |
| version<mark style="color:red;">\*</mark>       | String | 3                          |
| 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" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=INCREASEPRODUCTSTOCKLIST&version=3&warehousecode=W0001>
{% endtab %}

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

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

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

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

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

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

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

## Decrease Product Stock List

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Decrease inventory of product.

#### Query Parameters

| Name                                            | Type   | Description                |
| ----------------------------------------------- | ------ | -------------------------- |
| method<mark style="color:red;">\*</mark>        | String | “DECREASEPRODUCTSTOCKLIST” |
| format                                          | String | json (Default), xml        |
| version<mark style="color:red;">\*</mark>       | String | 3                          |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=DECREASEPRODUCTSTOCKLIST&version=3&warehousecode=W0001>
{% endtab %}

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

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

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

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

<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="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="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>

## Update Product Available Stock List

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Adjust available/sellable inventory of product.

#### Query Parameters

| Name                                            | Type   | Description                       |
| ----------------------------------------------- | ------ | --------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | “UPDATEPRODUCTAVAILABLESTOCKLIST” |
| format                                          | String | json (Default), xml               |
| version<mark style="color:red;">\*</mark>       | String | 3                                 |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=UPDATEPRODUCTAVAILABLESTOCKLIST&version=3&warehousecode=W0001>
{% endtab %}

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

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

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

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

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

## Delete Product

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Delete product.

#### Query Parameters

| Name    | Type   | Description         |
| ------- | ------ | ------------------- |
| method  | String | “DELETEPRODUCT”     |
| format  | String | json (Default), xml |
| version | String | 3                   |

#### 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 |
| ------------------------------------- | ------ | ----------- |
| sku<mark style="color:red;">\*</mark> | String | Product SKU |

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

{% endtab %}

{% tab title="Ex. URL" %}
URL :  <https://api.zortout.com/api.aspx?method=DELETEPRODUCT&version=3>
{% endtab %}

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

```
{
  "sku": "P0001"
}
```

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

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

## Add Bundle

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add bundle.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDBUNDLE”         |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |

#### 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                                                                      |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDBUNDLE&version=3>
{% endtab %}

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

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

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

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


# Warehouse

## Get Warehouses

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of warehouses/branches.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETWAREHOUSES”             |
| format                                    | String | json (Default), xml         |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| page                                      | Int    | Page (Default = 1)          |
| limit                                     | Int    | Limit per page (Max = 2000) |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

## Add Warehouse

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add warehouse/branch.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDWAREHOUSE”      |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL :  <https://api.zortout.com/api.aspx?method=ADDWAREHOUSE&version=3>
{% endtab %}

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

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

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

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


# Contact

## Get Contacts

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of contacts.

#### Query Parameters

| Name                                      | Type   | Description                             |
| ----------------------------------------- | ------ | --------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETCONTACTS”                           |
| version<mark style="color:red;">\*</mark> | String | 3                                       |
| keyword                                   | String | Keyword to search at least 3 characters |
| page                                      | Int    | Page (Default = 1)                      |
| limit                                     | Int    | Limit per page (Max = 2000)             |
| format                                    | String | json (Default), xml                     |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Get Contact Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get contact detail

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETCONTACTDETAIL”  |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| id<mark style="color:red;">\*</mark>      | Int    | Contact ID          |
| format                                    | String | json (Default), xml |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Add Contact

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add contact.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDCONTACT”        |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDCONTACT&version=3>
{% endtab %}

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

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

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

<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></tbody></table>

## Update Contact

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit contact info

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “UPDATECONTACT”     |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| id<mark style="color:red;">\*</mark>      | Int    | Contact ID          |

#### Headers

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

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL <https://api.zortout.com/api.aspx?method=UPDATECONTACT&version=3>
{% endtab %}

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

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

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

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


# Order

## Get Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of orders.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                    |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETORDERS”                                                                                                    |
| warehousecode                             | String | Warehouse Code                                                                                                 |
| topaymentamount                           | Double | Maximum payment amount                                                                                         |
| frompaymentamount                         | Double | Minimum payment amount                                                                                         |
| toamount                                  | Double | Maximum amount                                                                                                 |
| fromamount                                | Double | Minimum amount                                                                                                 |
| 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>                                                                |
| orderdatebefore                           | String | <p>Order Date Before .....<br>(yyyy-MM-dd)</p>                                                                 |
| orderdateafter                            | String | <p>Order Date After .....<br>(yyyy-MM-dd)</p>                                                                  |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                              |
| format                                    | String | json (Default), xml                                                                                            |
| saleschannel                              | String | Sales channel                                                                                                  |
| 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>                                                    |
| paymentstatus                             | String | <p>Payment status<br>0 - Pending<br>1 - Paid<br>2 - Voided<br>3 - Partial<br>4 - Overpaid<br>Ex. "0,1,3,4"</p> |
| status                                    | String | <p>Status<br>0 - Pending<br>1 - Success<br>2 - Voided<br>3 - Waiting<br>Ex. "0,1,3,4"</p>                      |
| createusername                            | String | Created by (Username)                                                                                          |
| limit                                     | Int    | Limit per page (Max = 2000)                                                                                    |
| page                                      | Int    | Page (Default = 1)                                                                                             |
| keyword                                   | String | Keyword to search                                                                                              |

#### Headers

| Name                                        | Type   | Description                                                |
| ------------------------------------------- | ------ | ---------------------------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                 |
| numberlist                                  | String | <p>List Of Order Number <br>Ex. “SO-001,SO-002,SO-003”</p> |
| orderidlist                                 | String | <p>List Of Order ID <br>Ex. “123,124,125”</p>              |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                 |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                    |

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

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

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

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

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

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

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

<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>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>totalprice</td><td>Double</td><td>Total Price</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>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="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, Packed, 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>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>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>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>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>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><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>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>agent</td><td>Agent</td><td>Agent Detail</td></tr><tr><td>uniquenumber</td><td>String</td><td>Unique Number</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr></tbody></table>

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

## Get Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get order detail.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETORDERDETAIL”    |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |
| id<mark style="color:red;">\*</mark>      | Int    | Order ID            |

#### Headers

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

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

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

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

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

<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="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="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="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>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>totalprice</td><td>Double</td><td>Total Price</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>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="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, Packed, 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>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>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>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>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>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><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>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>agent</td><td>Agent</td><td>Agent Detail</td></tr><tr><td>uniquenumber</td><td>String</td><td>Unique Number</td></tr><tr><td>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr></tbody></table>

## Get Voucher Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of voucher subsidized by Marketplace.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETVOUCHERDETAIL”  |
| id<mark style="color:red;">\*</mark>      | Int    | Order ID            |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |

#### Headers

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

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

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

| Voucher (Array) | Type   | Description/Example |
| --------------- | ------ | ------------------- |
| id              | Int    | ID                  |
| name            | String | Voucher Name        |
| amount          | Double | Amount              |

## Get Expense Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of expenses of order.

#### Query Parameters

| Name                                      | Type   | Description             |
| ----------------------------------------- | ------ | ----------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETEXPENSEORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Order ID                |
| version<mark style="color:red;">\*</mark> | String | 3                       |
| format                                    | String | json (Default), xml     |

#### Headers

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

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

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

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

## Get Movement Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products according to each order.

#### Query Parameters

| Name                                      | Type   | Description               |
| ----------------------------------------- | ------ | ------------------------- |
| method<mark style="color:red;">\*</mark>  | String | ““GETMOVEMENTORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Order ID                  |
| version<mark style="color:red;">\*</mark> | String | 3                         |
| format                                    | String | json (Default), xml       |

#### Headers

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

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

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

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

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

## Get Movement Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products for orders.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| method<mark style="color:red;">\*</mark>     | String | “GETMOVEMENTORDERS”                      |
| limit                                        | Int    | Limit per page (Max = 2000)              |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark>    | String | 3                                        |
| format                                       | String | json (Default), xml                      |

#### Headers

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

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

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

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

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

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

## Get Shipment Labels

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get shipment label list of orders.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETSHIPMENTLABELS" |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |

#### Headers

| Name                                        | Type   | Description                                                |
| ------------------------------------------- | ------ | ---------------------------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                 |
| orderidlist                                 | String | <p>List Of Order ID <br>Ex. “123,124,125”</p>              |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                 |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                    |
| numberlist                                  | String | <p>List Of Order Number <br>Ex. “SO-001,SO-002,SO-003”</p> |

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

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

| 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> |
| list                  | Int (Array) | List Of Order ID                                                                                                                  |

## Add Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDORDER”                                                                                  |
| link                                      | Int    | <p>Link to generate.</p><p>0 – None (Default)<br>1 – Share link</p>                         |
| uniquenumber                              | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                           |
| format                                    | String | json (Default), xml                                                                         |

#### 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               | 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                                                                                                                                                                                                                                                                        |
| customeraddress                                    | String               | Customer Address                                                                                                                                                                                                                                                                 |
| customerphone                                      | String               | Customer Phone                                                                                                                                                                                                                                                                   |
| customeremail                                      | String               | Customer Email                                                                                                                                                                                                                                                                   |
| customeridnumber                                   | String               | Customer ID Number/Tax ID                                                                                                                                                                                                                                                        |
| customername                                       | String               | Customer Name                                                                                                                                                                                                                                                                    |
| shippingaddress                                    | String               | Shipping Address                                                                                                                                                                                                                                                                 |
| shippingname                                       | String               | Shipping Name                                                                                                                                                                                                                                                                    |
| shippingdate                                       | String               | <p>Shipping Date</p><p>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                                                                                                                                                                                                                                                                  |
| shippingchannel                                    | String               | Shipping Channel                                                                                                                                                                                                                                                                 |
| trackingno                                         | String               | Tracking No                                                                                                                                                                                                                                                                      |
| shippingemail                                      | String               | Shipping Email                                                                                                                                                                                                                                                                   |
| shippingphone                                      | String               | Shipping Phone                                                                                                                                                                                                                                                                   |
| paymentamount                                      | Double               | <p>Payment Amount</p><p>("paymentmethod" must be required.)</p>                                                                                                                                                                                                                  |
| paymentmethod                                      | String               | Payment Method                                                                                                                                                                                                                                                                   |
| orderdate                                          | String               | <p>Order Date<br>Ex. "2021-09-15"</p>                                                                                                                                                                                                                                            |
| ∟ sku<mark style="color:red;">\*</mark>            | String               | Product Sku                                                                                                                                                                                                                                                                      |
| list                                               | OrderProduct (Array) | Product List                                                                                                                                                                                                                                                                     |
| warehousecode                                      | String               | Warehouse Code                                                                                                                                                                                                                                                                   |
| saleschannel                                       | String               | Sales Channel                                                                                                                                                                                                                                                                    |
| 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>                                                                                                                                                                                                                               |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double               | Total Price                                                                                                                                                                                                                                                                      |
| ∟ discount                                         | String               | Discount Per Unit                                                                                                                                                                                                                                                                |
| ∟ pricepernumber<mark style="color:red;">\*</mark> | Double               | Product Price/Quantity                                                                                                                                                                                                                                                           |
| ∟ name<mark style="color:red;">\*</mark>           | String               | Product Name                                                                                                                                                                                                                                                                     |
| ∟ number<mark style="color:red;">\*</mark>         | Double               | Product Quantity                                                                                                                                                                                                                                                                 |
| 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> |
| isCOD                                              | Boolean              | COD Status                                                                                                                                                                                                                                                                       |
| customerbranchname                                 | String               | Customer Branch Name                                                                                                                                                                                                                                                             |
| customerbranchno                                   | String               | Customer Branch No                                                                                                                                                                                                                                                               |
| customercode                                       | String               | Customer Code                                                                                                                                                                                                                                                                    |
| 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>                                                                                                                                                                                                                                          |
| properties                                         | Property (Array)     | Custom Properties List                                                                                                                                                                                                                                                           |
| ∟ id                                               | Int                  | <p>Property ID</p><p>\*Must have either id or name</p>                                                                                                                                                                                                                           |
| ∟ value                                            | String               | Property Value                                                                                                                                                                                                                                                                   |
| ∟ name                                             | String               | <p>Property Name Require if id = 0 or null</p><p>\*Must have either id or name</p>                                                                                                                                                                                               |

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

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDORDER&version=3>
{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Update Order Status

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update status of order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “UPDATEORDERSTATUS”                                                                 |
| status                                    | Int    | <p>1 = Success (Default) <br>3 = Waiting <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> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### Headers

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

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

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

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

## Update Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update payment of order.

#### Query Parameters

| Name                                            | Type   | Description                                                                         |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | “UPDATEORDERPAYMENT”                                                                |
| 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> |
| id                                              | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>       | String | 3                                                                                   |
| format                                          | String | json (Default), xml                                                                 |

#### Headers

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

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

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

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

## Verify Slip

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Verify slip of order.

#### Path Parameters

| Name                                       | Type   | Description                                                                         |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>   | String | “VERIFYORDERSLIP”                                                                   |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>  | String | 3                                                                                   |
| format                                     | String | json (Default), xml                                                                 |
| 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> |

#### Query Parameters

| Name                                       | Type   | Description                                                                         |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>   | String | “VERIFYORDERSLIP”                                                                   |
| 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> |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>  | String | 3                                                                                   |
| format                                     | String | json (Default), xml                                                                 |

#### Headers

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

#### Request Body

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

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

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

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

## Update Partial Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update partial product of order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "UPDATEPARTIALORDER"                                                                |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

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

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

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

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

## Edit Order Info

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit order info.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “EDITORDERINFO”                                                                     |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### Headers

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

#### 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                                |
| ∟ email            | String         | Agent Email                                 |
| ∟ phone            | String         | Agent Phone                                 |
| ∟ name             | String         | Agent Name                                  |
| ∟ address          | String         | Agent Address                               |
| expiredate         | String         | <p>Expired Date<br>Ex. “2021-09-15”</p>     |
| reference          | String         | Reference                                   |

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

{% endtab %}

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

```
{
  "number": "SO-0001",
  "orderdate": "2021-05-31"
}
```

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

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

## Edit Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “EDITORDER”                                                                         |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### Headers

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

#### Request Body

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

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

{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Void Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Void order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “VOIDORDER”                                                                         |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### Headers

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

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

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

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

## Void Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Delete payment in order.

#### Query Parameters

| Name                                        | Type   | Description                                                                         |
| ------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>    | String | “VOIDORDERPAYMENT”                                                                  |
| 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> |
| id                                          | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>   | String | 3                                                                                   |
| format                                      | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Ready To Ship

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

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                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>   | String | “READYTOSHIP”                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 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. 18-06-2020</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>                                                                                                                                                                                                                                                                                                                                             |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                                                                                                                                                                                                                                                                                                                                                           |
| version<mark style="color:red;">\*</mark>  | String | 3                                                                                                                                                                                                                                                                                                                                                                                                                               |
| format                                     | String | json (Default), xml                                                                                                                                                                                                                                                                                                                                                                                                             |

#### Headers

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

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

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

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

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

## Book Order Shipment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

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                                                                                                                            |
| ------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>   | String | “BOOKORDERSHIPMENT”                                                                                                                    |
| shipment<mark style="color:red;">\*</mark> | String | <p>Shipment provider. <br>flashexpress – Flash Express <br>jtexpress – J\&T <br>kerry – Kerry</p><p>shopeeexpress – Shopee Express</p> |
| number                                     | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p>                                                    |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                                                                  |
| version<mark style="color:red;">\*</mark>  | String | 3                                                                                                                                      |
| format                                     | String | json (Default), xml                                                                                                                    |

#### Headers

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

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

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

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

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

## Update Order Serial No

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update serial number of order.

#### Query Parameters

| Name                                       | Type   | Description                                                                                   |
| ------------------------------------------ | ------ | --------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>   | String | “UPDATEORDERSERIALNO”                                                                         |
| 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>           |
| id                                         | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                         |
| version<mark style="color:red;">\*</mark>  | String | 3                                                                                             |
| format                                     | String | json (Default), xml                                                                           |

#### Headers

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

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

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

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

## Update Order Expiry/Lot

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update expiry/lot of order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                   |
| ------------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>    | String | “UPDATEORDEREXPIRYLOT”                                                                        |
| 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>           |
| id                                          | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                                         |
| version<mark style="color:red;">\*</mark>   | String | 3                                                                                             |
| format                                      | String | json (Default), xml                                                                           |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Add Expense Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add expense to order.

#### Query Parameters

| Name                                      | Type   | Description           |
| ----------------------------------------- | ------ | --------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDEXPENSEWITHORDER” |
| id<mark style="color:red;">\*</mark>      | Int    | Order ID              |
| version<mark style="color:red;">\*</mark> | String | 3                     |
| format                                    | String | json (Default), xml   |

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| storename | String | Store Name  |
| apikey    | String | API Key     |
| apisecret | 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Add Order Tag

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add tag to order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDORDERTAG”                                                                       |
| 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> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### Headers

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

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

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

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


# Purchase Order

## Get Purchase Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of purchase orders.

#### Query Parameters

| Name                                      | Type   | Description                                                  |
| ----------------------------------------- | ------ | ------------------------------------------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “GETPURCHASEORDERS”                                          |
| 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>              |
| purchaseorderdatebefore                   | String | <p>Purchase Order Date Before .....<br>(yyyy-MM-dd)</p>      |
| purchaseorderdateafter                    | String | <p>Purchase Order Date After .....<br>(yyyy-MM-dd)</p>       |
| version<mark style="color:red;">\*</mark> | String | 3                                                            |
| format                                    | String | json (Default), xml                                          |
| toamount                                  | Double | Maximum amount                                               |
| fromamount                                | Double | Minimum amount                                               |
| 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>    |
| keyword                                   | String | Keyword to search                                            |
| 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                                       |
| limit                                     | Int    | Limit per page (Max = 2000)                                  |
| page                                      | Int    | Page (Default = 1)                                           |

#### Headers

| Name                                        | Type   | Description                                                         |
| ------------------------------------------- | ------ | ------------------------------------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                          |
| numberlist                                  | String | <p>List Of Purchase Order Number <br>Ex. “PO-001,PO-002,PO-003”</p> |
| purchaseorderidlist                         | String | <p>List Of Purchase Order ID <br>Ex. “123,124,125”</p>              |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                          |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                             |

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

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

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

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

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

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

| 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               |
| discountamount               | Double            | Total discount of product line. |
| totalprice                   | Double            | Total Price                     |
| serialnolist                 | SerialNo (Array)  | Serial no List                  |
| expirylotlist                | ExpiryLot (Array) | Expiry lot List                 |
| properties                   | Property (Array)  | Custom Properties List          |

| 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                                                                          |
| vatamount               | Double                       | 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>                                                    |
| 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                                                                       |
| properties              | Property (Array)             | Custom Properties List                                                              |

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

## Get Purchase Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get purchase order detail.

#### Query Parameters

| Name                                      | Type   | Description              |
| ----------------------------------------- | ------ | ------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “GETPURCHASEORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Purchase Order ID        |
| version<mark style="color:red;">\*</mark> | String | 3                        |
| format                                    | String | json (Default), xml      |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

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

| 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               |
| discountamount               | Double            | Total discount of product line. |
| totalprice                   | Double            | Total Price                     |
| serialnolist                 | SerialNo (Array)  | Serial no List                  |
| expirylotlist                | ExpiryLot (Array) | Expiry lot List                 |
| properties                   | Property (Array)  | Custom Properties List          |

<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>vatamount</td><td>Double</td><td>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>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>properties</td><td>Property (Array)</td><td>Custom Properties List</td></tr></tbody></table>

## Get Movement Purchase Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products according to each purchase order.

#### Query Parameters

| Name                                      | Type   | Description                      |
| ----------------------------------------- | ------ | -------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETMOVEMENTPURCHASEORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Purchase Order ID                |
| version<mark style="color:red;">\*</mark> | String | 3                                |
| format                                    | String | json (Default), xml              |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

## Get Movement Purchase Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products for purchase orders.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| method<mark style="color:red;">\*</mark>     | String | “GETMOVEMENTPURCHASEORDERS”              |
| limit                                        | Int    | Limit per page (Max = 2000)              |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark>    | String | 3                                        |
| format                                       | String | json (Default), xml                      |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Get Expense Purchase Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of expenses of purchase order.

#### Query Parameters

| Name                                      | Type   | Description                     |
| ----------------------------------------- | ------ | ------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETEXPENSEPURCHASEORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Purchase Order ID               |
| version<mark style="color:red;">\*</mark> | String | 3                               |
| format                                    | String | json (Default), xml             |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Add Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDPURCHASEORDER”                                                                          |
| uniquenumber                              | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                           |
| format                                    | String | json (Default), xml                                                                         |

#### Headers

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

#### 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                                                                                                                                                                                                                                                                        |
| customeraddress                                    | String                       | Contact Address                                                                                                                                                                                                                                                                  |
| customerphone                                      | String                       | Contact Phone                                                                                                                                                                                                                                                                    |
| customeremail                                      | String                       | Contact Email                                                                                                                                                                                                                                                                    |
| customeridnumber                                   | String                       | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| customername                                       | String                       | Contact 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                                                                                                                                                                                                                                                                      |
| ∟ sku<mark style="color:red;">\*</mark>            | String                       | Product Sku                                                                                                                                                                                                                                                                      |
| list                                               | PurchaseOrderProduct (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)                                                                                                                                                                                                                                                                 |
| 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> |
| customercode                                       | String                       | Contact Code                                                                                                                                                                                                                                                                     |
| customerbranchno                                   | String                       | Contact Branch No                                                                                                                                                                                                                                                                |
| customerbranchname                                 | String                       | Contact Branch Name                                                                                                                                                                                                                                                              |
| ∟ 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                                                                                                                                                                                                                                                           |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDPURCHASEORDER&version=3>
{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Update Purchase Order Status

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update status of purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “UPDATEPURCHASEORDERSTATUS”                                                                  |
| 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> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Update Purchase Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update payment of purchase order.

#### Query Parameters

| Name                                            | Type   | Description                                                                                  |
| ----------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | “UPDATEPURCHASEORDERPAYMENT”                                                                 |
| 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> |
| id                                              | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>       | String | 3                                                                                            |
| format                                          | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Update Partial Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update partial product of purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "UPDATEPARTIALPURCHASEORDER"                                                                 |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

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

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

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

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

## Edit Purchase Order Info

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit purchase order info.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “EDITPURCHASEORDERINFO”                                                                      |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

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

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

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

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

## Edit Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “EDITPURCHASEORDER”                                                                          |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### Headers

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

#### Request Body

| Name                                               | Type                         | Description                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number                                             | String                       | Purchase Order Number                                                                                                                                                                                                                                                            |
| 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                                                                                                                                                                                                                                                                     |
| 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                                                                                                                                                                                                                                                                       |
| tag                                                | String (Array)               | Tag List (Array)                                                                                                                                                                                                                                                                 |
| description                                        | String                       | Description                                                                                                                                                                                                                                                                      |
| reference                                          | String                       | Reference                                                                                                                                                                                                                                                                        |
| 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                                                                                                                                                                                                                                                                |
| ∟ sku<mark style="color:red;">\*</mark>            | String                       | Product Sku                                                                                                                                                                                                                                                                      |
| list                                               | PurchaseOrderProduct (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                                                                                                                                                                                                                                                                  |
| ∟ 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                                                                                                                                                                                                                                                                     |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                       | Total Price                                                                                                                                                                                                                                                                      |

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

{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Void Purchase Order&#x20;

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Void purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “VOIDPURCHASEORDER”                                                                          |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Void Purchase Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Delete payment in purchase order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                  |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>    | String | “VOIDPURCHASEORDERPAYMENT”                                                                   |
| 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> |
| id                                          | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>   | String | 3                                                                                            |
| format                                      | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Update Purchase Order Serial No

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update serial number of purchase order.

#### Query Parameters

| Name                                       | Type   | Description                                                                                          |
| ------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>   | String | “UPDATEPURCHASEORDERSERIALNO”                                                                        |
| 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>         |
| id                                         | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                                       |
| version<mark style="color:red;">\*</mark>  | String | 3                                                                                                    |
| format                                     | String | json (Default), xml                                                                                  |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Update Purchase Order Expiry/Lot

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update expiry/lot of purchase order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                   |
| ------------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>    | String | “UPDATEPURCHASEORDEREXPIRYLOT”                                                                |
| 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                                   | String | <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>  |
| id                                          | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                                |
| version<mark style="color:red;">\*</mark>   | String | 3                                                                                             |
| format                                      | String | json (Default), xml                                                                           |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Add Expense Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add expense to purchase order.

#### Query Parameters

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDEXPENSEWITHPURCHASEORDER” |
| id<mark style="color:red;">\*</mark>      | Int    | Purchase Order ID             |
| version<mark style="color:red;">\*</mark> | String | 3                             |
| format                                    | String | json 3(Default), xml          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Add Purchase Order Tag

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add tag to purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDPURCHASEORDERTAG”                                                                        |
| 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> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |
| id                                        | Int    | <p>Purchase Order ID</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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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


# Return Order

## Get Return Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of return orders.

#### Query Parameters

| Name                                      | Type   | Description                                              |
| ----------------------------------------- | ------ | -------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETRETURNORDERS”                                        |
| 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>            |
| returnorderdatebefore                     | String | <p>Return Order Date Before …..<br>(yyyy-MM-dd)</p>      |
| returnorderdateafter                      | String | <p>Return Order Date After …..<br>(yyyy-MM-dd)</p>       |
| version<mark style="color:red;">\*</mark> | String | 3                                                        |
| format                                    | String | json (Default), xml                                      |
| 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> |
| topaymentamount                           | Double | Maximum payment amount                                   |
| frompaymentamount                         | Double | Minimum payment amount                                   |
| toamount                                  | Double | Maximum amount                                           |
| fromamount                                | Double | Minimum amount                                           |
| keyword                                   | String | Keyword to search                                        |
| createusername                            | String | Created by (Username)                                    |
| warehousecode                             | String | Warehouse Code                                           |
| limit                                     | Int    | Limit per page (Max = 2000)                              |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDRETURNORDER&version=3>
{% 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 %}
{% endtab %}
{% endtabs %}

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

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

<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>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping 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>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>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></tbody></table>

<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></tbody></table>

## Get Return Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get return order detail

#### Query Parameters

| Name                                      | Type   | Description            |
| ----------------------------------------- | ------ | ---------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETRETURNORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Return Order ID        |
| version<mark style="color:red;">\*</mark> | String | 3                      |
| format                                    | String | json (Default), xml    |

#### Headers

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

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

{% endtab %}
{% endtabs %}

{% endtab %}
{% endtabs %}

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

<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 Unittotalprice</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr></tbody></table>

<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>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping 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>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>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></tbody></table>

## Get Movement Return Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products according to each return order.

#### Query Parameters

| Name                                      | Type   | Description                    |
| ----------------------------------------- | ------ | ------------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “GETMOVEMENTRETURNORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Return Order ID                |
| version<mark style="color:red;">\*</mark> | String | 3                              |
| format                                    | String | json (Default), xml            |

#### Headers

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

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

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

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

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

## Get Movement Return Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products for return orders.

#### Query Parameters

| Name                                          | Type   | Description                            |
| --------------------------------------------- | ------ | -------------------------------------- |
| method<mark style="color:red;">\*</mark>      | String | “GETMOVEMENTRETURNORDERS”              |
| limit                                         | Int    | Limit per page (Max = 2000)            |
| page                                          | Int    | Page (Default = 1)                     |
| warehousecode                                 | String | Warehouse Code                         |
| datebefore <mark style="color:red;">\*</mark> | String | <p>Date Before …..<br>(yyyy-MM-dd)</p> |
| dateafter<mark style="color:red;">\*</mark>   | String | <p>Date After …..<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark>     | String |                                        |
| format                                        | String | json (Default), xml                    |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Add Return Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add return order.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDRETURNORDER”    |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |

#### 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                                                                                                                                                                                                                                                              |
| customername                                       | String                     | Customer Name                                                                                                                                                                                                                                                                    |
| customeraddress                                    | String                     | Customer Address                                                                                                                                                                                                                                                                 |
| customerphone                                      | String                     | Customer Phone                                                                                                                                                                                                                                                                   |
| customeremail                                      | String                     | Customer Email                                                                                                                                                                                                                                                                   |
| customeridnumber                                   | String                     | Customer ID Number/Tax ID                                                                                                                                                                                                                                                        |
| 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                                                                                                                                                                                                                                                               |
| customercode                                       | String                     | Customer Code                                                                                                                                                                                                                                                                    |
| customerbranchno                                   | String                     | Customer Branch No                                                                                                                                                                                                                                                               |
| customerbranchname                                 | String                     | Customer Branch Name                                                                                                                                                                                                                                                             |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}
{% endtabs %}

{% endtab %}
{% endtabs %}

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

## Update Return Order Status

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update status of return order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “UPDATERETURNORDERSTATUS”                                                                  |
| 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> |
| id                                        | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                          |
| format                                    | String | json (Default), xml                                                                        |

#### Headers

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

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

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

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

## Update Return Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update payment of return order.

#### Query Parameters

| Name                                            | Type   | Description                                                                                |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| method<mark style="color:red;">\*</mark>        | String | “UPDATERETURNORDERPAYMENT”                                                                 |
| paymentdate                                     | String | <p>Payment Datetime <br>Ex. “2021-09-15 21:05”</p>                                         |
| paymentamount<mark style="color:red;">\*</mark> | String | 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> |
| id                                              | String | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>       | String | 3                                                                                          |
| format                                          | String | json (Default), xml                                                                        |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Void Return Order&#x20;

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Void return order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “VOIDRETURNORDER”                                                                          |
| number                                    | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                          |
| format                                    | String | json (Default), xml                                                                        |

#### Headers

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

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

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

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

## Void Return Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Delete payment in return order.

#### Query Parameters

| Name                                        | Type   | Description                                                                                |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| method<mark style="color:red;">\*</mark>    | String | “VOIDRETURNORDERPAYMENT”                                                                   |
| number                                      | String | <p>Return Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                          | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark>   | String | 3                                                                                          |
| format                                      | String | json (Default), xml                                                                        |
| paymentid<mark style="color:red;">\*</mark> | Int    | Payment ID                                                                                 |

#### Headers

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

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

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

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

## Add Return Order Tag

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add tag to return order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “ADDRETURNORDERTAG”                                                                        |
| 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> |
| id                                        | Int    | <p>Return Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                          |
| format                                    | String | json (Default), xml                                                                        |

#### Headers

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

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

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

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


# Return Purchase Order

## Get Return Purchase Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of return purchase orders.

#### Query Parameters

| Name                                      | Type   | Description                                                    |
| ----------------------------------------- | ------ | -------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETRETURNPURCHASEORDERS”                                      |
| 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>                |
| returnpurchaseorderdatebefore             | String | <p>Return Purchase Order Date Before .....<br>(yyyy-MM-dd)</p> |
| returnpurchaseorderdateafter              | String | <p>Return Purchase Order Date After .....<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark> | String | 3                                                              |
| format                                    | String | json (Default), xml                                            |
| 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>      |
| createusername                            | String | Created by (Username)                                          |
| warehousecode                             | String | Warehouse Code                                                 |
| topaymentamount                           | Double | Maximum payment amount                                         |
| frompaymentamount                         | Double | Minimum payment amount                                         |
| toamount                                  | Double | Maximum amount                                                 |
| fromamount                                | Double | Minimum amount                                                 |
| limit                                     | Int    | Limit per page (Max = 2000)                                    |
| page                                      | Int    | Page (Default = 1)                                             |
| keyword                                   | String | Keyword to search                                              |

#### Headers

| Name                                        | Type   | Description                                                     |
| ------------------------------------------- | ------ | --------------------------------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                      |
| numberlist                                  | String | List Of Return Purchase Order Number Ex. “DN-001,DN-002,DN-003” |
| returnpurchaseorderidlist                   | String | List Of Return Purchase Order ID Ex. “123,124,125”              |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                      |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                         |

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

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

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

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

<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>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping 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>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></tbody></table>

<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></tbody></table>

## Get Return Purchase Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get return purchase order detail.

#### Query Parameters

| Name                                      | Type   | Description                    |
| ----------------------------------------- | ------ | ------------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “GETRETURNPURCHASEORDERDETAIL” |
| id<mark style="color:red;">\*</mark>      | Int    | Return Purchase Order ID       |
| version<mark style="color:red;">\*</mark> | String | 3                              |
| format                                    | String | json (Default), xml            |

#### Headers

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

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

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

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

<table><thead><tr><th width="200.080058224163">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>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>

<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>vatamount</td><td>Double</td><td>Vat Amount</td></tr><tr><td>shippingamount</td><td>Double</td><td>Shipping 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>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></tbody></table>

## Get Movement Return Purchase Order Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

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

#### Query Parameters

| Name                                      | Type   | Description                            |
| ----------------------------------------- | ------ | -------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETMOVEMENTRETURNPURCHASEORDERDETAIL” |
| id                                        | Int    | Return Purchase Order ID               |
| version<mark style="color:red;">\*</mark> | String | 3                                      |
| format                                    | String | json (Default), xml                    |

#### Headers

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

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

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

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

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

## Get Movement Return Purchase Orders

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products for return purchase orders.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| method<mark style="color:red;">\*</mark>     | String | “GETMOVEMENTRETURNPURCHASEORDERS”        |
| format                                       | String | json (Default), xml                      |
| limit                                        | Int    | Limit per page (Max = 2000)              |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark>    | String | 3                                        |

#### Headers

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

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

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

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

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

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

## Add Return Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add return purchase order.

#### Query Parameters

| Name                                      | Type   | Description              |
| ----------------------------------------- | ------ | ------------------------ |
| method<mark style="color:red;">\*</mark>  | String | “ADDRETURNPURCHASEORDER” |
| version<mark style="color:red;">\*</mark> | String | 3                        |
| format                                    | String | json (Default), xml      |

#### Headers

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

#### 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                                                                                                                                                                                                                                                                        |
| customeraddress                                    | String                       | Contact Address                                                                                                                                                                                                                                                                  |
| customerphone                                      | String                       | Contact Phone                                                                                                                                                                                                                                                                    |
| customeremail                                      | String                       | Contact Email                                                                                                                                                                                                                                                                    |
| customeridnumber                                   | String                       | Contact ID Number/Tax ID                                                                                                                                                                                                                                                         |
| customername                                       | String                       | Contact 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                                                                                                                                                                                                                                                                      |
| customercode                                       | String                       | Contact Code                                                                                                                                                                                                                                                                     |
| customerbranchno                                   | String                       | Contact Branch No                                                                                                                                                                                                                                                                |
| customerbranchname                                 | String                       | Contact Branch Name                                                                                                                                                                                                                                                              |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDRETURNPURCHASEORDER&version=3>
{% endtab %}

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

```
{
   "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"
}
```

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

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

## Update Return Purchase Order Status

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

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>                               |
| 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> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                   |
| format                                    | String | json (Default), xml                                                                                 |
| method<mark style="color:red;">\*</mark>  | String | "UPDATERETURNPURCHASEORDERSTATUS"                                                                   |

#### Headers

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

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

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

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

## Update Return Purchase Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update payment of return purchase order.

#### Query Parameters

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

#### Headers

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

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

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

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

## Void Return Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Void return purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "VOIDRETURNPURCHASEORDER"                                                                           |
| number                                    | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                   |
| format                                    | String | json (Default), xml                                                                                 |

#### Headers

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

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

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

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

## Void Return Purchase Order Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Delete payment in return purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "VOIDRETURNPURCHASEORDERPAYMENT"                                                                    |
| format                                    | String | json (Default), xml                                                                                 |
| number                                    | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                   |

#### Headers

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

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

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

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

## Add Return Purchase Order Tag

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add tag to return purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDRETURNPURCHASEORDERTAG"                                                                         |
| number                                    | String | <p>Return Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Return Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                   |
| format                                    | String | json (Default), xml                                                                                 |
| tag<mark style="color:red;">\*</mark>     | String | Tag                                                                                                 |

#### Headers

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

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

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

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


# Transfer

## Get Transfers

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of transfer.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                               |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETTRANSFERS”                                                                                                            |
| format                                    | String | json (Default), xml                                                                                                       |
| limit                                     | Int    | Limit per page (Max = 2000)                                                                                               |
| 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                                                                                                            |
| 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>                                                                           |
| transferdatebefore                        | String | <p>Transfer Date Before .....<br>(yyyy-MM-dd)</p>                                                                         |
| transferdateafter                         | String | <p>Transfer Date After .....<br>(yyyy-MM-dd)</p>                                                                          |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                                         |

#### Headers

| Name                                        | Type   | Description                                                   |
| ------------------------------------------- | ------ | ------------------------------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                    |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                    |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                       |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

| Parameter | Type             | Description/Example                   |
| --------- | ---------------- | ------------------------------------- |
| res       | Response         | <p>Response Code <br>200- Success</p> |
| list      | Transfer (Array) | Transfer List (Array)                 |

## Get Transfer Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get transfer detail

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETTRANSFERDETAIL" |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

## Get Movement Transfer Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products according to each transfer.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETMOVEMENTTRANSFERDETAIL” |
| format                                    | String | json (Default), xml         |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| id<mark style="color:red;">\*</mark>      | Int    | Transfer ID                 |

#### Headers

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

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

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

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

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

## Get Movement Transfers

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get movement list of products for transfers.

#### Query Parameters

| Name                                         | Type   | Description                              |
| -------------------------------------------- | ------ | ---------------------------------------- |
| method<mark style="color:red;">\*</mark>     | String | “GETMOVEMENTTRANSFERS”                   |
| format                                       | String | json (Default), xml                      |
| limit                                        | Int    | Limit per page (Max = 2000)              |
| page                                         | Int    | Page (Default = 1)                       |
| warehousecode                                | String | Warehouse Code                           |
| datebefore<mark style="color:red;">\*</mark> | String | <p>Date Before .....<br>(yyyy-MM-dd)</p> |
| dateafter<mark style="color:red;">\*</mark>  | String | <p>Date After .....<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark>    | String | 3                                        |

#### Headers

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

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

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

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

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

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

## Add Transfer

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add transfer.

#### Query Parameters

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “ADDTRANSFER”                                                                               |
| uniquenumber                              | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                           |
| format                                    | String | json (Default), xml                                                                         |

#### Headers

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

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL :[ ](https://api.zortout.com/api.aspx?method=ADDTRANSFER\&version=3)<https://api.zortout.com/api.aspx?method=ADDTRANSFER&version=3>
{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Update Transfer Status

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update status of transfer.

#### Query Parameters

| Name                                      | Type   | Description                                                                            |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “UPDATETRANSFERSTATUS”                                                                 |
| format                                    | String | json (Default), xml                                                                    |
| number                                    | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                      |

#### Headers

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

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

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

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

## Update Partial Transfer

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update partial product of transfer

#### Query Parameters

| Name                                      | Type   | Description                                                                            |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "UPDATEPARTIALTRANSFER"                                                                |
| number                                    | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                      |
| format                                    | String | json (Default), xml                                                                    |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

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

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

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

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

## Edit Transfer

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit transfer.

#### Query Parameters

| Name                                      | Type   | Description                                                                            |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “EDITTRANSFER”                                                                         |
| number                                    | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | json (Default), xml                                                                    |
| format                                    | String | 3                                                                                      |

#### Headers

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

#### Request Body

| Name         | Type                    | Description                                 |
| ------------ | ----------------------- | ------------------------------------------- |
| number       | String                  | Transfer Number                             |
| list         | TransferProduct (Array) | Product List                                |
| description  | String                  | Description                                 |
| transferdate | String                  | <p>Transfer Date</p><p>Ex. “2021-09-15”</p> |
| ∟ number     | String                  | Product Quantity                            |
| ∟ name       | String                  | Product Name                                |
| ∟ sku        | String                  | Product Sku                                 |

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

{% endtab %}

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

```
{
  "number": "TF-0001",
  "transferdate": "2021-01- 25",
  "list": [
    {
      "sku": "P0001",
      "name": "Product1",
      "number": "5"
    },
    {
      "sku": "P0002",
      "name": "Product2",
      "number": "3"
    }
  ]
}
```

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

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

## Void Transfer&#x20;

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Void transfer.

#### Query Parameters

| Name                                      | Type   | Description                                                                            |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “VOIDTRANSFER”                                                                         |
| number                                    | String | <p>Transfer Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Transfer ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                      |
| format                                    | String | json (Default), xml                                                                    |

#### Headers

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

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

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

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


# Quotation

## Get Quotations

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of quotations.

#### Query Parameters

| Name                                      | Type   | Description                                                |
| ----------------------------------------- | ------ | ---------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETQUOTATIONS"                                            |
| 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                                             |
| 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 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>            |
| quotationbefore                           | String | <p>Quotation Date Before .....<br>(yyyy-MM-dd)</p>         |
| quotationafter                            | String | <p>Quotation Date After .....<br>(yyyy-MM-dd)</p>          |
| version<mark style="color:red;">\*</mark> | String | 3                                                          |
| format                                    | String | json (Default), xml                                        |
| limit                                     | Int    | Limit per page (Max = 2000)                                |
| page                                      | Int    | Page (Default = 1)                                         |
| keyword                                   | String | Keyword to search                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| 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              |
| discount                  | String         | Discount Per Unit                   |
| discountamount            | Double         | Total discount of product line.     |
| totalprice                | Double         | Total Price                         |
| bundleid                  | Int (Nullable) | Bundle ID                           |
| bundleitemid              | Int (Nullable) | ID of bundle group in product line. |

| 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                                                                                 |
| vatamount            | Double                   | Vat Amount                                                                                 |
| shippingamount       | Double                   | Shipping 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.                                                       |
| 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                                                                              |

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

## Get Quotation Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get quotation detail.

#### Query Parameters

| Name                                      | Type   | Description                                                                             |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETQUOTATIONDETAIL”                                                                    |
| id                                        | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                       |
| format                                    | String | json (Default), xml                                                                     |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| 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              |
| discount                 | String         | Discount Per Unit                   |
| discountamount           | Double         | Total discount of product line.     |
| totalprice               | Double         | Total Price                         |
| bundleid                 | Int (Nullable) | Bundle ID                           |
| bundleitemid             | Int (Nullable) | ID of bundle group in product line. |

| 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                                                                                 |
| vatamount            | Double                   | Vat Amount                                                                                 |
| shippingamount       | Double                   | Shipping 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.                                                       |
| 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                                                                              |

## Add Quotation

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add quotation.

#### Query Parameters

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDQUOTATION"                                                                              |
| uniquenumber                              | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                           |
| format                                    | String | json (Default), xml                                                                         |

#### 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                                                                                                                                                                                                                                                                        |
| customerbranchno                                   | String                   | Customer Branch No                                                                                                                                                                                                                                                               |
| 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                                                                                                                                                                                                                                                                    |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDQUOTATION&version=3>
{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Approve Quotation

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Approve quotation.

#### Query Parameters

| Name                                      | Type   | Description                                                                             |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "APPROVEQUOTATION"                                                                      |
| approvedate                               | String | <p>Approve Date</p><p>(yyyy-MM-dd)</p>                                                  |
| number                                    | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                       |
| format                                    | String | json (Default), xml                                                                     |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Edit Quotation Info

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit quotation info.

#### Query Parameters

| Name                                      | Type   | Description                                                                             |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "EDITQUOTATIONINFO"                                                                     |
| number                                    | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                       |
| format                                    | String | json (Default), xml                                                                     |

#### Headers

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

#### Request Body

| Name               | Type           | Description                               |
| ------------------ | -------------- | ----------------------------------------- |
| number             | String         | Quotation Number                          |
| saleschannel       | String         | Sales Channel                             |
| description        | String         | Description                               |
| 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                          |
| customerphone      | String         | Customer Phone                            |
| customeridnumber   | String         | Customer ID Number/Tax ID                 |
| customername       | String         | Customer Name                             |
| customeremail      | String         | Customer Email                            |
| tag                | String (Array) | Tag List (Array)                          |

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

{% endtab %}

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

```
{
  "number": "QT-0001",
  "quotationdate": "2021-05-31"
}
```

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

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

## Edit Quotation

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Edit quotation.

#### Query Parameters

| Name                                      | Type   | Description                                                                             |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "EDITQUOTATION"                                                                         |
| number                                    | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                       |
| format                                    | String | json (Default), xml                                                                     |

#### Headers

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

#### Request Body

| Name                                               | Type                     | Description                                                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number                                             | String                   | Quotation Number                                                                                                                                                                                                                                                                 |
| 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                                                                                                                                                                                                                                                                 |
| customerphone                                      | String                   | Customer Phone                                                                                                                                                                                                                                                                   |
| customeremail                                      | String                   | Customer Email                                                                                                                                                                                                                                                                   |
| customeridnumber                                   | String                   | Customer ID Number/Tax ID                                                                                                                                                                                                                                                        |
| customername                                       | String                   | Customer Name                                                                                                                                                                                                                                                                    |
| 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                                                                                                                                                                                                                                                                       |
| tag                                                | String (Array)           | Tag List (Array)                                                                                                                                                                                                                                                                 |
| saleschannel                                       | String                   | Sales Channel                                                                                                                                                                                                                                                                    |
| description                                        | String                   | Description                                                                                                                                                                                                                                                                      |
| ∟ 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                                                                                                                                                                                                                                                                      |
| 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                                                                                                                                                                                                                                                                  |
| ∟ totalprice<mark style="color:red;">\*</mark>     | Double                   | Total Price                                                                                                                                                                                                                                                                      |

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

{% endtab %}

{% tab title="Ex. Request 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 %}
{% endtab %}
{% endtabs %}

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

## Void Quotation

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Void quotation.

#### Query Parameters

| Name                                      | Type   | Description                                                                             |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "VOIDQUOTATION"                                                                         |
| number                                    | String | <p>Quotation Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Quotation ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                       |
| format                                    | String | json (Default), xml                                                                     |

#### Headers

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

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

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

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


# Finance

## Get Incomes

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of incomes.

#### Query Parameters

| Name                                      | Type   | Description                                                |
| ----------------------------------------- | ------ | ---------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETINCOMES"                                               |
| 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>            |
| incomedatebefore                          | String | <p>Income Date Before .....<br>(yyyy-MM-dd)</p>            |
| incomedateafter                           | String | <p>Income Date After .....<br>(yyyy-MM-dd)</p>             |
| version<mark style="color:red;">\*</mark> | String | 3                                                          |
| format                                    | String | json (Default), xml                                        |
| limit                                     | Int    | Limit per page (Max = 2000)                                |
| 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> |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

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

## Get Income Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get income detail.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETINCOMEDETAIL"   |
| format                                    | String | json (Default), xml |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Add Income

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add income.

#### Query Parameters

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDINCOME"                                                                                 |
| format                                    | String | json (Default), xml                                                                         |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                           |
| 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                                                                                                                                                                                                                                                         |
| contactemail                                   | String             | Contact Email                                                                                                                                                                                                                                                                    |
| contactphone                                   | String             | Contact Phone                                                                                                                                                                                                                                                                    |
| contactaddress                                 | String             | Contact Address                                                                                                                                                                                                                                                                  |
| contactbranchname                              | String             | Contact Branch Name                                                                                                                                                                                                                                                              |
| amount<mark style="color:red;">\*</mark>       | Double             | Net Amount                                                                                                                                                                                                                                                                       |
| customerbranchno                               | String             | Contact Branch No                                                                                                                                                                                                                                                                |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDINCOME&version=3>
{% endtab %}

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

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

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

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

## Update Income Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update payment of income.

#### Query Parameters

| Name                                            | Type   | Description                                        |
| ----------------------------------------------- | ------ | -------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | “UPDATEINCOMEPAYMENT”                              |
| 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                                     |
| version<mark style="color:red;">\*</mark>       | String | 3                                                  |
| format                                          | String | json (Default), xml                                |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Get Expenses

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of expenses.

#### Path Parameters

| Name   | Type   | Description         |
| ------ | ------ | ------------------- |
| format | String | json (Default), xml |

#### Query Parameters

| Name                                      | Type   | Description                                                |
| ----------------------------------------- | ------ | ---------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETEXPENSES"                                              |
| expensedatebefore                         | String | <p>Expense Date Before .....<br>(yyyy-MM-dd)</p>           |
| expensedateafter                          | String | <p>Expense Date After .....<br>(yyyy-MM-dd)</p>            |
| version<mark style="color:red;">\*</mark> | String | 3                                                          |
| format                                    | String | json (Default), xml                                        |
| 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>            |
| 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>               |
| 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> |
| limit                                     | Int    | Limit per page (Max = 2000)                                |
| page                                      | Int    | Page (Default = 1)                                         |
| keyword                                   | String | Keyword to search                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

| 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                                                                      |
| vatamount                  | Double              | Vat Amount                                                                      |
| expensedate                | Date                | <p>Expense Date<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                                                                   |

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

## Get Expense Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get expense detail.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETEXPENSEDETAIL"  |
| id<mark style="color:red;">\*</mark>      | Int    | Expense ID          |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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

## Add Expense

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add expense.

#### Query Parameters

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDEXPENSE"                                                                                |
| uniquenumber                              | String | <p>Unique Number.</p><p>This value is unique and used to prevent duplicate transaction.</p> |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                           |
| format                                    | String | json (Default), xml                                                                         |

#### 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                                                                                                                                                                                                                                                         |
| contactemail                                   | String              | Contact Email                                                                                                                                                                                                                                                                    |
| contactphone                                   | String              | Contact Phone                                                                                                                                                                                                                                                                    |
| contactaddress                                 | String              | Contact Address                                                                                                                                                                                                                                                                  |
| 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                                                                                                                                                                                                                                                                       |
| contactbranchno                                | String              | Contact Branch No                                                                                                                                                                                                                                                                |
| contactbranchname                              | String              | Contact Branch Name                                                                                                                                                                                                                                                              |
| ∟ 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

{% endtab %}

{% tab title="Ex. URL" %}
URL : <https://api.zortout.com/api.aspx?method=ADDEXPENSE&version=3>
{% endtab %}

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

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

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

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

## Update Expense Payment

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Update payment of expense.

#### Query Parameters

| Name                                            | Type   | Description                                        |
| ----------------------------------------------- | ------ | -------------------------------------------------- |
| method<mark style="color:red;">\*</mark>        | String | “UPDATEEXPENSEPAYMENT”                             |
| 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                                     |
| id<mark style="color:red;">\*</mark>            | Int    | Expense ID                                         |
| version<mark style="color:red;">\*</mark>       | String | 3                                                  |
| format                                          | String | json (Default), xml                                |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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


# File Upload

## Get Order Files

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of files in order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETORDERFILES"                                                                     |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |

## Get Order File Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get file detail and binary data of order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETORDERFILEDETAIL”                                                                |
| fileid<mark style="color:red;">\*</mark>  | Int    | File ID                                                                             |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| Parameter | Type   | Description/Example |
| --------- | ------ | ------------------- |
| id        | Int    | File ID             |
| content   | String | Base64 Encode Data  |
| fileName  | String | File Name           |
| type      | String | File Type           |

## Add File to Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add file to order.

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDORDERFILE"                                                                      |
| number                                    | String | <p>Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                   |
| format                                    | String | json (Default), xml                                                                 |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

## Get Purchase Order Files

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of files in purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "GETPURCHASEORDERFILES"                                                                      |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| FileContent (Array) | Type   | Description/Example |
| ------------------- | ------ | ------------------- |
| id                  | Int    | File ID             |
| fileName            | String | File Name           |
| type                | String | File Type           |

## Get Purchase Order File Detail

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get file detail and binary data of purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETPURCHASEORDERFILEDETAIL”                                                                 |
| format                                    | String | json (Default), xml                                                                          |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

| Parameter | Type   | Description/Example |
| --------- | ------ | ------------------- |
| id        | Int    | File ID             |
| content   | String | Base64 Encode Data  |
| fileName  | String | File Name           |
| type      | String | File Type           |

## Add File to Purchase Order

<mark style="color:green;">`POST`</mark> `https://api.zortout.com/api.aspx`

Add file to purchase order.

#### Query Parameters

| Name                                      | Type   | Description                                                                                  |
| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | "ADDPURCHASEORDERFILE"                                                                       |
| number                                    | String | <p>Purchase Order Number Require if id = 0 or null</p><p>\*Must have either id or number</p> |
| id                                        | Int    | <p>Purchase Order ID</p><p>\*Must have either id or number</p>                               |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                            |
| format                                    | String | json (Default), xml                                                                          |

#### 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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


# Document

## Get Documents

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of documents.

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                                                                                       |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETDOCUMENTS”                                                                                                                                                                                    |
| searchnumber                              | String | Document Number or Reference Number                                                                                                                                                               |
| createdbefore                             | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>                                                                                                                                                  |
| createdafter                              | String | <p>Created Date After ..... </p><p>(yyyy-MM-dd)</p>                                                                                                                                               |
| limit                                     | Int    | Limit per page (Max = 200)                                                                                                                                                                        |
| page                                      | Int    | Page (Default = 1)                                                                                                                                                                                |
| version<mark style="color:red;">\*</mark> | String | 3                                                                                                                                                                                                 |
| format                                    | String | json (Default), xml                                                                                                                                                                               |
| 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>                          |
| 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> |

#### Headers

| Name                                        | Type   | Description                                                                                                                                                        |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                                                                                                                                         |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                                                                                                                                         |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                                                                                                                                            |
| 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="200: OK Success" %}
{% tabs %}
{% tab title="Response" %}

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

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

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

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


# Others

## Get Sales Channels

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of sales channels.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETSALESCHANNELS”          |
| limit                                     | Int    | Limit per page (Max = 2000) |
| page                                      | Int    | Page (Default = 1)          |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| format                                    | String | json (Default), xml         |

#### Headers

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

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

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

| Saleschannel (Array) | Type   | Description/Example |
| -------------------- | ------ | ------------------- |
| id                   | Int    | Sales channel ID    |
| name                 | String | Sales channel Name  |

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

## Get Payment Methods

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of payment methods/wallets.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETPAYMENTMETHODS”         |
| limit                                     | Int    | Limit per page (Max = 2000) |
| page                                      | Int    | Page (Default = 1)          |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| format                                    | String | json (Default), xml         |

#### Headers

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

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

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

| PaymentMethod (Array) | Type   | Description/Example |
| --------------------- | ------ | ------------------- |
| id                    | Int    | Payment method ID   |
| name                  | String | Payment method Name |

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

## Get Categories

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of product categories.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETCATEGORYS”              |
| limit                                     | Int    | Limit per page (Max = 2000) |
| page                                      | Int    | Page (Default = 1)          |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| format                                    | String | json (Default), xml         |

#### Headers

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

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

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

| Category (Array) | Type   | Description/Example |
| ---------------- | ------ | ------------------- |
| id               | Int    | Category ID         |
| name             | String | Category Name       |

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

## Get Shipping Channels

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get list of shipping channels.

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETSHIPPINGCHANNELS”       |
| limit                                     | Int    | Limit per page (Max = 2000) |
| page                                      | Int    | Page (Default = 1)          |
| version<mark style="color:red;">\*</mark> | String | 3                           |
| format                                    | String | json (Default), xml         |

#### Headers

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

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

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

| Shippingchannel (Array) | Type   | Description/Example   |
| ----------------------- | ------ | --------------------- |
| id                      | Int    | Shipping channel ID   |
| name                    | String | Shipping channel Name |

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

## Get Profile

<mark style="color:blue;">`GET`</mark> `https://api.zortout.com/api.aspx`

Get profile of merchant.

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETPROFILE”        |
| version<mark style="color:red;">\*</mark> | String | 3                   |
| format                                    | String | json (Default), xml |

#### Headers

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

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

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

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


# 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                  |
| token5<mark style="color:red;">\*</mark> | String | Your token (reference key) |
| token4                                   | String | Account name               |
| token3<mark style="color:red;">\*</mark> | String | apisecret                  |
| token2<mark style="color:red;">\*</mark> | String | apikey                     |

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

{% endtab %}
{% endtabs %}


# API Update

{% content-ref url="/pages/Mg5iX8FJsL1TJnfFCRjt" %}
[\[28 May 2023\] Update](/announcements/api-update/28-may-2023-update)
{% endcontent-ref %}

{% content-ref url="/pages/dDzII6M3BKx7qaiKfwqn" %}
[\[4 May 2023\] Important Update](/announcements/api-update/4-may-2023-important-update)
{% endcontent-ref %}

{% content-ref url="/pages/BI0WIYiEn5YomBv98UJr" %}
[\[1 May 2023\] Update](/announcements/api-update/1-may-2023-update)
{% endcontent-ref %}

{% content-ref url="/pages/yTuQvg1XDSoY5hYwzQIG" %}
[\[22 Mar 2023\] Update](/announcements/api-update/22-mar-2023-update)
{% endcontent-ref %}

{% content-ref url="/pages/gHmKVjR6uFcjTCcIpxeZ" %}
[\[16 Jan 2023\] Update](/announcements/api-update/16-jan-2023-update)
{% endcontent-ref %}

{% content-ref url="/pages/I9wgI0StcH5FyCH3q7Jd" %}
[\[20 Oct 2022\] Update](/announcements/api-update/20-oct-2022-update)
{% endcontent-ref %}

{% content-ref url="/pages/OEleBrVpxCEF2KShtu8p" %}
[\[7 Oct 2022\] Update](/announcements/api-update/7-oct-2022-update)
{% endcontent-ref %}


# \[28 May 2023] Update

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

> Add new shipment (Shopee Express) for booking shipment.

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

> Add new shipment labels for Flash Express, J\&T, Kerry and Shopee Express.


# \[4 May 2023] Important Update

**We will launch new API version 4 in 1 June 2023. We suggest you to develop new version instead of version 3.**

{% hint style="warning" %}
Please follow the new API version 4 as this link.\
<https://developers.zortout.com>
{% endhint %}

{% hint style="success" %}
However, the API version 3 is **still active**.
{% endhint %}

**How to change to V4**

1. Change endpoint URL to "**<https://open-api.zortout.com/v4>".**
2. Change **"method"** to path. Please follow each api method as **"**[**https://developers.zortout.com**](https://developers.zortout.com)**".**

{% hint style="info" %}
**Note :** JSON schema of all response is still same as API Version 3.
{% endhint %}

**Change Log**

1. API V4 is no longer not support **XML format**.
2. ["UPDATEPRODUCT"](https://developers-v3.zortout.com/api-reference/product#update-product) parameter is changed from "sku" in Body to "id" in path.
3. ["DELETEPRODUCT"](https://developers.zortout.com/api-reference/product#delete-product) parameter is changed from "sku" in Body to "id" in path.


# \[1 May 2023] Update

### [EDITORDER](/api-reference/order#edit-order)

> Add new API to edit order.

### [EDITPURCHASEORDER](/api-reference/purchase-order#edit-purchase-order)

> Add new API to edit purchase order.

### [EDITQUOTATIONINFO](/api-reference/quotation#edit-quotation-info)

> Add new API to edit quotation info.

### [EDITQUOTATION](/api-reference/quotation#edit-quotation)

> Add new API to edit quotation.

### [VOIDQUOTATION](/api-reference/quotation#void-quotation)

> Add new API to void quotation.


# \[22 Mar 2023] Update

### Add "properties" for getting api

> [GETORDERS](/api-reference/order#get-orders)
>
> [GETORDERDETAIL](/api-reference/order#get-order-detail)
>
> [GETPURCHASEORDERS](/api-reference/purchase-order#get-purchase-orders)
>
> [GETPURCHASEORDERDETAIL](/api-reference/purchase-order#get-purchase-order-detail)
>
> [GETPRODUCTS](/api-reference/product#get-products)
>
> [GETPRODUCTDETAIL](/api-reference/product#get-product-detail)
>
> [GETCONTACTS](/api-reference/contact#get-contacts)
>
> [GETCONTACTDETAIL](/api-reference/contact#get-contact-detail)

### Add "properties" for adding api

> [ADDORDER](/api-reference/order#add-order)\
> [ADDPURCHASEORDER](/api-reference/purchase-order#add-purchase-order)\
> [ADDPRODUCT](/api-reference/product#add-product)\
> [ADDCONTACT](/api-reference/contact#add-contact)

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

> Add saleschannel in parameter to filter sales channel.


# \[16 Jan 2023] Update

### [VERIFYORDERSLIP](/api-reference/order#verify-slip)

> Add new API to verify slip of order.
>
> Add "verifyslipid" parameter (optional) for [UPDATEORDERPAYMENT](/api-reference/order#update-order-payment) API.


# \[20 Oct 2022] Update

### Add "agent" for adding and editing order api

> [ADDORDER](/api-reference/order#add-order)
>
> [EDITORDERINFO](/api-reference/order#edit-order-info)


# \[7 Oct 2022] Update

### Add "Partial Transfer" status

> [GETORDERS](/api-reference/order#get-orders)
>
> [GETORDERDETAIL](/api-reference/order#get-order-detail)
>
> [GETPURCHASEORDERS](/api-reference/purchase-order#get-purchase-orders)
>
> [GETPURCHASEORDERDETAIL](/api-reference/purchase-order#get-purchase-order-detail)
>
> [GETRETURNORDERS](/api-reference/return-order#get-return-orders)
>
> [GETRETURNORDERDETAIL](/api-reference/return-order#get-return-order-detail)
>
> [GETRETURNPURCHASEORDERS](/api-reference/return-purchase-order#get-return-purchase-orders)
>
> [GETRETURNPURCHASEORDERDETAIL](/api-reference/return-purchase-order#get-return-purchase-order-detail)
>
> [GETTRANSFERS](/api-reference/transfer#get-transfers)
>
> [GETTRANSFERDETAIL](/api-reference/transfer#get-transfer-detail)


# \[29 Sep 2022] Update

### Add uniquenumber parameter

Add "Unique Number" to prevent duplicate transaction.

> [ADDORDER](/api-reference/order#add-order)
>
> [ADDPURCHASEORDER](/api-reference/purchase-order#add-purchase-order)
>
> [ADDTRANSFER](/api-reference/transfer#add-transfer)
>
> [ADDQUOTATION](/api-reference/quotation#add-quotation)
>
> [ADDINCOME](/api-reference/finance#add-income)
>
> [ADDEXPENSE](/api-reference/finance#add-expense)


# \[25 Sep 2022] Update

### [UPDATEINCOMEPAYMENT](/api-reference/finance#update-income-payment)

> Add new API to update payment of income.

### [UPDATEEXPENSEPAYMENT](/api-reference/finance#update-expense-payment)

> Add new API to update payment of expense.


# \[16 Sep 2022] Update

### Add Finance API

> [GETINCOMES](/api-reference/finance#get-incomes)
>
> [GETINCOMEDETAIL](/api-reference/finance#get-income-detail)
>
> [ADDINCOME](/api-reference/finance#add-income)
>
> [GETEXPENSES](/api-reference/finance#get-expenses)
>
> [GETEXPENSEDETAIL](/api-reference/finance#get-expense-detail)
>
> [ADDEXPENSE](/api-reference/finance#add-expense)


# \[25 Aug 2022] Update

### Add File Upload API

> [GETORDERFILES](/api-reference/file-upload#get-order-files)
>
> [GETORDERFILEDETAIL](/api-reference/file-upload#get-order-file-detail)
>
> [ADDORDERFILE](/api-reference/file-upload#add-file-to-order)
>
> [GETPURCHASEORDERFILES](/api-reference/file-upload#get-purchase-order-files)
>
> [GETPURCHASEORDERFILEDETAIL](/api-reference/file-upload#get-purchase-order-file-detail)
>
> [ADDPURCHASEORDERFILE](/api-reference/file-upload#add-file-to-purchase-order)

### Add Document API

> [GETDOCUMENTS](/api-reference/document#get-documents)


# \[15 Aug 2022] Update

### [GETORDERS](/api-reference/order#get-orders)/[GETORDERDETAIL](/api-reference/order#get-order-detail)

> Add integrationItemId and integrationVariantId to get Item Id and Variant Id of Integration.


# \[8 Aug 2022] Update

### [ADDBUNDLE](/api-reference/product#add-bundle)

> Add new API to add bundle.

### Webhook

> [DELETEORDER](/overview/webhook#deleteorder)
>
> [DELETEPURCHASEORDER](/overview/webhook#deletepurchaseorder)
>
> [DELETERETURNORDER](/overview/webhook#deletereturnorder)
>
> [DELETERETURNPURCHASEORDER](/overview/webhook#deletereturnpurchaseorder)


# \[3 Aug 2022] Update

### [UPDATEPARTIALORDER](/api-reference/order#update-partial-order)

> Add new API to update partial product of order.

### [UPDATEPARTIALPURCHASEORDER](/api-reference/purchase-order#update-partial-purchase-order)

> Add new API to update partial product of purchase order.

### [UPDATEPARTIALTRANSFER](/api-reference/transfer#update-partial-transfer)

> Add new API to update partial product of transfer.


# \[12 Jul 2022] Update

### Webhook for [Transfer](/overview/webhook#addtransfer)

> Add new webhook for Transfer.


# \[2 July 2022] Update

### Add Expense API

> [GETEXPENSEORDERDETAIL](/api-reference/order#get-expense-order-detail)
>
> [ADDEXPENSEWITHORDER](/api-reference/order#add-expense-order)
>
> [GETEXPENSEPURCHASEORDERDETAIL](/api-reference/purchase-order#get-expense-purchase-order-detail)
>
> [ADDEXPENSEWITHPURCHASEORDER](/api-reference/purchase-order#add-expense-purchase-order)


# \[8 June 2022] Update

### Add Quotation API

> [GETQUOTATIONS](/api-reference/quotation#get-quotations)
>
> [GETQUOTATIONDETAIL](/api-reference/quotation#get-quotation-detail)
>
> [ADDQUOTATION](/api-reference/quotation#add-quotation)
>
> [APPROVEQUOTATION](/api-reference/quotation#approve-quotation)


# \[23 May 2022] Update

### [UPDATEORDEREXPIRYLOT](/api-reference/order#update-order-expiry-lot)

> Add new API to update expiry/lot of order.

### [UPDATEPURCHASEORDERSERIALNO](/api-reference/purchase-order#update-purchase-order-serial-no)

> Add new API to update serial no of purchase order.

### [UPDATEPURCHASEORDEREXPIRYLOT](/api-reference/purchase-order#update-purchase-order-expiry-lot)

> Add new API to update expiry/lot of purchase order.


# \[3 May 2022] Update

### Webhook for [ReturnOrder](/overview/webhook#addreturnorder) and [ReturnPurchaseOrder](/overview/webhook#addreturnpurchaseorder)

> Add new webhook for ReturnOrder and ReturnPurchaseOrder.


# \[29 Apr 2022] Update

### [VOIDORDERPAYMENT](/api-reference/order#void-order-payment)/[VOIDPURCHASEORDERPAYMENT](/api-reference/purchase-order#void-purchase-order-payment)

> Add new API to delete payment of orders and purchase orders.


# \[12 Apr 2022] Important Update

{% hint style="danger" %}
Disable ~~**http**~~**&#x20;of api.zortout.com**
{% endhint %}

To follow security policy of PDPA, ZORT API will disable ~~**http**~~ of **api.zortout.com** on April 20, 2022 at 2:00 GMT+7.&#x20;

{% hint style="success" %}
If you use ~~**http**~~**://api.zortout.com**, please change to **<https://api.zortout.com>.**
{% endhint %}


# \[4 Apr 2022] Update

### [GETPRODUCTDETAIL](/api-reference/product#get-product-detail)/[GETBUNDLEDETAIL](/api-reference/product#get-bundle-detail)

> Add imageList to get list of image url.

### [GETCONTACTS](/api-reference/contact#get-contacts)

> Add imagepath to get contact image.

### [GETCONTACTDETAIL](/api-reference/contact#get-contact-detail)

> Add new API to get contact detail by id.


# \[14 Mar 2022] Update

### [GETPRODUCTDETAIL](/api-reference/product#get-product-detail)

> Add new API to get product detail by id.


# \[1 Mar 2022] Update

### [INCREASEPRODUCTSTOCKLIST](/api-reference/product#increase-product-stock-list)/[DECREASEPRODUCTSTOCKLIST](/api-reference/product#decrease-product-stock-list)

> Add new API to increase/decrease inventory of products.


# \[4 Feb 2022] Update

### [GETORDERS](https://developers.zortout.com/api-reference/order#get-orders)/[GETPURCHASEORDERS](/api-reference/purchase-order#get-purchase-orders)/[GETRETURNORDERS](/api-reference/return-order#get-return-orders)/[GETRETURNPURCHASEORDERS](/api-reference/return-purchase-order#get-return-purchase-orders)

> Add filter by created datetime and updated datetime.

| Parameters           | Description                   |
| -------------------- | ----------------------------- |
| createdatetimeafter  | Created Datetime After .....  |
| createdatetimebefore | Created Datetime Before ..... |
| updatedatetimeafter  | Updated Datetime After .....  |
| updatedatetimebefore | Updated Datetime Before ..... |


# \[4 Jan 2022] Update

### [GETORDERS](https://developers.zortout.com/api-reference/order#get-orders)/[GETORDERDETAIL](https://developers.zortout.com/api-reference/order#get-order-detail)

> Add bundleid and bundleitemid to OrderProduct model.

* bundleid : Bundle ID
* bundleitemid : ID of bundle group in product line.
* bundlenumber : Bundle Quantity

### [GETORDERDETAIL](https://developers.zortout.com/api-reference/order#get-order-detail)/[GETPURCHASEORDERDETAIL](https://developers.zortout.com/api-reference/purchase-order#get-purchase-order-detail)

> Add serialnolist and expirylotlist to OrderProduct and PurchaseOrderProduct model.

* serialnolist : Serial no List
* expirylotlist : Expiry lot List


# 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](https://1186964095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy2mqqkLHaBrRlyVX2UD4%2Fuploads%2FEffsqfeVvRyWpXA3fzXa%2Flazada_flow.jpg?alt=media\&token=80df5787-d5a0-43fa-bbd3-96bf587267cd)

#### ZORT x Shopee

![ZORT x Shopee Data](https://1186964095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy2mqqkLHaBrRlyVX2UD4%2Fuploads%2FztlUCZ9NsJAVTB9Jyn5K%2Fshopee_flow.jpg?alt=media\&token=802275e2-a850-41ef-9b8b-cb0e686c47d5)

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


