# Get Shopper Information

Look up a shopper’s current and allowed spending limits.

**GET** `/api/paylater/merchant-portal/v2/web-checkout/shopper`

- Sandbox: `https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/shopper`
- Production: `https://connect.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/shopper`

> **Info: Authentication**
>
> All requests require a bearer token from the [OAuth 2.0 token endpoint](https://docs.paylaterapp.com/authentication.html). Pass it as `Authorization: Bearer <ACCESS_TOKEN>`.

## Request

#### Headers

| Header | Value |
| --- | --- |
| `Authorization` | `Bearer <ACCESS_TOKEN>` |

**Query parameters**

- `mobile_number` (String, required): Shopper’s mobile number.
- `email` (String, required): Shopper’s email address.

### Example request

**cURL**

```bash
curl --location 'https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/shopper?mobile_number=97412345678&email=test@sample.com' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'
```

**Node.js**

```javascript
const params = new URLSearchParams({
  mobile_number: '97412345678',
  email: 'test@sample.com',
});

const res = await fetch(
  `https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/shopper?${params}`,
  {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${accessToken}`,
    },
  },
);

const shopper = await res.json();
```

**Python**

```python
import requests

resp = requests.get(
    "https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/shopper",
    headers={
        "Authorization": f"Bearer {access_token}",
    },
    params={
        "mobile_number": "97412345678",
        "email": "test@sample.com",
    },
)

shopper = resp.json()
```

**PHP**

```php
$query = http_build_query([
    'mobile_number' => '97412345678',
    'email' => 'test@sample.com',
]);

$ch = curl_init('https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/shopper?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $accessToken,
    ],
]);

$response = json_decode(curl_exec($ch), true);
```

## Response

A `200 OK` returns the shopper’s identifiers and spending limits.

**200 OK**

```json
{
  "shopperId": "uuid",
  "email": "test@sample.com",
  "mobileNumber": "97412345678",
  "currentSpendingLimit": 925.0,
  "allowedSpendingLimit": 4000.0
}
```

## Errors

```json
{
  "message": "Shopper not found"
}
```

```json
{
  "message": "Missing API key in request headers"
}
```

See [Error handling & response codes](https://docs.paylaterapp.com/errors.html) for the full catalogue.
