client-service (1.0.1)

Download OpenAPI specification:Download

The service provides capabilities to interact with the client’s stored data inside of BEAUTY_OS Core in MongoDB. This is used throughout the website to retrieve information about the client and interact with the client’s settings.

Clients

GetClients

Retrieves clients by given filter.

Authorizations:
jwt
query Parameters
salonId
required
string
skip
number <double>
Default: 0
top
number <double>
Default: 10
status
string (ClientStatus)
Enum: "CREATED" "ACTIVATED" "DELETED" "DEACTIVATED" "SUSPENDED"
search
string

Responses

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "records": [
    ]
}

CreateClient

Authorizations:
jwt
Request Body schema: application/json
firstName
required
string
lastName
required
string
phone
required
string
salonId
required
string
email
string
gender
string (Gender)
Enum: "Male" "Female" "Non-binary" "Transgender" "Intersex" "opt-out"

Possible values of Gender

pronouns
string
referredBy
string
clientType
string
birthday
string <date-time>
object (CreateAddressRequest)

Responses

Request samples

Content type
application/json
{
  • "firstName": "string",
  • "lastName": "string",
  • "phone": "string",
  • "salonId": "string",
  • "email": "string",
  • "gender": "Male",
  • "pronouns": "string",
  • "referredBy": "string",
  • "clientType": "string",
  • "birthday": "2019-08-24T14:15:22Z",
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

Login

Authenticates user to Okta account with username and password that user signed up to Okta.

Request Body schema: application/json

The object containing authentication credentials.

username
required
string

Username of the user should be email or phone number

salonId
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "salonId": "string"
}

Response samples

Content type
application/json
{
  • "id": "string"
}

VerifyLoginOTP

Verifies login OTP.

Request Body schema: application/json

The object containing OTP.

id
required
string

User or client id

otp
required
string

OTP

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "otp": "string"
}

Response samples

Content type
application/json
{
  • "status": "CREATED",
  • "accessToken": "string",
  • "client": {
    }
}

Logout

Logs out the current client by invalidating their JWT token.

Authorizations:
jwt

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

GetCurrentClient

Retrieves current client's data.

Authorizations:
jwt
header Parameters
client-id
required
string

Responses

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

PatchClient

Updates client's data by given ID.

Authorizations:
jwt
header Parameters
client-id
required
string
Request Body schema: application/json
firstName
required
string
lastName
required
string
phone
required
string
email
string
gender
string (Gender)
Enum: "Male" "Female" "Non-binary" "Transgender" "Intersex" "opt-out"

Possible values of Gender

pronouns
string
referredBy
string
clientType
string
birthday
string <date-time>
object (CreateAddressRequest)
status
string (ClientStatus)
Enum: "CREATED" "ACTIVATED" "DELETED" "DEACTIVATED" "SUSPENDED"
profileImage
string

Responses

Request samples

