> For the complete documentation index, see [llms.txt](https://developers.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.zortout.com/api-reference/purchase-order.md).

# Purchase Order

## Get Purchase Orders

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

Get list of purchase orders.

#### Query Parameters

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

#### Headers

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

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

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

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

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

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

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

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

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

## Get Purchase Order Detail

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

Get purchase order detail.

#### Query Parameters

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

#### Headers

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

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

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

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

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

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

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

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

## Get Movement Purchase Order Detail

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

Get movement list of products according to each purchase order.

#### Query Parameters

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

#### Headers

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

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

<table><thead><tr><th>MovementPurchaseOrder (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>id</td><td>Int</td><td>ID</td></tr><tr><td>list</td><td>PurchaseOrderProduct (Array)</td><td>Product List</td></tr><tr><td>actionDate</td><td>Date (Array)</td><td>List of action date</td></tr><tr><td>actionDateString</td><td>String (Array)</td><td>List of action date text <br>(yyyy-MM-dd)</td></tr><tr><td>purchaseorderid</td><td>Int</td><td>Purchase Order ID</td></tr></tbody></table>

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

{% endtab %}
{% endtabs %}

## Get Movement Purchase Orders

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

Get movement list of products for purchase orders.

#### Query Parameters

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

#### Headers

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

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

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

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

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

{% endtab %}
{% endtabs %}

## Get Expense Purchase Order Detail

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

Get list of expenses of purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Add Purchase Order

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

Add purchase order.

#### Query Parameters

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

#### Headers

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

#### Request Body

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

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

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

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

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

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

{% endtab %}
{% endtabs %}

## Update Purchase Order Status

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

Update status of purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Update Purchase Order Payment

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

Update payment of purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Update Partial Purchase Order

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

Update partial product of purchase order.

#### Query Parameters

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

#### Headers

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

#### Request Body

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

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

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

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

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

{% endtab %}
{% endtabs %}

## Edit Purchase Order Info

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

Edit purchase order info.

#### Query Parameters

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

#### Headers

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

#### Request Body

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

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

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

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

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

{% endtab %}
{% endtabs %}

## Edit Purchase Order

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

Edit purchase order.

#### Query Parameters

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

#### Headers

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

#### Request Body

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

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

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

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

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

{% endtab %}
{% endtabs %}

## Void Purchase Order&#x20;

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

Void purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Void Purchase Order Payment

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

Delete payment in purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Update Purchase Order Serial No

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

Update serial number of purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Update Purchase Order Expiry/Lot

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

Update expiry/lot of purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Add Expense Purchase Order

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

Add expense to purchase order.

#### Query Parameters

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

#### Headers

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

#### Request Body

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

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

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

## Add Purchase Order Tag

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

Add tag to purchase order.

#### Query Parameters

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

#### Headers

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

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

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

## Delete Purchase Order Tag

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

Delete tag of purchase order.

#### Query Parameters

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

#### Headers

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

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

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