# Search

The “Search” endpoint shows results of the search expression so that the <<glossary:Agent Inbox>> agent can see all known orders, customers and conversations relating to the search keyword.

`GET https://example.com/search?<yourExpression>=$Expression`

## Parameters

| Name        | Required | Description                                                                            |
| :---------- | :------- | :------------------------------------------------------------------------------------- |
| $Expression | Yes      | The search expression filled in the <<glossary:Agent Inbox>> Search field by the agent |

## Response body

```json
{
    "customers": 
    [
        {
            "email_address": "email@example.com",
            "name": "Fullname",
            "phone_number": "+31612345678",
            "order_count": "1",
            "total_spent": "€123,45"
        }
    ],
    "orders": 
    [
        {
            "email_address": "email@example.com",
            "order_number": "CM1234",
            "order_date": "2021-01-12T12:34:56Z",
            "revenue": "€12,34",
            "name": "Fullname"
        }
    ]
}							
```

## Response body with no results

If there is no customer or an order for the expression, make sure you response with the an empty array for customers and/or orders.

```json
{
    "customers": 
    [],
    "orders": 
    []
}							
```

## Response schema

| Name           | Type   | Required | Description                                                             |
| :------------- | :----- | :------- | :---------------------------------------------------------------------- |
| customers      | Array  | Yes      | Customer specific contact details                                       |
| email\_address | String | Yes      | E-mail of the customer which resembles the search expression            |
| name           | String | Yes      | Name of the customer                                                    |
| phone\_number  | String | Yes      | Phone number of the customer                                            |
| order\_count   | String | Yes      | Total amount of orders the customer has                                 |
| total\_spent   | String | Yes      | Total amount of money the customer has spent                            |
| orders         | Array  | Yes      | Array which contains order details that resembles the search expression |
| email\_address | String | Yes      | The email address of the customer who filled in the order               |
| order\_number  | String | Yes      | Number from the order                                                   |
| order\_date    | String | Yes      | Date of the order                                                       |
| revenue        | String | Yes      | Total amount of money that the order resembles                          |
| name           | String | Yes      | Name of the customer that has filled in the order                       |