Content type
application/json
{
  • "firstName": "string",
  • "lastName": "string",
  • "phone": "string",
  • "email": "string",
  • "gender": "Male",
  • "pronouns": "string",
  • "referredBy": "string",
  • "clientType": "string",
  • "birthday": "2019-08-24T14:15:22Z",
  • "address": {
    },
  • "status": "CREATED",
  • "profileImage": "string"
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

GetClientById

Retrieves client's data by given ID.

Authorizations:
jwt
path Parameters
clientId
required
string

Responses

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

UpdateClient

Updates client's data by given ID.

Authorizations:
jwt
path Parameters
clientId
required
string
Request Body schema: application/json
firstName
required
string
lastName
required
string
phone
required
string
email
string
gender
string (Gender)
Enum: "Male" "Female" "Non-binary" "Transgender" "Intersex" "opt-out"

Possible values of Gender

pronouns
string
referredBy
string
clientType
string
birthday
string <date-time>
object (CreateAddressRequest)
status
string (ClientStatus)
Enum: "CREATED" "ACTIVATED" "DELETED" "DEACTIVATED" "SUSPENDED"
profileImage
string

Responses

Request samples

Content type
application/json
{
  • "firstName": "string",
  • "lastName": "string",
  • "phone": "string",
  • "email": "string",
  • "gender": "Male",
  • "pronouns": "string",
  • "referredBy": "string",
  • "clientType": "string",
  • "birthday": "2019-08-24T14:15:22Z",
  • "address": {
    },
  • "status": "CREATED",
  • "profileImage": "string"
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

DeleteClientById

Deletes client by given ID.

Authorizations:
jwt
path Parameters
clientId
required
string

Responses

Response samples

Content type
application/json
"string"

GenerateProfileImageUploadUrl

Generates a pre-signed URL for uploading a client's profile image to S3.

Authorizations:
jwt
path Parameters
clientId
required
string

The ID of the client

Request Body schema: application/json

The upload request containing filename and content type

filename
required
string
contentType
required
string

Responses

Request samples

Content type
application/json
{
  • "filename": "string",
  • "contentType": "string"
}

Response samples

Content type
application/json
{
  • "uploadUrl": "string",
  • "imageUrl": "string"
}

UpdateClientProfileImage

Updates only the profile image URL for a client.

Authorizations:
jwt
path Parameters
clientId
required
string

The ID of the client

Request Body schema: application/json

Object containing the profileImage URL

profileImage
required
string

Responses

Request samples

Content type
application/json
{
  • "profileImage": "string"
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

Clients(internal)

GetClientByEmail

Retrieves client's data by given email.

path Parameters
email
required
string

Represents the given email for an account holder.

Responses

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

ReactivateClientIfDeleted

Reactivates a client if they are deleted.

path Parameters
clientId
required
string

Represents the client ID.

Responses

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

GetClientsByIds

Retrieves clients' data by given array of IDs.

query Parameters
clientIds
required
Array of strings

Represents the array of client IDs as query parameters.

Responses

Response samples

Content type
application/json
{
  • "clients": [
    ]
}

GetClientById

Retrieves client's data by given ID.

path Parameters
clientId
required
string

Represents the given ID for an account holder.

Responses

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

CreateClientsFromPhoneNumbers

Creates new clients from a list of phone numbers.

Request Body schema: application/json

Represents the request body.

salonId
required
string
phoneNumbers
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "salonId": "string",
  • "phoneNumbers": [
    ]
}

Response samples

Content type
application/json
{
  • "clients": [
    ]
}

AddRatingToClient

Adds a rating to a client and updates their rating statistics.

Request Body schema: application/json

Represents the request body containing clientId and rating.

clientId
required
string
rating
required
number <double>

Responses

Request samples

Content type
application/json
{
  • "clientId": "string",
  • "rating": 0.1
}

Response samples

Content type
application/json
{
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "success": true
}

UpdateRatingForClient

Updates a rating for a client and recalculates their rating statistics.

Request Body schema: application/json

Represents the request body containing clientId, oldRating, and newRating.

clientId
required
string
oldRating
required
number <double>
newRating
required
number <double>

Responses

Request samples

Content type
application/json
{
  • "clientId": "string",
  • "oldRating": 0.1,
  • "newRating": 0.1
}

Response samples

Content type
application/json
{
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "success": true
}

NotifyBasketPaid

Notifies client service of a paid basket to update visit statistics.

Request Body schema: application/json

The paid basket data.

basketId
required
string
mainClientId
required
string
clientIds
required
Array of strings
salonId
required
string
amountPaid
required
number <double>
tipAmountPaid
required
number <double>
startDate
required
string <date-time>
endDate
required
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "basketId": "string",
  • "mainClientId": "string",
  • "clientIds": [
    ],
  • "salonId": "string",
  • "amountPaid": 0.1,
  • "tipAmountPaid": 0.1,
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1
}

GetOrCreateClientForFirebase

Gets or creates a client for Firebase authentication.

Request Body schema: application/json

The object containing username, salonId, and optional email/phone.

phone
string
email
string
salonId
required
string
username
required
string

Responses

Request samples

Content type
application/json
{
  • "phone": "string",
  • "email": "string",
  • "salonId": "string",
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "avgVisitValue": 0.1,
  • "avgVisit": 0.1,
  • "totalPaid": 0.1,
  • "visits": 0.1,
  • "totalReviews": 0.1,
  • "showRate": 0.1,
  • "status": "CREATED",
  • "address": {
    },
  • "birthday": "2019-08-24T14:15:22Z",
  • "clientType": "string",
  • "referredBy": "string",
  • "pronouns": "string",
  • "gender": "Male",
  • "phone": "string",
  • "email": "string",
  • "profileImage": "string",
  • "otp": "string",
  • "salonId": "string",
  • "username": "string",
  • "lastName": "string",
  • "firstName": "string",
  • "id": "string"
}

Comments

GetCommentsByClientId

Retrieves comments by client ID.

Authorizations:
jwt
query Parameters
clientId
required
string
skip
number <double>
Default: 0
top
number <double>
Default: 10
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
{
  • "top": 0.1,
  • "skip": 0.1,
  • "total": 0.1,
  • "comments": [
    ]
}

CreateComment

Creates a new comment.

Authorizations:
jwt
header Parameters
user-id
required
string
Request Body schema: application/json
comment
required
string
clientId
required
string
stylistSingleSalonId
string
salonId
required
string

Responses

Request samples

Content type
application/json
{
  • "comment": "string",
  • "clientId": "string",
  • "stylistSingleSalonId": "string",
  • "salonId": "string"
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "status": "ACTIVE",
  • "stylistFullName": "string",
  • "stylistSingleSalonId": "string",
  • "salonId": "string",
  • "clientId": "string",
  • "comment": "string",
  • "id": "string"
}

GetCommentById

Retrieves comment by given ID.

Authorizations:
jwt
path Parameters
commentId
required
string
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "status": "ACTIVE",
  • "stylistFullName": "string",
  • "stylistSingleSalonId": "string",
  • "salonId": "string",
  • "clientId": "string",
  • "comment": "string",
  • "id": "string"
}

UpdateComment

Updates comment by given ID.

Authorizations:
jwt
path Parameters
commentId
required
string
header Parameters
user-id
required
string
Request Body schema: application/json
comment
string
clientId
string
stylistSingleSalonId
string
salonId
string

Responses

Request samples

Content type
application/json
{
  • "comment": "string",
  • "clientId": "string",
  • "stylistSingleSalonId": "string",
  • "salonId": "string"
}

Response samples

Content type
application/json
{
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "status": "ACTIVE",
  • "stylistFullName": "string",
  • "stylistSingleSalonId": "string",
  • "salonId": "string",
  • "clientId": "string",
  • "comment": "string",
  • "id": "string"
}

DeleteCommentById

Deletes comment by given ID.

Authorizations:
jwt
path Parameters
commentId
required
string
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
"string"