# Agency Get Customers

API URI

```
https://api.versal.one/<uuid>
```

```
GET /agency/getCustomers
```

#### **Description**

This API allows fetching customer data for a specific company identified by its `uuid`. It returns customer information along with pagination details, such as the next and previous pages, if applicable.

---

#### **Request Headers**

<table id="bkmrk-header-type-descript"><thead><tr><th>Header</th><th>Type</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td>`Authorization`</td><td>String</td><td>JWT token for user authentication and authorization.</td><td>Required. Must be in the format `Bearer [token]`.</td></tr></tbody></table>

---

#### **Request Parameters**

<table id="bkmrk-field-type-descripti"><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td>`uuid`</td><td>String</td><td>UUID of the company whose customer data is to be fetched.</td><td>Required.</td></tr></tbody></table>

---

#### **Response Codes**

<table id="bkmrk-status-code-descript"><thead><tr><th>Status Code</th><th>Description</th></tr></thead><tbody><tr><td>`200`</td><td>Success. Customer data retrieved successfully.</td></tr><tr><td>`403`</td><td>Forbidden. Invalid HMAC signature.</td></tr><tr><td>`400`</td><td>Bad Request. Missing `uuid` parameter or unable to fetch customer limit data.</td></tr><tr><td>`404`</td><td>Not Found. No company found with the provided UUID.</td></tr><tr><td>`500`</td><td>Internal Server Error. An unexpected error occurred while fetching customer data.</td></tr></tbody></table>

---

#### **Example Requests**

**Request (Get Customers):**

```json

GET 53d1bcd3-aaf0-45e1-9298-5395b6a27b61/agency/getCustomers
Authorization: Bearer 5395b6a27b61

```

**Response (Customer Data Found - 200):**

```json

{
  "success": true,
  "message": "Customer data fetched successfully",
  "data": [
    {
      "id": "123",
      "name": "Customer A",
      "email": "customerA@example.com"
    },
    {
      "id": "124",
      "name": "Customer B",
      "email": "customerB@example.com"
    }
  ],
  "paging": {
    "before": 1,
    "after": 3
  }
}

```


**Response (Missing UUID - 400):**

```json

{
  "success": false,
  "message": "Bad Request: Missing uuid parameter"
}

```


**Response (No Company Found - 404):**

```json

{
  "success": false,
  "message": "No company found with the provided uuid"
}

```


**Response (Unable to Fetch Customer Limit - 400):**

```json

{
  "success": false,
  "message": "Unable to fetch customer limit data"
}

```


**Response (Invalid HMAC Signature - 403):**

```json

{
  "success": false,
  "message": "Forbidden: Invalid HMAC signature"
}

```


**Response (Internal Server Error - 500):**

```json

{
  "success": false,
  "message": "An unexpected error occurred while fetching the customers. Please try again later.",
  "error": "Error details here"
}

```


---

#### **Notes**

- **Authentication**: Ensure the JWT token is valid and authorized to access customer data.
- **Validation**: The `uuid` is a required parameter. Ensure it's included in the request.
- **Error Handling**: For any server errors (500), check the logs for detailed error information.
- **Paging**: The response includes paging information to navigate through customer data.