> 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/return-purchase-order.md).

# Return Purchase Order

## Get Return Purchase Orders

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

Get list of return purchase orders.

#### Query Parameters

| Name                                      | Type   | Description                                                    |
| ----------------------------------------- | ------ | -------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>  | String | “GETRETURNPURCHASEORDERS”                                      |
| paymentbefore                             | String | <p>Paid Date Before .....<br>(yyyy-MM-dd)</p>                  |
| paymentafter                              | String | <p>Paid Date After .....<br>(yyyy-MM-dd)</p>                   |
| updatedbefore                             | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p>               |
| updatedafter                              | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>                |
| createdbefore                             | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p>               |
| createdafter                              | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>                |
| returnpurchaseorderdatebefore             | String | <p>Return Purchase Order Date Before .....<br>(yyyy-MM-dd)</p> |
| returnpurchaseorderdateafter              | String | <p>Return Purchase Order Date After .....<br>(yyyy-MM-dd)</p>  |
| version<mark style="color:red;">\*</mark> | String | 3                                                              |
| format                                    | String | json (Default), xml                                            |
| updatedatetimebefore                      | String | <p>Updated Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>     |
| updatedatetimeafter                       | String | <p>Updated Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>      |
| createdatetimebefore                      | String | <p>Created Datetime Before .....<br>(yyyy-MM-dd HH:mm)</p>     |
| createdatetimeafter                       | String | <p>Created Datetime After .....<br>(yyyy-MM-dd HH:mm)</p>      |
| createusername                            | String | Created by (Username)                                          |
| warehousecode                             | String | Warehouse Code                                                 |
| topaymentamount                           | Double | Maximum payment amount                                         |
| frompaymentamount                         | Double | Minimum payment amount                                         |
| toamount                                  | Double | Maximum amount                                                 |
| fromamount                                | Double | Minimum amount                                                 |
| limit                                     | Int    | Limit per page (Max = 2000)                                    |
| page                                      | Int    | Page (Default = 1)                                             |
| keyword                                   | String | Keyword to search                                              |

#### Headers

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

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

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

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

<table><thead><tr><th width="221.55578110023964">ReturnPurchaseOrderProduct (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>productid</td><td>Int</td><td>Product ID</td></tr><tr><td>sku</td><td>String</td><td>Product Sku</td></tr><tr><td>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr></tbody></table>

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

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

## Get Return Purchase Order Detail

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

Get return purchase order detail.

#### Query Parameters

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

#### Headers

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

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

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

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

<table><thead><tr><th width="200.080058224163">ReturnPurchaseOrderProduct (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>productid</td><td>Int</td><td>Product ID</td></tr><tr><td>sku</td><td>String</td><td>Product Sku</td></tr><tr><td>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr></tbody></table>

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

## Get Movement Return Purchase Order Detail

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

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

#### Query Parameters

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

#### Headers

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

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

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

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

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

## Get Movement Return Purchase Orders

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

Get movement list of products for return purchase orders.

#### Query Parameters

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

#### Headers

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

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

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

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

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

| Parameter | Type                                | Description/Example                         |
| --------- | ----------------------------------- | ------------------------------------------- |
| res       | Response                            | <p>Response Code <br>200- Success</p>       |
| list      | MovementReturnPurchaseOrder (Array) | Movement Return Purchase Order List (Array) |
| count     | Int                                 | Total movement order number by filter       |

## Add Return Purchase Order

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

Add return purchase order.

#### Query Parameters

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

#### Headers

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

#### Request Body

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

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

{% endtab %}

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

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

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

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

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

## Update Return Purchase Order Status

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

Update status of return purchase order.

#### Query Parameters

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

#### Headers

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

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

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

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

## Update Return Purchase Order Payment

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

Update payment of return purchase order.

#### Query Parameters

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

#### Headers

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

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

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

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

## Void Return Purchase Order

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

Void return purchase order.

#### Query Parameters

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

#### Headers

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

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

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

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

## Void Return Purchase Order Payment

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

Delete payment in return purchase order.

#### Query Parameters

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

#### Headers

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

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

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

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

## Add Return Purchase Order Tag

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

Add tag to return purchase order.

#### Query Parameters

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

#### Headers

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

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

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

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