# 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;
