> For the complete documentation index, see [llms.txt](https://developers-v3.zortout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-v3.zortout.com/api-reference/purchase-order.md).

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