Download OpenAPI specification:
Public facing authentication API for anonymous users
Health check information for the auth service
{- "data": {
- "status": "pass",
- "version": "1.0",
- "releaseId": "1234567890",
- "service": "inventory",
- "details": {
- "time": "2023-11-15T12:19:05.737Z",
- "env": "dev",
- "commitId": "368de0fbdff3a5634895d69f8b17cbdfd5e77bfb"
}
}
}Automatically generates a JWT for an anonymous customer
| siteKey required | string The site key |
{- "data": {
- "jwt": "string"
}, - "context": {
- "siteKey": "specsavers-gb",
- "build": {
- "env": "dev",
- "releaseId": "911",
- "commitId": "3d13f3c6c4f017d66d2a9c16c566ffb11f05f32c"
}
}, - "metrics": {
- "durationMs": 0
}
}Logs the user out so no further authorised transactions can be performed with the provided token
| refreshToken | string The JWT token to be refreshed |
{- "data": {
- "message": "Validation failed",
- "code": "ValidationFailed",
- "errors": [
- "body.address.city is a required field",
- "body.address field has unspecified keys: email"
]
}, - "metrics": {
- "durationMs": 292.11
}, - "context": {
- "build": {
- "env": "dev",
- "releaseId": "409",
- "commitId": "aca0a2aa4af5a63f8f2f401792e26f59e7c1fa78"
}
}
}Refreshes the token supplied in the request cookie. If successful the returned cookie will contain the refreshed token.
| refreshToken required | string The JWT token to be refreshed |
{- "data": {
- "jwt": "string"
}, - "context": {
- "siteKey": "specsavers-gb",
- "build": {
- "env": "dev",
- "releaseId": "911",
- "commitId": "3d13f3c6c4f017d66d2a9c16c566ffb11f05f32c"
}
}, - "metrics": {
- "durationMs": 0
}
}Register a user
| siteKey required | string The site key |
| anonymousId | string The anonymousId of the customer before registering |
| email required | string |
| password required | string |
| title required | string |
| firstName required | string |
| lastName required | string |
| nationalHealthId | string |
| dateOfBirth required | string |
| gender required | string |
| phoneNumber required | string |
| marketingOptIn required | boolean |
{- "email": "string",
- "password": "string",
- "title": "string",
- "firstName": "string",
- "lastName": "string",
- "nationalHealthId": "string",
- "dateOfBirth": "string",
- "gender": "string",
- "phoneNumber": "string",
- "marketingOptIn": true
}{- "data": {
- "jwt": "string"
}, - "context": {
- "siteKey": "specsavers-gb",
- "build": {
- "env": "dev",
- "releaseId": "911",
- "commitId": "3d13f3c6c4f017d66d2a9c16c566ffb11f05f32c"
}
}, - "metrics": {
- "durationMs": 0
}
}Update the customer email
| siteKey required | string The site key |
| email required | string |
| commercetoolsId required | string |
{- "email": "string",
- "commercetoolsId": "string"
}{- "data": {
- "jwt": "string"
}, - "context": {
- "siteKey": "specsavers-gb",
- "build": {
- "env": "dev",
- "releaseId": "911",
- "commitId": "3d13f3c6c4f017d66d2a9c16c566ffb11f05f32c"
}
}, - "metrics": {
- "durationMs": 0
}
}