# GetOrderHistory

**Description**

Using filters we want to receive the orders of a customer. These orders will come directly from the ERP system and can contain our web orders but also orders placed in the shop or by phone.

Note that the orders should be returned in reversed order. The order history is shown on the shop in a paged manner. The first page contains the most recent orders with the latest order on top of the list.

The default number of orders on a page can be set to 20. Note that the the shop's design may define a different number so it is wise to make this parameter configurable.

## SOAP API:

**Action**

http://shoxl.com/ShoxlService/GetOrderHistory

{% hint style="info" %}
Please note: this is not a working url, but a combination of namespace and method. Do not expect the url to return a result.
{% endhint %}

**Style**

Document

## Input (Literal)

The input of this method is the document element tns:GetOrderHistory having the structure defined by the following table.

<table data-header-hidden><thead><tr><th width="167">Element</th><th>Type</th><th width="150">Occurs</th><th>Description</th></tr></thead><tbody><tr><td>Element</td><td>Type</td><td>Occurs</td><td>Description</td></tr><tr><td>Sequence</td><td></td><td>1..1</td><td></td></tr><tr><td>request</td><td>tns:GetOrderHistoryRequest</td><td>0..1</td><td></td></tr></tbody></table>

### _Complex Type: tns:GetOrderHistoryRequest_

**Description**

The GetOrderHistoryRequest contains all the information to get the orders of the

customer.

<table data-header-hidden><thead><tr><th width="186">Component</th><th width="150">Type</th><th width="155.26086956521738">Occurs</th><th>Description</th></tr></thead><tbody><tr><td>Component</td><td>Type</td><td>Occurs</td><td>Description</td></tr><tr><td>Sequence</td><td></td><td>1..1</td><td></td></tr><tr><td>AccountNumber</td><td>s:string</td><td>1..1</td><td>This is the (project) account number of the customer.</td></tr><tr><td>FilterType</td><td>s:int</td><td>0..1</td><td>The type of the filter: 1 = by OrderDate (yyyy/mm/dd), 2 = by order status code, 3 = customer order reference</td></tr><tr><td>FilterValue</td><td>s:string</td><td>0..1</td><td>The value for the given filter type</td></tr><tr><td>PageNumber</td><td>s:int</td><td>0..1</td><td>The number of the page. The page numbering is 1-based: first page has number 1.</td></tr></tbody></table>

Possible values for filtertype _“_&#x62;y order status cod&#x65;_”_ (2)

* Geleverd
* Deels geleverd
* Niet geleverd

## Output (Literal)

**tns:GetOrderHistoryResponse**

The output of this method is the document element tns:GetOrderHistoryResponse having the structure defined by the following table.

<table data-header-hidden><thead><tr><th width="191">Element</th><th>Type</th><th width="150">Occurs</th><th>Description</th></tr></thead><tbody><tr><td>Element</td><td>Type</td><td>Occurs</td><td>Description</td></tr><tr><td>Sequence</td><td></td><td>1..1</td><td></td></tr><tr><td>GetOrderHistoryResult</td><td>tns:GetOrderHistoryResult</td><td>0..1</td><td></td></tr></tbody></table>

### _Complex Type: tns:GetOrderHistoryResult_

**Description**

The GetOrderHistoryResult contains the orders of the customer using the given

filter.

<table data-header-hidden><thead><tr><th width="188">Component</th><th width="167">Type</th><th width="150">Occurs</th><th>Description</th></tr></thead><tbody><tr><td>Component</td><td>Type</td><td>Occurs</td><td>Description</td></tr><tr><td>Sequence</td><td></td><td>1..1</td><td></td></tr><tr><td>ErrorCode</td><td>s:string</td><td>0..1</td><td>An error code returned by the ERP system</td></tr><tr><td>ErrorDescription</td><td>s:string</td><td>0..1</td><td>The error description related to the error code returned by the ERP system</td></tr><tr><td>Orders</td><td>tns:ArrayOfOrderHistoryItem</td><td>0..1</td><td>A list of OrderHistoryItems, the ComplexType OrderHistoryItem contains some order details like; order date and order number. For the complete description check the OrderHistoryItem section in the documentation. The ERP will return 25 results as a maximum.</td></tr><tr><td>Request</td><td>tns:GetOrderHistoryRequest</td><td>1..1</td><td>The sent request by Shoxl Shop.</td></tr><tr><td>PageNumber</td><td>s:int</td><td>0..1</td><td>The number of the page.</td></tr><tr><td>TotalPages</td><td>s:int</td><td>0..1</td><td>Total number of pages with results</td></tr></tbody></table>

