> For the complete documentation index, see [llms.txt](https://developers.airship.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.airship.co.uk/basics/search-contact/search-pops-by-contact.md).

# Search PoPs by contact

The get PoP by date will allow you to see all PoPs for a specific contact, and the associated Purchase, Booking, WIFI interaction details.

## Configuration

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

```
https://api.airship.co.uk/v1/pop/by_date
```

{% endtab %}
{% endtabs %}

#### Headers

<table><thead><tr><th width="252.49999999999997">Field</th><th>Notes</th></tr></thead><tbody><tr><td><code>Authentication</code> (bearer token)</td><td>The authentication token is linked to the account that you are searching bookings in. If you are unsure of what your Authentication token is, ask our support team to confirm.</td></tr></tbody></table>

#### Body

<table><thead><tr><th width="176.49999999999997">Field</th><th>Notes</th></tr></thead><tbody><tr><td>account_id</td><td>The account ID represents the account that you are searching bookings in. If you are unsure of what your account ID is, ask our support team to confirm.</td></tr><tr><td>contact_id</td><td>Contact ID which you want to perform a PoP Search on</td></tr><tr><td>start_date</td><td>Start date to search for a PoP<br><br><em>Required</em></td></tr><tr><td>end_date</td><td>End date to search for a PoP<br><br><em>Required</em></td></tr><tr><td>types</td><td>Array of PoP types, you can add;<br><br>- purchases<br>- wifi<br>- booking<br><br><em>Required</em></td></tr></tbody></table>

### Example request

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

```json
{
    "account_id": 2,
    "contact_id": 90357243,
    "start_date": "2023-01-03",
    "end_date": "2023-09-03",
    "types" : ["purchases", "booking", "wifi"]
}
```

{% endtab %}

{% tab title="Response (200)" %}

```json
{
    "purchases":
    [
        {
            "transaction_lines":
            [
                {
                    "id": 21811807,
                    "description": "TYRRELLS SEA SALT &",
                    "sku": "8507",
                    "quantity": "-1",
                    "value": "1.29"
                },
                {
                    "id": 21811808,
                    "description": "LATTE REGULAR 12oz",
                    "sku": "3001",
                    "quantity": "1",
                    "value": "3.00"
                }
            ],
            "unit_name": "The shack",
            "id": 4753469,
            "contact_id": "90357243",
            "transaction_reference": "wqeqweqeqw-1c96-44fd-bc98-4dab1248ebd2",
            "unit_id": "13835",
            "provider_id": "1",
            "order_type_id": "1",
            "transaction_date": "2023-07-04 12:11:58"
        }
    ],
    "booking":
    {
        "current_page": 1,
        "data":
        [],
        "first_page_url": "https://api.airship.co.uk/v1/pop/by_date?page=1",
        "from": null,
        "last_page": 1,
        "last_page_url": "https://api.airship.co.uk/v1/pop/by_date?page=1",
        "next_page_url": null,
        "path": "https://api.airship.co.uk/v1/pop/by_date",
        "per_page": 100,
        "prev_page_url": null,
        "to": null,
        "total": 0
    },
    "wifi":
    {
        "current_page": 1,
        "data":
        [],
        "first_page_url": "https://api.airship.co.uk/v1/pop/by_date?page=1",
        "from": null,
        "last_page": 1,
        "last_page_url": "https://api.airship.co.uk/v1/pop/by_date?page=1",
        "next_page_url": null,
        "path": "https://api.airship.co.uk/v1/pop/by_date",
        "per_page": 100,
        "prev_page_url": null,
        "to": null,
        "total": 0
    }
}
```

{% endtab %}

{% tab title="Response (422)" %}

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "contact_id": [
            "This contact does not belong to this account"
        ]
    }
}
```

{% endtab %}
{% endtabs %}

The results will return the PoPs by type, in an array if there are more than 1 interaction within that range&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.airship.co.uk/basics/search-contact/search-pops-by-contact.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
