# Verify storefront authentication

URL: https://docs.sparklayer.io/ignite/api/verify-authentication
Operation: `POST /v1/{siteEnv}/{siteId}/authentication/verify` (operationId `authenticationVerify`)
OpenAPI spec: https://docs.sparklayer.io/openapi/ignite.yaml

Verifies authentication data, such as a JWT, provided by the platform on the front end.

`POST /v1/{siteEnv}/{siteId}/authentication/verify`

> This is an Ignite endpoint: your integration service implements it and SparkLayer calls it.

### Request SparkLayer sends

```http
POST /v1/live/bobs-store/authentication/verify HTTP/1.1
Host: ignite.example.com
Content-Type: application/json

{
  "data": "<data>"
}
```

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `siteEnv` | string | Yes | The SparkLayer environment the request is for, such as `live`. Store it, with the site ID, when SparkLayer connects your platform. Example: `live` |
| `siteId` | string | Yes | The SparkLayer site ID the request is for, such as `bobs-store`. Store it, with the environment, when SparkLayer connects your platform. Length: min 1. Example: `bobs-store` |

### Request body (`application/json`) (required)

Data to verify. It must be possible to derive the platform external ID for the customer from this data in order to satisfy the response criteria.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | string | Yes | |

```json
{
  "data": "<data>"
}
```

### Responses your service returns

#### 200: Data is verified.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `customer` | object | | |
| `customer.external_id` | string | Yes | eCommerce platform ID of Customer |

```json
{
  "customer": {
    "external_id": "CU1234"
  }
}
```

#### 400: The request is invalid.

`application/problem+json`: the standard error body (below).

### Error body

Error responses with a body use this RFC 7807 problem details object. See [Errors](https://docs.sparklayer.io/developers/errors.md) for every status code and which errors to retry.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | string | | Human-readable detail of the error |
| `status` | integer | | HTTP Status code returned from API |
| `title` | string | | Human-readable summary of the error |
| `type` | string | | |
| `errors` | object[] \| null | | A list of errors related to the call |
| `errors[].code` | string | | Machine-readable error code |
| `errors[].property` | string | | The property the error relates to |
| `errors[].message` | string | | Human readable summary of the error |

```json
{
  "detail": "Data Validation Failed",
  "status": 400,
  "title": "invalid-api-request-contents",
  "type": "invalid-api-request-contents",
  "errors": [
    {
      "code": "resource-not-found",
      "property": "stock_location_id",
      "message": "stock_location_id not found"
    }
  ]
}
```