### _Complex Type: tns:ArrayOfOrderHistoryItem_

<table data-header-hidden><thead><tr><th width="194">Component</th><th width="193">Type</th><th width="150">Occurs</th><th>Description</th></tr></thead><tbody><tr><td>Component</td><td>Type</td><td>Occurs</td><td>Description</td></tr><tr><td>Sequence</td><td></td><td>1..1</td><td></td></tr><tr><td>OrderHistoryItem</td><td>tns:OrderHistoryItem</td><td>0..*</td><td></td></tr></tbody></table>

### _Complex Type: tns:OrderHistoryItem_

A OrderHistoryItem contains all the main information of an Order. To show on the order history overview page.

<table data-header-hidden><thead><tr><th width="196">Component</th><th width="150">Type</th><th width="167.53619302949062">Occurs</th><th>Description</th></tr></thead><tbody><tr><td>Component</td><td>Type</td><td>Occurs</td><td>Description</td></tr><tr><td>Sequence</td><td></td><td>1..1</td><td></td></tr><tr><td>JobNumber</td><td>s:string</td><td>0..1</td><td>The Jobnumber, given by the customer</td></tr><tr><td>OrderDate</td><td>s:dateTime</td><td>0..1</td><td>The order date</td></tr><tr><td>OrderState</td><td>s:int</td><td>0..1</td><td>Orderstate: 1 = open, 2 = closed. State should be derived form orderlinestates: 1 means 1 or more lines have state open or backorder, 2 means all lines have status shipped or cancelled.</td></tr><tr><td>OrderNumber</td><td>s:string</td><td>0..1</td><td>This the Shoxl Shop unique order number</td></tr><tr><td>TotalPriceExclVat</td><td>s:decimal</td><td>0..1</td><td>The total price of the order excluding VAT</td></tr><tr><td>TotalPriceInclVat</td><td>s:decimal</td><td>0..1</td><td>The total price of the order including VAT</td></tr><tr><td>Reference</td><td>s:string</td><td>0..1</td><td>This is the customer order reference</td></tr></tbody></table>

## REST API:

**URL:** /Shoxl/v1/GetOrderHistory\
**Method:** POST

**Request body:**

### &#x20;GetOrderHistoryRequest{

| parameter     | type                                        |
| ------------- | ------------------------------------------- |
| accountNumber | <p>string<br>required</p>                   |
| filterType    | <p>integer($int32)</p><p>nullable: true</p> |
| filterValue   | <p>string<br>nullable: true</p>             |
| pageNumber    | integer($int32)                             |

}

#### Example:

```
{
  "accountNumber": "string",
  "filterType": 0,
  "filterValue": "string",
  "pageNumber": 0
}
```

**Response body:**

### &#x20;GetOrderHistoryResult{

| parameter        | type                            |
| ---------------- | ------------------------------- |
| errorCode        | <p>string<br>nullable: true</p> |
| errorDescription | <p>string<br>nullable: true</p> |
| orders           | \[OrderHistoryItem]             |
| request          | GetOrderHistoryRequest          |
| totalPages       | integer($int32)                 |
| pageNumber       | integer($int32)                 |

}

#### &#x20;OrderHistoryItem{

| parameter         | type                                        |
| ----------------- | ------------------------------------------- |
| jobNumber         | <p>string<br>nullable: true</p>             |
| orderDate         | string($date-time)                          |
| orderNumber       | <p>string<br>nullable: true</p>             |
| orderState        | <p>integer($int32)</p><p>nullable: true</p> |
| reference         | <p>string<br>nullable: true</p>             |
| totalPriceExclVat | <p>number($double)</p><p>nullable: true</p> |
| totalPriceInclVat | <p>number($double)</p><p>nullable: true</p> |

}

#### Example:

```
{
  "errorCode": "string",
  "errorDescription": "string",
  "orders": [
    {
      "jobNumber": "string",
      "orderDate": "2021-07-21T12:55:00.826Z",
      "orderNumber": "string",
      "reference": "string",
      "totalPriceExclVat": 0,
      "totalPriceInclVat": 0,
      "orderState": 0
    }
  ],
  "request": {
    "accountNumber": "string",
    "filterType": 0,
    "filterValue": "string",
    "pageNumber": 0
  },
  "totalPages": 0,
  "pageNumber": 0
}
```
