---
title: "Records a page your front end showed for the store's analytics, with where the visitor came from on a visit's first page; call it from the visitor's browser."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo customer API › visit

`POST /v1/stores/{store}/visits`

## Authentication

Requires one of the following:

- `bearer`, http, header `Authorization`
- `publishableKey`, apiKey, in header, header `Publishable-Key`

## Path parameters

- `store` (`recordVisit.path.store`; string, required) — A hostname of the store.

## Request body

_Required._

Any of:

- `object`
- `object`
- `object`
- `object`

## Example request

```json
{
  "kind": "home",
  "landing": {
    "referrer": "string",
    "utm_source": "string",
    "utm_medium": "string",
    "utm_campaign": "string",
    "ref": "string",
    "device": "mobile"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/visits' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "kind": "home",
  "landing": {
    "referrer": "string",
    "utm_source": "string",
    "utm_medium": "string",
    "utm_campaign": "string",
    "ref": "string",
    "device": "mobile"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/visits';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    kind: 'home',
    landing: {
      referrer: 'string',
      utm_source: 'string',
      utm_medium: 'string',
      utm_campaign: 'string',
      ref: 'string',
      device: 'mobile'
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/customer/v1/stores/<store>/visits"

payload = {
    "kind": "home",
    "landing": {
        "referrer": "string",
        "utm_source": "string",
        "utm_medium": "string",
        "utm_campaign": "string",
        "ref": "string",
        "device": "mobile"
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Records a page your front end showed for the store's analytics, with where the visitor came from on a visit's first page; call it from the visitor's browser.

#### Example

```json
null
```

### default

A problem; see https://api.sherpo.io/customer/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`recordVisit.response.default.type`; string, required)
  - format `uri`
- `title` (`recordVisit.response.default.title`; string, required)
- `status` (`recordVisit.response.default.status`; integer, required)
- `detail` (`recordVisit.response.default.detail`; string, required)
- `code` (`recordVisit.response.default.code`; string, optional)
- `context` (`recordVisit.response.default.context`; object, optional)
- `reached_core` (`recordVisit.response.default.reached_core`; boolean, optional)
- `core_answer` (`recordVisit.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/customer-api/reference/record-visit/index.md
