# Client Purchases

## Get the details of the purchases.

<mark style="color:blue;">`GET`</mark> `{API_URL}/client/purchases`

Auth required: YES

Please pass your API key as the username and API secret as the password as Basic Auth to access the endpoint

#### Query Parameters

| Name        | Type          | Description              |
| ----------- | ------------- | ------------------------ |
| userId      | String        | user id of the user      |
| email       | String        | email of the user        |
| phoneNumber | String        | phone number of the user |
| from        | ISODateString |                          |
| to          | ISODateString |                          |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

> You need to pass either phone number or email of the user from which hw has made the purcahse.

```json
{
    "transactionDetails": [
        {
            "promotional": false,
            "_id": "643e49dc2309ab30bc00ccf2",
            "userAccount": {
                "phoneNumber": "8712334265",
                "email": "bnnnn@gmail.com"
            },
            "clientId": {
                "name": "Demo Client"
            },
            "contentId": {
                "title": "Client-Story Id 1",
                "url": "https://csc-mock.netlify.app/5f92a62013332e0f667794dc/Client-Story-Id-1"
            },
            "buyingPrice": 319.21,
            "price": 399,
            "type": "PASS",
            "createdAt": "2023-04-18T07:42:20.749Z"
        }
    ],
    "pagination": {
        "pageNumber": 1,
        "pageSize": 10,
        "totalRecords": 1,
        "totalPages": 1
    }
}
```


---

# 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://docs.conscent.ai/integrating-with-apis/client-purchases.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.
