# Return Order

## Get Return Orders

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

Get list of return orders.

#### Query Parameters

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

#### Headers

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

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

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

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

<table><thead><tr><th width="183.8957761593581">ReturnOrderProduct (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>productid</td><td>Int</td><td>Product ID</td></tr><tr><td>sku</td><td>String</td><td>Product Sku</td></tr><tr><td>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr></tbody></table>

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

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

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

{% endtab %}
{% endtabs %}

## Get Return Order Detail

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

Get return order detail

#### Query Parameters

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

#### Headers

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

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

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

<table><thead><tr><th>ReturnOrderProduct (Array)</th><th width="150">Type</th><th>Description/Example</th></tr></thead><tbody><tr><td>productid</td><td>Int</td><td>Product ID</td></tr><tr><td>sku</td><td>String</td><td>Product Sku</td></tr><tr><td>name</td><td>String</td><td>Product Name</td></tr><tr><td>number</td><td>Double</td><td>Product Quantity</td></tr><tr><td>unittext</td><td>String</td><td>Unit</td></tr><tr><td>pricepernumber</td><td>Double</td><td>Product Price/Quantity</td></tr><tr><td>pricepernumber_pretax</td><td>Double</td><td>Pretax Product Price/Quantity</td></tr><tr><td>pricepernumber_vat</td><td>Double</td><td>Product Vat/Quantity</td></tr><tr><td>discount</td><td>String</td><td>Discount Per Unit</td></tr><tr><td>discountamount</td><td>Double</td><td>Total discount of product line.</td></tr><tr><td>discountamount_pretax</td><td>Double</td><td>Total pretax discount of product line.</td></tr><tr><td>discountamount_vat</td><td>Double</td><td>Total discount vat of product line.</td></tr><tr><td>totalprice</td><td>Double</td><td>Total Price</td></tr><tr><td>totalprice_pretax</td><td>Double</td><td>Pretax Total Price</td></tr><tr><td>totalprice_vat</td><td>Double</td><td>Total Vat</td></tr></tbody></table>

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

## Get Movement Return Order Detail

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

Get movement list of products according to each return order.

#### Query Parameters

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

#### Headers

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

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

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

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

## Get Movement Return Orders

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

Get movement list of products for return orders.

#### Query Parameters

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

#### Headers

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

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

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

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

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

## Add Return Order

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

Add return order.

#### Headers

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

#### Request Body

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

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

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

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

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

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

{% endtab %}
{% endtabs %}

## Update Return Order Status

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

Update status of return order.

#### Query Parameters

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

#### Headers

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

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

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

## Update Return Order Payment

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

Update payment of return order.

#### Query Parameters

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

#### Headers

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

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

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

## Void Return Order&#x20;

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

Void return order.

#### Query Parameters

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

#### Headers

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

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

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

## Void Return Order Payment

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

Delete payment in return order.

#### Query Parameters

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

#### Headers

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

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

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

## Add Return Order Tag

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

Add tag to return order.

#### Query Parameters

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

#### Headers

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

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

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

## Delete Return Order Tag

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

Delete tag of return order.

#### Query Parameters

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

#### Headers

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

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.zortout.com/api-reference/return-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
