Documentation updated: 2026-09-16

This is official API for integration external applications with AI Helps products Beauty Pro and Fitness Pro.

API tends to follow REST principles.

API root URL for HTTP requests is: https://api.aihelps.com/v1/

API status page: https://api.aihelps.com/status

Questions about API: https://t.me/joinchat/J1-qj0gTp_i6EmE2rtvGvw (Telegram channel)

AI Helps API consultant: https://chatgpt.com/g/g-69a06e7b02908191818b18d2b77f1f40-ai-helps-api-consultant

About API

Getting started

To obtain credentials for a test sandbox:

  1. Contact AI Helps or your account manager to register an application via CRM (or ask support at api@aihelps.com).
  2. You receive application_id and application_secret (shown once - keep the secret safe).
  3. The databases field on the application limits which database codes the app may access (use test database codes for sandbox).
  4. Call GET /auth/application, then GET /auth/database with a test database_code to obtain a database access token.
  5. Each new application is reviewed before production access is granted.
  6. Choose appropriate Scopes when registering - they determine which endpoints your application can call.

Data history limit

By default, historical data available through the API is limited to the last 2 months. This applies to appointments and appointment items, sales, client history (GET /clients/{id}/history), client change logs (GET /clients/changeLogs), appointment change logs (GET /appointments/changeLogs), and dashboard reports. If you need older data, contact AI Helps support individually.

API versioning

Current API version is "Version 1". Version information is mandatory in API URL and described as v{number}, where {number} is integer, starting from 1 (current version is 1).

Versioning rules are following:

  1. New API methods can be added without incrementing version number.
  2. New parameters can be added to existing API methods if they don"t change API behavior with these new parameters missing.
  3. Changing API URLs, parameters names or their behaviour will increment version number.
  4. Removing some API URLs or parameters names will increment version number.

These rules guarantee that code, working with specific API version won"t broke on minor changes made. All changes that potentially can break code will be presented in new version.

Last API version is considered "public". All developers will be notified about API version incremented, if they provided contact_email (see Application account section).
Old API version will be available at least 2 months (it can happens that several old versions will be available) and this period can be extended by request.

All ideas, errors and propositions can be sent to Telegram channel https://t.me/joinchat/J1-qj0gTp_i6EmE2rtvGvw.

HTTPS protocol

All API available only through HTTPS (HTTP not available for both public/private API).

Current server supports TLS 1.0, 1.1 and 1.2 (SSL 1-3 commonly recognized vulnerable)

REST API with extensions

Current API implementation uses REST API guidelines. According to idea, that in most cases API is used for both get/update data, in many cases with local store, resources representation seems to be better choice than GraphQL "mostly read with complex views" idea and gRPC "all is call" idea (more useful in some-transaction-like APIs). According to that, REST API seems to be the most natural way for our API, taking into account our specifics, GraphQL has some promising features can be useful and gRPC usage is far from our case, so we didn't took it into account.

So, AI Helps API fulfills REST principles: client-server, stateless, cacheable (not important in our case), uniform interface and layered system.
Resources are identified in /resources/{id} way (subresources /resources/{id}/subresources/{id2} and so on), methods to work with resources are GET, POST, PUT and DELETE.

API URI usually represents either list of resources (e.g. \clients) or specific resource from list, given by id (e.g. \clients\{id}).
Next table describes what methods can be used to operate with data:

API url GET POST PUT DELETE
List of resources (e.g. \clients) get all resources create new resource nothing nothing
Specific resource (e.g. \clients\{id}) get resource by id nothing update resource delete resource

Not all methods will be available for all lists or resources, see detailed documentation below.
If method not available for given API URL, response with HTTP status code 404 (Not Found) will be returned.

We also took best ideas from GraphQL and implemented in our API:

  1. While retrieving data you forced to pass fields you want to get. This idea gives more efficient data loading and easier API usage - even if we add extra fields, you will not receive them until explicitly requested.
  2. To add or update resource you can pass only part of fields - you do not need to pass all fields. While update, non-passed fields will leave unchanged (so, no more need for PATCH method). This greatly simplifies API usage and decrease API complexity. Along with previous idea this makes API much more flexible and easy to use (non-fixed data structure).
  3. In some situations API can be used mostly to read complex data without close to zero changes. So we added complex read-only or read-write fields to our resources. Such "fields" can be retrieved and updated in same request with main resource, greatly decreasing complexity of client code, number of requests and speed. These "fields" are specific for each resource and fine-tuned for speed (contrary to GraphQL where complex structure is hard to tune), still reach enough to satisfy client needs.
  4. We also implemented subscription for changes for all resources in API with WebHooks.

May be in future we also will add GraphQL wrapper around our REST API, so you will be able to use GraphQL client libraries.

Data format

All API methods use JSON for both input and output. For some requests (all GET requests) body not needed, for DELETE server returns nothing.

For retrieving images, where response will be image itself, for updating image request body is image itself.

ContentType (application/json) is not mandatory for requests and can be skipped, but server always return content type
(application/json for 200/201 responces (do not return content type for 204 (No content)) and image/jpeg or image/png for images).

XML not supported now and no plans to support it in future.

All API requests should use UTF-8 encoding, all responses also in UTF-8.

We recommend you use Postman to test our API.
//https://www.getpostman.com/

Data types

All items in response/request are JSON objects, each field can be either simple type shown below or array/set of subitems.

In requests and responses following simple data types can be used:

  • string - formatted as simple JSON string ("abc"). Empty string can be represented either as null or empty string. API always returns empty string as null. String parameters can be marked as required, that means null or empty string are not allowed for such strings and all required fields should be provided on creating new item.
  • number - formatted as simple JSON number (12.3)
  • boolean - formatted as simple JSON true or false (true)
  • identifier - all identifiers are represented as GUIDs. Should be formatted as string
    with 36 characters: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX". Empty identifier can be
    represented either as null, empty string or "00000000-0000-0000-0000-000000000000"
    API always returns empty identifier as null.
  • datetime - is represented in ISO 8601 Extended format "YYYY-MM-DDTHH:mm:ss.sssZ".
    T - delimiter char; milliseconds shown, but in this API wlll always be zero; timezone is always UTC ("Z" char). E.g. "2017-01-01T13:51:55.000Z".
    This format is native for Javascript and used in Date.toJSON(), Date.parse(). API also can receive dates in several other formats, full list of available incoming formats (but output is still always the same):
    • "YYYY-MM-DD"
    • "YYYY-MM-DDTHH:mm"
    • "YYYY-MM-DDTHH:mm:ss"
    • "YYYY-MM-DDTHH:mm:ss.sss"
    • "YYYY-MM-DDTHH:mm:ss.sssZ"
  • image - in JSON formatted as base64, usually can be retrieved by direct link
  • html_text - text with additional html tags, used to format that text. There are some differences with a valid html document
    • There is no <!DOCTYPE html> comment
    • Content should not be wrapped with <html> or <head> or <body> tags
    • Content should contains only one of these kind of nodes:
      • #text - contains plain text
      • <span> - can contain style attribute, which can contain these CSS declarations:
        • font-weight: bold - for bold text
        • font-style: italic - for italic text
        • text-decoration: underline - for underlined text
        • color: #FF0000 - text color. There can be any HEX-value color
      • <h1>, <h2>, <h3> - describes font size, can contains the same CSS declarations, as <span> node. Note, that headlines will be considered as NOT bold
      • <div> - describes paragraph with alignment. <div> should not contain another <div> inside it. Left-aligned text should NOT be wrapped with <div> tags. Alignment is set using style attribute, which contains one of two CSS declarations:
        • text-align: center - centered text
        • text-align: right - right-aligned text
      • <br/> - line break

Get list of items format

In current and next sections someitems in URL will describe clients, products, sales or any other item type.

Request: GET /someitems?fields=field_list[&filter1=value1&filter2=value2&..]

Get someitems with fields specified in fields parameter (required parameter).

Example of fields parameter:
fields=field1,field2,field_set3(subfield1,subfield2,..),..
If some field is array/set, use parentheses to describe subfields. If some subfield is also array/set, use parentheses again: e.g.
fields=id,name,history(date,name),relatives(name,history(date,name))

Each item has unique id (identifier). id can be used in API URL for GET/PUT/DELETE operations. id field is always returned,
no need to specify it in fields parameter.
If you specify fields parameter empty, only ids will be returned.

If filter values are set, filters applied. More details about filters will be provided in specific filter description.

For all items list there is one universal filter: ids - provide list of ids, separated by comma, only items with provided ids will be returned.

Response example:

[
        {
            "id": "246db366-061f-45ac-984d-de8050c045a1",
            "name": "Item 1",
            "type": "Simple",
            "color": "Red"
        },
        {
            "id": "905e5ff6-9d41-465b-aced-7ea81a7e2ee3",
            "name": "Item 2",
            "type": "Complex",
            "color": "Green"
        },
        {
            "id": "cfbb963e-3ceb-4764-b3f4-805f3a3e056b",
            "name": "Item 3",
            "type": "Simple",
            "color": "Yellow"
        }
]

Items in response are sorted either by field "name" or field "date" (if "name" not exists, any item has either "name" or "date" fields).

Get item by id format

Request: GET /someitems/{id}?fields=field_list

Get item with given id and fields specified in fields parameter (required parameter).

Example of fields parameter:
fields=field1,field2,field_set3(subfield1,subfield2,..),..
If some field is array/set, use parentheses to describe subfields. If some subfield is also array/set, use parentheses again: e.g.
fields=id,name,history(date,name),relatives(name,history(date,name))

id field is always returned, no need to specify it in fields parameter.

Response example:

{
    "id": "ecb3521a-3b50-4281-b947-34e7ca526b28",
    "name": "Item 1",
    "type": "Simple",
    "color": "Red"
}

Create new item format

Request: POST /someitems

{
    "name": "Item 4",
    "type": "Simple",
    "color": "Blue",
    "category": "8c98a00b-1526-4dc0-9968-008439a78019"
}

Not all fields should be specified - missing fields will be initialized with default values.

Response will return status 201 (not 200) and id of newly created item:

{
    "id": "1bfcf663-3f5d-4a86-8e0c-12c5ea34c137"
}

In some cases after item was created, some items fields except id needed. Making another GET request
(GET /someitems or GET /someitems/{id}) seems redundant. While making original request you can just describe
fields you want to receive in fields parameter (optional):

Request: POST /someitems?fields=name,type,color,category

{
    "name": "Item 4"
}

Response will look like:

{
    "id": "1bfcf663-3f5d-4a86-8e0c-12c5ea34c137",
    "name": "Item 4",
    "type": "Simple",
    "color": "",
    "category": null
}

Update item format

Request: PUT /someitems/{id}

{
    "type": "Complex"
}

Not all fields should be specified - missing fields will left field values unchanged.

In some cases after item was updated, some fields are needed. Making another GET request
(GET /someitems or GET /someitems/{id}) seems redundant. While making original request you can just describe
fields you want to receive in fields parameter (optional). Server always returns id of updated item
and fields of fields parameter if specified:

Request: PUT /someitems/{id}?fields=name,type,color,category

{
    "type": "Complex"
}

Response will look like:

{
    "id": "1bfcf663-3f5d-4a86-8e0c-12c5ea34c137",
    "name": "Item 1",
    "type": "Complex",
    "color": "Red",
    "category": null
}

Delete item format

Request: DELETE /someitems/{0}

(no body needed)

For DELETE requests JSON body is not needed and no body can be sent at all.

Response: status 204 (No content)

Operations with categories

Categories are present for several items types (products, services, groups, etc.), they are special
object types thus can be edited using special methods.

Each category 2 fields (except id):

  • name - category name,
  • parent - id of parent category.

Categories helps to make multi level hierarchies, like:

+ Top category (virtual)
    + Item 1
    + Category 1
        + Item 2
        + Subcategory 1
            + Item 3

Get list of categories format

Request: GET /someitems/categories?fields=field_list[&filter1=value1&filter2=value2&..]

Get categories with fields specified in fields parameter (required parameter). If filter values are set, filters applied.

Response example:

[
        {
            "id": "246db366-061f-45ac-984d-de8050c045a1",
            "name": "Subcategory 1",
            "parent": "8c98a00b-1526-4dc0-9968-008439a78019"
        },
        {
            "id": "5c8316ef-68fb-47d4-b99a-ef715a60bd16",
            "name": "Subcategory 2",
            "parent": "8c98a00b-1526-4dc0-9968-008439a78019"
        }
]

All categories in response are sorted by field "name".

Get category by id format

Request: GET /someitems/categories/{id}?fields=field_list

Get category with given id with fields specified in fields parameter (required parameter).

Response example:

{
    "id": "246db366-061f-45ac-984d-de8050c045a1",
    "name": "Subcategory 1",
    "parent": "8c98a00b-1526-4dc0-9968-008439a78019"
}

Create new category format

Same to creating new items:

Request: POST /someitems/categories

{
    "name": "Category 2",
    "parent": "8c98a00b-1526-4dc0-9968-008439a78019"
}

Not all fields should be specified - missing fields will be initialized with default values.

Response will return status 201 (not 200) and id of newly created category:

{
    "id": "1bfcf663-3f5d-4a86-8e0c-12c5ea34c137"
}

If some category fields except id is needed, you can just describe fields you want to receive in fields parameter (optional):

Request: POST /someitems/categories?fields=name,parent

{
    "name": "Category 2"
}

Response will look like:

{
    "id": "1bfcf663-3f5d-4a86-8e0c-12c5ea34c137",
    "name": "Category 2",
    "parent": null
}

Update category format

Request: PUT /someitems/categories/{id}

{
    "parent": null
}

Not all fields should be specified - missing fields will left field values unchanged.

Response: status 204 (No content)

If some category fields except id is needed, you can just describe fields you want to receive in fields parameter (optional):

Request: PUT /someitems/categories/{id}?fields=name,parent

{
    "parent": null
}

Response will look like:

{
    "id": "1bfcf663-3f5d-4a86-8e0c-12c5ea34c137",
    "name": "Category 2",
    "parent": null
}

Delete category format

Request: DELETE /someitems/categories/{0}

(no body needed)

For DELETE requests JSON body is not needed and no body can be sent at all.

Response: status 204 (No content)

Please mention, that removing category will remove all subcategories and all items in category and
all subcategories.

Get items with categories

Request: GET /someitems/tree[?fields=fields_list,categories_fields=categories_fields_list,empty_categories&filter1=value1&filter2=value2&..]

If some items are grouped in categories, in most cases most convenient will be to receive such items from API in
some sort of tree view. This request combine both items and categories and represent them in tree view:

  1. Result root is "virtual" top category with empty id, name and parent. You can't update or delete this category.
  2. Each category, including root, has two arrays: categories and items.
  3. Items can be filtered using filters (same as for get items).
  4. By default, empty categories (that has no subcategories or items) are not returned. You can force to return them,
    setting empty_categories in parameters.

Response will look like:

{
    "id": null,
    "name": "",
    "parent": null,
    "categories": [
        {
            "id": "8c98a00b-1526-4dc0-9968-008439a78019",
            "name": "Category 1",
            "parent": null,
            "categories": [
                {
                    "id": "5c8316ef-68fb-47d4-b99a-ef715a60bd16",
                    "name": "Subcategory 1",
                    "parent": "8c98a00b-1526-4dc0-9968-008439a78019",
                    "categories": [
                    ],
                    "items": [
                        {
                            "id": "cfbb963e-3ceb-4764-b3f4-805f3a3e056b",
                            "name": "Item 3",
                            "type": "Simple",
                            "color": "Yellow",
                            "category": "5c8316ef-68fb-47d4-b99a-ef715a60bd16"
                        }
                    ]
                }
            ],
            "items": [
                {
                    "id": "905e5ff6-9d41-465b-aced-7ea81a7e2ee3",
                    "name": "Item 2",
                    "type": "Complex",
                    "color": "Green",
                    "category": "8c98a00b-1526-4dc0-9968-008439a78019"
                ]
            }
        }
    ]
    "items": [
        {
            "id": "246db366-061f-45ac-984d-de8050c045a1",
            "name": "Item 1",
            "type": "Simple",
            "color": "Red",
            "category": null
        }
    ]
}

Categories in "categories" arrays are sorted by field "name", items in "items" array in response are sorted either by field "name" or "date" (if "name" not exists).

One moment to keep in mind with empty categories. Assume we have next structure:

+ Top category (virtual)
    + Item 1
    + Category 1
        + Item 2
        + Subcategory 1
            + Item 3
        + Empty subcategory 1
    + Category 2
        + Empty subcategory 2

Empty categories, as in example above can happen in two cases:

  1. Someone add category in program and forgot to add items inside (or adding items in progress).
  2. You use filters to filter some items and originally non-empty categories become empty with your filters.
    In most cases you don't need to receive empty categories, so API automatically filter empty categories and don't return them.
    So, tree structure above will look like:
+ Top category (virtual)
    + Item 1
    + Category 1
        + Item 2
        + Subcategory 1
            + Item 3

Empty subcategories 1 and 2 was not shown, Category 2 become empty and was not shown also.

If you need to receive empty categories, set parameter empty_categories and all categories will be preserved.

Getting/updating images

Difference between images and other data types are that images are binary data type. Thus it is non-optimal to
get/update them via JSON (using base64 for example). Also, receiving images inside JSON makes not so comfortable
to set IMG/PICTURE tags.

That's why getting/receiving images (client photos, employee photos, products pictures, etc.) are always separate methods.
But they all have same format.

Get image

To get image, use GET request one level deeper than object which image you want to get: for example, /items/{id}/photo.
Result will always be of content mime type image/jpeg, image/png or image/gif (if no image found, 404 error will be returned).

The most common problem with images is resizing them to specific size. Usually browser is capable of doing this,
but it is better to do that on server to decrease size of data transferred and increase speed. So, on getting images,
these 3 optional parameters can be provided (please note both width and height should be provided for resizing):

Parameter Possible values Description
width integer Width of resized image in pixels
height integer Height of resized image in pixels
resize fit (default)/fit_center_transparent/stretch/crop Type of operation in case proportions of original image will not match proportins of needed image.

List of possible resize values:

Value Description
fit (default) Image will be resized constraining proportions to fit into provided width & height. One of dimensions can be less than needed.
fit_center_transparent Same as previous but if one of dimensions is less than needed, additional transparent rows/colums added to image to make width and height equal to needed
stretch Image will be resized to needed width & height without constraining proportions (width and height will be exact as needed but image will be distorted)
crop Image will be resized constraining proportions to such scale that one of dimensions is equal to needed while another is equal or bigger than needed. If second dimension is bigger, image will be cropped to match needed width and height. In this case proportions are constrained, image size equals to needed but part of image can be cropped (for example, original size 2000x1000, needed 100x100: first scale to 200x100 than crop left 50 and right 50 pixels).

In all cases scaling is done only for bigger images. Scaling is skipped if needed size is bigger than original (otherwise artefacts can be seen on image).

In some cases it is preferable to use API URL inside IMG/PICTURE tag, without using JavaScript to fetch image. But all image requests need access token in
Authorization header. So for getting image requests (and only for them) access token can be specified as additional parameter access_token in URL, thus
Authorization header not needed for such requests. Resulting URL can be easily inserted as src parameter of IMG tag.

A little about caching images: all images should be cached for 10 minutes, after that ETag can be used to check if image was changed or not.
If you use images inside IMG/PICTURE tags, browser do all this magic for you, but in case you get images from JavaScript or some other language,
please use Cache-Control and ETag headers to decrease traffic and increase speed of your application.

Update image

Updating image is very straightforward process.
Use same URL as for getting image but with PUT method.

Content should be image itself (mime types image/jpeg, image/png or image/gif are supported).
Mime type of an image will be defined by it's content, so Content-Type header will be ignored.

No parameters supported:
width, height and resize has no meaning: for each image type (client photo, product picture) there are custom max allowed size. If image is bigger,
it will be fitted in max allowed size.
access_token not allowed: access token should be passed as Authorization header.

There are three request types supported:

1) Sending binary data (recommended)

Images are binary files. So passing them 'as is' is recommended. This method requires least memory and time resources in comparison with the other methods

  • Request header

    Authorization: Bearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
    
  • Request body

    FF D8 FF E0 00 10 4A 46 49 46 00 01 01 00 00 01
    00 01 00 00 FF DB 00 43 00 05 03 04 04 04 03 05
    ...
    00 51 45 14 00 51 45 14 00 51 45 14 00 51 45 14
    01 FF D9
    
2) Sending base64 encoded image

Alternative way: use base64 encoding instead of pure binary data.
To send image as base64, Content-Transfer-Encoding header must be set to base64

  • Request header

    Authorization: Bearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
    Content-Transfer-Encoding: base64
    
  • Request body

    /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7...AUUUUAFFFFABRRRQB/9k=
    
3) Sending resource url

You can also pass url, server will download image by itself.
To provide url, set Content-Type header to text/plain, then the request body will be considered as url.

Url should be well-formed in accordance with RFC 2396 and RFC 2732

  • Request header

    Authorization: Bearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
    Content-Type: text/plain
    
  • Request body

    https://some.image.url.com/img.png
    

To delete image, just send request without content (content length 0 bytes) or use DELETE method with same URL.

Result is 204 (No content) on success.

Scopes

Scopes describe which API is available for specific application (more about applications will be described later).

You can see needed scope in method description (only if Database or Client tokens used, otherwise scope is not appliable).

Scope Description
full Full read and write access to all salon/fitness database data.
clients_module Online booking module: read services, employees, locations, free time; create and update client appointments.
reports Read-only access for reports and analytics: appointments, sales, clients, services, products.
services_aggregator Appointment aggregator: search and add clients by phone (no edit/delete); read services, employees and free time; create and update appointments without history access.
client_login Login with client phone and SMS code (or create a new client). Available only for AI Helps products.

Scopes are chosen once when the application is registered and cannot be changed afterwards without contacting AI Helps support. An application may be granted one or more scopes. Token types client_access_token and application_access_token are assigned automatically by the token type (see Authorization) and are not selected at registration.

Request limits

The following limits apply to all API consumers:

  • Up to 100 requests per second per IP address (overall).
  • Up to 10 requests per second per IP address on /auth/* endpoints.
  • Up to 5 concurrent requests per access token.
  • Maximum request body size: 10 MB.
  • Prefer batching work and avoiding polling list endpoints too frequently.
  • Abusive traffic patterns may result in the source IP being blocked for up to 7 days.

If you exceed these limits, the API returns HTTP 429 (see 429 Too Many Requests below).

Errors

Depending on the request method, server return different HTTP status codes:

  • GET:

    • 200 - OK: on success
    • 404 - Not Found: item not found by given id
  • POST:

    • 201 - Created: on success
    • 202 - Accepted: for long-running requests
  • PUT:

    • 200 - OK: on success if item returned
    • 202 - Accepted: for long-running requests
    • 204 - No content: on success if item not returned
    • 404 - Not Found: item not found by given id
  • DELETE: 200 (OK)

    • 204 - No content: on success
    • 404 - Not Found: item not found by given id
  • Common errors:

    • 400 - Bad Request: error in request parameters (bad parameters, required parameter not given)
    • 401 - Unauthorized: authorization required (if not specified) or failed (bad token, token expires etc.)
    • 403 - Forbidden: your scope does not allow running current API (check needed scope in documentation)
    • 409 - Conflict: your changes conflicts with data in database
    • 429 - Too Many Requests: server limits number of requests by ip for some methods (like authorization)
    • 500 - Internal Server Error: error happen on server while API method running (please write us at ag@aihelps.com)
    • 503 - Service Unavailable: server unavailable due to maintainance or some server problem (please try again later)

Success codes are 200 for GET, 201 for POST, 200/204 for PUT and 204 for DELETE requests.

In case of error (error codes >= 400) server response has next format (for all types of requests):

{
    "status": 401,
    "type": "INVALID",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Unknown employee login or password",
    "details": "https://aihelpssoft.github.io/documentations/#error-INVALID"
}

Where:

  • status: HTTP status code (described earlier)
  • type: error type, if provided
  • request: request id (you can use this id to get details from API developers via dev@aihelps.com)
  • message: message for developer, describing problem
  • details: link to documentation with more details

There are two types of errors:

  1. errors like Bad Request which notifies that you use API in wrong way. These errors do not have type field, but provides detailed message. Such errors usually happens during development phase, thus developer see them and fix inplace. Such errors are: 400 Bad Request, 401 Unathorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests, 500 Internal Server Error and 503 Service Unavailable. All of them can happen at any request.
  2. errors that happens in production like invalid password while logging in or token expired. Such errors always have specific type and should be handled in code that uses API. Usually they have additional information in JSON parameters that helps to handle this error. You need to write code to manage them in production. They are: 400 Bad Request - APPOINTMENT_VALIDATION, 401 Unathorized - UNKNOWN, EXPIRED, INVALID and BLOCKED; 403 Forbidden - LICENSE; 409 Conflict - ALREADY_EXISTS and TIME_CONFLICT; 503 Service Unavailable - REMOTE_DATABASE, SMS, SMS_AUTH and SMS_BALANCE. From them 401 Unathorized - UNKNOWN, EXPIRED; 403 Forbidden - LICENSE; 503 Service Unavailable - REMOTE_DATABASE can happen at any request, other - only at specific requests (all such requests will be marked).

400 Bad Request

These errors means that your request is incorrect - not enough parameters, bad parameter type, failed validation and so on.

{
    "status": 400,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Parameter `name` value should be equals or greater than zero",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/400-bad-request"
}

Can happen at any request.

400 Bad Request - APPOINTMENT_VALIDATION

These errors means some validation errors while changing appointment. List of these errors is long enough, details can be found in Appointments section. You can pass force=true parameter to ignore such validations.

{
    "status": 400,
    "type": "APPOINTMENT_VALIDATION",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Validation error(s) while updating appointment",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/400-bad-request-appointment-validation",
    "validations":
    [
        {
            "id": "da77cb7c-5725-4afa-abf4-c097a9e9081a",
            "type": "SERVICE_PROFESSIONAL_CANT_PROVIDE_SERVICE",
            "service": "ced508d8-b4cf-498b-9893-a976a912ba21",
            "professional": "6b98745c-d72d-4831-b7cc-104449d17617"
        }
    ]
}

Can happen only at appointment insert/update endpoints.

401 Unathorized

These errors means some problems with authorization. If no type specified, it's usually common problem, that happens during development.

{
    "status": 401,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Unknown authorization scheme: Basic",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized"
}

Can happen at any request.

401 Unathorized - UNKNOWN

These errors means some problems with authorization. type=UNKNOWN means that provided access token, refresh token, application id & password ot other requisites are unknown. There is no way to refresh token or continue session.

{
    "status": 401,
    "type": "UNKNOWN",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Unknown access token: 3227f712-eb6c-4003-8260-ca70fcad50d1",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized-unknown"
}

Correct handling this error in production - treat session as logged out and redirect user to login page.

Can happen at any request.

401 Unathorized - EXPIRED

These errors means some problems with authorization. type=EXPIRED means that provided access token, auth id or other temporary access object is expired,

{
    "status": 401,
    "type": "EXPIRED",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Access token expired",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized-expired"
}

Correct handling this error in production - silently refresh token, save new token and repeat original request.

Can happen at any request.

401 Unathorized - INVALID

These errors means some problems with authorization. type=INVALID means that during authorization process you provided wrong login/password, sms code or other authorization information.

{
    "status": 401,
    "type": "INVALID",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Wrong provided sms code",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized-invalid"
}

Correct handling this error in production - notify user his credentials are invalid and provide possibility to enter credentials once more.

Can happen only at few authorization requests, such request will contain info about this error.

401 Unathorized - BLOCKED

These errors means some problems with authorization. type=BLOCKED means that during authorization process you overlimit attempts to enter password/sms code or other credentials and verification blocked for some time.

Additional parameter added unblockAfter, which contains number of seconds after which unblock occures and you can repeat attempts.

{
    "status": 401,
    "type": "BLOCKED",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Can't check password: blocked for 10 minutes because 5 wrong passwords provided, left 124 seconds.",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized-blocked",
    "unblockAfter": 124
}

Another similar case: sms can be send only once a minute:

{
    "status": 401,
    "type": "BLOCKED",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Sms verification code was sent recently, minimum interval is one minute between sending smses, 17 seconds left.",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized-blocked",
    "unblockAfter": 17
}

If you don't receive unblockAfter field, the only option for user is to start authentification process from start:

{
    "status": 401,
    "type": "BLOCKED",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "auth_id becomes invalid after sending 20 wrong codes",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/401-unathorized-blocked"
}

Correct handling this error in production - notify user his credentials are invalid, wait for specified amount of time (if provided) and provide possibility to enter credentials once more. If unblockAfter not specified, start authorization process from beginning.

Can happen only at few authorization requests, such request will contain info about this error.

403 Forbidden

These errors means your scope does not allow running current API (check needed scope in documentation). If no type specified, it's usually problem with scopes and easily found during development process.

{
    "status": 403,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Your scope (reports) does not allow running 'POST /clients'",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/403-forbidden"
}

Can happen at any request.

403 Forbidden - LICENSE

type=LICENSE means some problem with license, for example, "Licenses expired for all locations expired" or "This endpoint not allowed for your license type".

{
    "status": 403,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Licenses expired for all locations expired",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/403-forbidden-license"
}

Correct handling this error in production - notify user that his license is finished, he should prolonge it until continue using product.

Can happen at any request.

404 Not Found

These errors means that either URL was not found or some object was not found by id, phone, name etc.

Additional parameters added object, type, value, which describes what object was not found.

object can be either "url" or item from database: "client", "employee", "appointment", etc.
type describes type of requisites used for search: "url" (for "url" only), "id", "phone", "email", "name", "code" (for database)
value value of type type used for search.

If URL was not found:

{
    "status": 404,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "No API with URL POST /abc found",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/404-not-found",
    "object": "url",
    "type": "url",
    "value": "POST /abc"
}

If some object was not found:

{
    "status": 404,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Client with id ccac7904-dbaa-4373-95c2-464031fdb533 not found",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/404-not-found",
    "object": "client",
    "type": "id",
    "value": "ccac7904-dbaa-4373-95c2-464031fdb533"
}

Can happen at any request.

409 Conflict - ALREADY_EXISTS

These errors means request could not be completed due to a conflict with the current state of the target resource. type=ALREADY_EXISTS means that object with provided parameters already exists.

Additional parameters added type, id, where:
itemType - type of item already exists
id of object already exists
where - list of conditions to be unique, used to find item

{
    "status": 409,
    "type": "ALREADY_EXISTS",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Only one planned or confirmed appointment should exists for specified date + location + client + employee",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/409-conflict-already_exists",
    "itemType": "appointment",
    "id": "74e85faf-de73-4fe6-9530-3af1dd7c1b34",
    "where":
    {
        "date": "2020-01-01T00:00:00Z000",
        "location": "e0cd7be0-dcf1-4b49-b704-a5d2cbd59125",
        "client": "012b6f96-dbea-4e47-8c27-c474021c03f5",
        "employee": null,
        "state": "planned/confirmed"
    }
}

Correct handling this error in production - depending from endpoint, correct input data and make request once more if needed (in many cases item already exists and no need to repeat request).

Can happen only at few requests, such request will contain info about this error.

409 Conflict - TIME_CONFLICT

These errors means request could not be completed due to a conflict with the current state of the target resource. type=TIME_CONFLICT means that object can be saved on proposed time because it will conflict with already stored items.

Additional parameter added anotherItems, which is array of items, each containing:
id: id of object which changes raised time conflict (id of group lesson or aappointment service when changing itself, id of specific appointment service when changing appointment)
itemType: professional, hall, resource or appointment - type of conflicted resource
itemId: id of conflicted resource
objectType: another object, that use resource, possible values appointmentService, groupLesson, or nonWorkingTime (for professional only)
objectId: appointment service id or group lesson id
objectDescriptionId: object that describes conflicted object: appointment client or employee id for appointmentService, group id for groupLesson
objectStart: start of object (date and time)
objectDuration: object duration in minutes

{
    "status": 409,
    "type": "TIME_CONFLICT",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Only one planned or confirmed appointment should exists for specified date + location + client + employee",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/409-conflict-time_conflict",
    "anotherItems":
    [
        {
            "id": "da77cb7c-5725-4afa-abf4-c097a9e9081a",
            "itemType": "professional",
            "itemId": "9d5437d2-b868-426c-a572-38d532d47987",
            "objectType": "appointmentService",
            "objectId": "e03ee732-2f5a-476f-afdb-0d53a16a072e",
            "objectDescriptionId": "4ac7591c-8811-430b-a3fb-d2e53f42c177",
            "objectStart": "2020-01-01T00:00:00Z000",
            "objectDuration": 120
        }
    ]
}

Correct handling this error in production - show received conflicts to user. If user really sure, most endpoints returning this error can be called once more with force=true parameter, ignoring this error.

Can happen only at few requests, such request will contain info about this error.

429 Too Many Requests

If you exceed the request limits, the API returns HTTP 429. Reduce request rate, avoid polling when webhooks are available, and retry after a short delay.

{
    "status": 429,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Up to 100 requests per second allowed from one IP (try again soon)",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/429-too-many-requests"
}

Can happen at any request.

500 Internal Server Error

These errors usually means some server bug. Provide request identifier to development team to solve the bug.
Details of error are not shown for security reasons.

{
    "status": 500,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Internal Server Error: error id 'a7dfb9a8-0383-4087-a1e6-606fc2bc714c'. You can use this id to get error details using api@aihelps.com",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/500-internal-server-error"
}

Can happen at any request.

503 Service Unavailable

These errors means some structural internal API problems, like problems with database. If no type specified, it's usually problems that can be solved only by AI Helps team in nearest future, you can do nothing with it.

{
    "status": 500,
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Service Unavailable (some of internal infrastructure is unavailable thus request can't be processed)",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/503-service-unavailable"
}

Can happen at any request.

503 Service Unavailable - REMOTE_DATABASE

In rare cases clients database is located not on AI Helps servers, but hosted on clients server. AI Helps can't guarantee such server will be always accessible.
type=REMOTE_DATABASE means API can't connect to clients database and process request (either server/database unavailable or wrong credentials stored in AI Helps for remote server). You can push clients by yourself to guarantee stable connection to their database.

{
    "status": 500,
    "type": "REMOTE_DATABASE",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Remote database unavailable (client database located on other server is unavailable)",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/503-service-unavailable-remote_database"
}

Can happen at any request.

503 Service Unavailable - SMS

Clients usually have accounts in text messaging services to send smses to their clients. Some endpoints requires sending sms to proceed (like login via sms code). If some error happens during sending sms, errors with type=SMS wil be received. These errors are usually either problems with connectivity or situations when service changed their API and integration become invalid.

{
    "status": 503,
    "type": "SMS",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Sending SMS: can't connect to sending service",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/503-service-unavailable-sms"
}

Correct handling this error in production - notify user message can't be sent due to problens with sending service and he should try once more in some time.

Can happen only at few requests, where sending sms is crucial, such request will contain info about this error.

503 Service Unavailable - SMS_AUTH

Clients usually have accounts in text messaging services to send smses to their clients. Some endpoints requires sending sms to proceed (like login via sms code). If during sending sms we discovered, that login, password or alpha name for sms sending service is incorrect, error with type=SMS_AUTH will happen. Contrary to error type=SMS this one can be easily fixed changing login/password/alpha name in program settings.

{
    "status": 503,
    "type": "SMS_AUTH",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Sending SMS: wrong login/password",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/503-service-unavailable-sms_auth"
}

Correct handling this error in production - notify user message can't be sent due to wrong credentials and he should try once more in some time.

Can happen only at few requests, where sending sms is crucial, such request will contain info about this error.

503 Service Unavailable - SMS_BALANCE

Clients usually have accounts in text messaging services to send smses to their clients. Some endpoints requires sending sms to proceed (like login via sms code). If during sending sms we discovered, that no more credits left, error with type=SMS_BALANCE will happen. Contrary to error type=SMS this one can be easily fixed by client, making payment to sms sending service.

{
    "status": 503,
    "type": "SMS_BALANCE",
    "request": "a7dfb9a8-0383-4087-a1e6-606fc2bc714c",
    "message": "Sending SMS: out of money",
    "details": "https://aihelpssoft.github.io/documentations/#introduction/errors/503-service-unavailable-sms_balance"
}

Correct handling this error in production - notify user message can't be sent due to lack of money and he should try once more in some time.

Can happen only at few requests, where sending sms is crucial, such request will contain info about this error.

Change history

Here you can see history of changes in API and documentation.

Date Description
2026-09-16 Documentation cleanup: scopes table, authorization annotations, webhooks rewrite, request limits, getting started, removed deprecated /common/employees, added missing endpoints
2026-08-19 clients: utm_campaign, utm_source, utm_medium fields added

Deprecated endpoints and fields

This section contains information about deprecated endpoints or fields in endpoints. We usually deprecate endpoints or fields if we propose some better alternative for such fields or resources. After deprecation published we give at least 3 months to API users to make corresponding changes in their code.
According to IETF standard, we return 3 headers in response in case endpoint is deprecated:

Deprecation: true
Sunset: [date]
Link: <[link to subsection in this section]>; rel="deprecation"

Link leads to subsection of this section, where more details and alternatives are described.

In case of deprecated field, we add one more non-standard header to make it easier to distinguish problem:

X-Deprecated-Field: [field]
Sunset date is date when we plan to remove endpoint or field. We will not remove endpont or field before that date, but can do it in any moment after date happens (thus in some cases endpoint/field can be valid for months more, but no guarantee).

Authorization

This section describes authorization that should be done before most API calls. For each method in this documentation authorization type will be specified.
API based on OAuth 2.0 authorization model (with some significant changes in terminology, syntax and principles), see https://tools.ietf.org/html/rfc6749 for details.
To make most of requests, you need access token (you can see needed token type for each method in method description as "Authorization"). Access token is string that
represents access to client database (full or limited) given for some application for specific period of time. Access token has lifetime - 24 hours after moment it was
received. After that refresh token (received along with access token) can be used to receive new valid token.
For successful authorization you need to register your application and receive application_id and application_secret (this should be done only once).
Registering/updating/removing application is described in next section (Application).
This section implies that you already has application_id and application_secret.
There are 4 types of access tokens:

  1. Application token - this token can be used to view/change application information and get application tokens list. This token does not allow any access to clients databases.
    For each application only one valid Application token exists in given moment of time. On successful receiving new Application token, previous Application
    token for given application, if exists, become unavailable. Receiving new Application token using API will be described later in this section.
  2. Database token - this token grants access for your application to specific database. For access to client database you need to get permission
    from one of database employees with chief rights (with red user icon in program). Typically used if you need to read and analyze some information from database or
    add/update/delete information for all employees (e.g. add sales from other software).
    For each application-database pair only one valid Database token exists in given moment of time. On successful receiving new Database token, previous
    Database token for given application-database pair, if exists, become unavailable. New Database token can be received in three ways: using API
    to show login page in browser (will be described later in this section), using API send employee requisites (need application database_token_by_password scope,
    will be described later in this section) or through Beauty Pro/Fitness Pro application. In third case, user with chief rights should start the program,
    select Settings->Marketplace, find your application and press "Grant access". Token will be generated. You can check if you already have access token,
    using Access Tokens API (see token management below in this section).
    Please mention, that Database token access is common for whole database and not depends from user, who grant access. Thus access can be revoked by another
    user with chief rights.
  3. Employee token - this token grants access for your application to specific database for specific employee. This token available only for specific
    AIHelps products (application should have employee_login scope) and used for login. Receiving this token, in fact, means employee
    login and all subsequent API requests will be executed as if employee done it itself in software. This token type should be used if you need to perform operations
    from employee point of view (e.g. custom application with some additional functions or custom interface).
    One employee can have several valid Employee tokens at once, what allows him to use application from several devices. On successful receiving new Employee token, previous
    Employee tokens for given application-database-employee triple still remains valid. Receiving new Employee token using API will be described later in this section.
    Token can be received either providing employee requsites with password or providing employee phone and sms code. In second code database can be omitted (but not all
    employess will be found).
  4. Client (beauty salon/gym client) token - this token grants access for your application to specific database for specific beauty salon/gym client.
    This token available only for specific AIHelps products (application should have client_login scope) and used for login.
    Receiving this token, in fact, means client login and all subsequent API requests will be executed as if client done it itself in software. Client always login
    by his phone number and code from SMS. This token type should be used for all types of client applications: booking systems, loyality/marketing applications etc.
    One client can have several valid Client tokens at once, what allows him to use application from several devices. On successful receiving new Client token, previous
    Client tokens for given application-database-client triple still remains valid. Receiving new Client token using API will be described later in
    this section.
    Received token information contains:
  • access token (can be used for API queries for 24 hours)
  • access token expire time
  • scope (for Database and Employee tokens)
  • refresh token (for Database, Employee and Client tokens)
    There are two more useful procedures:
  1. If access token expires, refresh token can be used to generate new valid token (described below).
  2. If token become public or insecure or simply not needed any more, it can be revoked. Revoking tokens described below in this section.

If you want get/update application information, delete application, manage application access tokens and some other operations, not connected to specific client database,

If you want get/update application information, delete application, manage application access tokens and some other operations, not connected to specific client database,
Application access token needed. Process of receiving such token very simple, cause you don't need any confirmation from end users - just send application_id and
application_secret (both are required) and receive token.

Please pay attention, such token need for one-time operations, thus refresh_token not generated.

Authorization: none

GET/auth/application{?application_id,application_secret}
Full URL: https://api.aihelps.com/v1/auth/application{?application_id,application_secret}
Parameters
NameTypeRequiredDescriptionExample
application_idstringyesapplication ida47cbc05-5ce6-4551-9456-2855b52a17f0
application_secretstringyesapplication secreta3db644a-907a-4da2-bcdd-bc9f7068237d
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "access_token": "a71923bd-84c5-49a3-a7fb-a0825e26bbe4",
    "expires_at": "2017-06-01T00:00:00.000Z"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "expires_at": {
            "type": "string"
        }
    }
}

This method creates request to access specified database for specific application if not yet created and returns access token information if access already granted.

This method creates request to access specified database for specific application if not yet created and returns access token information if access already granted.

This method can be used in two cases:

Access to private application (default state for all applications):

  1. Call this method with specified application_id, application_secret and database_code will create access request.
  2. Login into desktop application (BeautyPro, FitnessPro, DentaPro), go to Settings->Marketplace, select needed application and press Grant access (in marketplace only public applications and applications that asked for access are shown).
  3. Call this method once again with specified application_id, application_secret and database_code will return access token information.

Access to public application (public applications are generally used by many clients, switching application to public is made manually by developer request if application is ready and has some value for clients):

  1. User login into desktop or web application, go to Settings->Marketplace, select needed application and press Grant access.
  2. Call this method with specified application_id, application_secret and database_code will return access token information.

If access was granted, method will return access token information, if not granted - JSON with one field status either "pending" or "refused".

Authorization: none

GET/auth/database{?application_id,application_secret,database_code,location}
Full URL: https://api.aihelps.com/v1/auth/database{?application_id,application_secret,database_code,location}
Parameters
NameTypeRequiredDescriptionExample
application_ididentifieryesapplication ida47cbc05-5ce6-4551-9456-2855b52a17f0
application_secretidentifieryesapplication secreta3db644a-907a-4da2-bcdd-bc9f7068237d
database_codestringyesdatabase for which access should be granted123456
locationidentifierThe default location for the access token. If the location not specified in URL parameter it takes the location for the current database_code.a47cbc05-5ce6-4551-9456-28ccb52bbb11
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "status": "pending"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "status": {
            "enum": [
                "pending",
                "refused"
            ]
        }
    }
}
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "server": 1,
    "access_token": "a71923bd-84c5-49a3-a7fb-a0825e26bbe4",
    "database": "123456",
    "scope": [
        "full",
        "employee_login"
    ],
    "expires_at": "2017-06-01T00:00:00.000Z",
    "location": "a71923bd-84c5-49a3-a7fb-a08fbecc2be1"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "server": {
            "type": "number"
        },
        "access_token": {
            "type": "string"
        },
        "database": {
            "type": "string"
        },
        "scope": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "expires_at": {
            "type": "string"
        },
        "refresh_token": {
            "type": "string"
        }
    }
}

These endpoints obtain a Client access token via SMS login. Used by online booking and other client-facing modules. The application must have the clients_module scope.
Receiving a Client token is a 2-step process (or 3-step for new clients). On the first step the client provides a phone number or email and receives a random code. If the message is sent successfully, the method returns auth_id, which is required to complete login on the second step.
auth_id is valid for 3 hours. If you request a code again for the same contact during this period, a new message is sent (with the same code) and the same auth_id is returned.
Required header is Content-Language: it defines the language of the SMS or email text (for example, "Your login code is: " in English).

Send an SMS with a 4-digit login code to the client's phone number.

Send an SMS with a 4-digit login code to the client's phone number.

Authorization: none

Scope: application should have clients_module scope

GET/auth/client{?application_id,database_code,phone,country}
Full URL: https://api.aihelps.com/v1/auth/client{?application_id,database_code,phone,country}
Parameters
NameTypeRequiredDescriptionExample
application_idstringyesapplication ida47cbc05-5ce6-4551-9456-2855b52a17f0
database_codenumberyes6-digit database code123456
phonestringyesphone number (international format if `country` is not set; non-digits are ignored)+1 555 111 11 11
countrystringif set, the phone number can be given in national format and will be reformatted using settings for this countryusa
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "auth_id": "91d14822-9150-4ba7-8adc-a20d9507a811"
}

After an SMS or email was sent and `auth_id` was returned, the client enters the code.

After an SMS or email was sent and auth_id was returned, the client enters the code. Call this method with auth_id from the previous step and the code from the user.

Restrictions:

  1. Time between steps 1 and 2 must be less than 3 hours (auth_id expires after 3 hours).
  2. After 20 wrong codes, auth_id becomes invalid.

Possible outcomes:

  1. code is wrong - 401 error is returned (number of tries is limited)
  2. code is correct - Client token (and refresh token) is generated and returned along with client_id
  3. code is correct but no client with this phone or email exists in the database - 404 error is returned

In the last case you can register a new client: show fields firstname, lastname, sex (values Male or Female), email and location, then call this method again with those values.

If all registration fields are provided and no matching client is found, a new client is created and a Client token is returned.

If either firstname or lastname is set, header Content-Language is required - it defines what part comes first in the client's full name.

Authorization: none

Scope: application should have clients_module scope

GET/auth/client{?auth_id,code,firstname,lastname,sex,email,location}
Full URL: https://api.aihelps.com/v1/auth/client{?auth_id,code,firstname,lastname,sex,email,location}
Parameters
NameTypeRequiredDescriptionExample
auth_idstringyesauthorization process id from the previous step91d14822-9150-4ba7-8adc-a20d9507a811
codestringyescode from SMS (4 digits) or email (10 characters)8664
firstnamestringfirst name of client to createJohn
lastnamestringlast name of client to createBrown
sexstringsex of client to create (`Male` or `Female`)Male
emailstringemail of client to createjohn@gmail.com
locationidentifierlocation of client to createdbc97829-9392-451c-a00d-331d4f8c5d91
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "server": 1,
    "access_token": "f4e6bdc1-58a9-4b2e-a06c-98ca194b2bf4",
    "expires_at": "2017-05-15T14:00:00.000Z",
    "refresh_token": "67d8f73c-52f8-45ad-a242-f3cb72ff79c2",
    "client_id": "d81dc7a7-879b-47a6-b98f-033558d5b074"
}

Access token is valid only 24 hours.

Access token is valid only 24 hours. After that period token should be refreshed. Call this method to refresh token.
Please pay attention that refresh token is also not perpetual. It can become invalid (all information about access token & refresh token will be vanished)
in several months if not used (but validity period much longer than 24 hours for access token). In this case you need to receive new token.

On success new access_token and refresh_token will be generated and expires_at updated. Old access_token and refresh_token will be unavailable.

Authorization: none

GET/auth/refresh{?application_id,refresh_token}
Full URL: https://api.aihelps.com/v1/auth/refresh{?application_id,refresh_token}
Parameters
NameTypeRequiredDescriptionExample
application_idstringyesapplication ida47cbc05-5ce6-4551-9456-2855b52a17f0
refresh_tokenstringyesrefresh token for updating access tokenf9e96585-856f-4b48-95ca-9511c0ba5576
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "access_token": "a71923bd-84c5-49a3-a7fb-a0825e26bbe4",
    "expires_at": "2017-06-01T00:00:00.000Z",
    "refresh_token": "13baeeb8-ebe7-4751-86a6-5c960bfe1776"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "expires_at": {
            "type": "string"
        },
        "refresh_token": {
            "type": "string"
        }
    }
}

If access token become public or insecure in some other way or just not needed any more, you can revoke it.

If access token become public or insecure in some other way or just not needed any more, you can revoke it.
Revoking makes both access token unavailable for API calls and refresh token unavailable for generating new token.
Revoking is valid for all types of tokens.

Revoke should be done using refresh_token, not access_token.

Please pay attention that refresh token is also not perpetual. It can become invalid (all information about access token & refresh token will be vanished)
in several months if not used (but validity period much longer than 24 hours for access token). In this case tokens already deleted and nothing more should be done.

Authorization: none

GET/auth/revoke{?application_id,refresh_token}
Full URL: https://api.aihelps.com/v1/auth/revoke{?application_id,refresh_token}
Parameters
NameTypeRequiredDescriptionExample
application_idstringyesapplication ida47cbc05-5ce6-4551-9456-2855b52a17f0
refresh_tokenstringyesrefresh token to revokef9e96585-856f-4b48-95ca-9511c0ba5576
GETRequest
204Response

Applications

To receive access token you need to register your application and receive application_id and application_secret.
In AI Helps API one developer account have only one application account, so "Application" and "Developer" are synonyms in terms of current API. For simplicity sake we
would call it "Application" later in this document.

Register new application.

Register new application.

At current moment, due to behaviour of some applications, trying to mimic as well-known, trusted applications and trying to steal users data, we suspended automatic applications registration. All registartions are done in manual mode: please connect AI Helps support by phone or via chat on aihelps.com web site.

application_name is required field to register application. application_name even can already exists in applications.

redirection_endpoint and scope are also required to make authorization requests (can be changed later).

application_id and application_secret are generated by server, so they can't be provided by user.

Please pay attention, that you will need at least application_id and application_secret, thus you need to use fields parameter to retrieve information about
application created. It will be impossible to do it later, cause all next queries for this application require Application token, which can be generated using
application_id and application_secret both.

Authorization: AI Helps employee with special rights

POST/applications{?fields}
Full URL: https://api.aihelps.com/v1/applications{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)application_name,application_id,application_url,developer_name,contact_email,redirection_endpoint,application_secret,scope,public,countries,grant_access_url,created
POSTRequest
Body
{
    "application_name": "Test application",
    "application_url": "testapp.com",
    "developer_name": "ABC Solutions",
    "contact_email": "dev@testapp.com",
    "redirection_endpoint": "testapp.com/app",
    "scope": "clients_module",
    "grant_access_url": "testapp.com/access/{database_code}"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "9245f5b4-d66e-483c-b7c4-fd55f9677bb3"
    "application_name": "Test application",
    "application_url": "testapp.com",
    "developer_name": "ABC Solutions",
    "contact_email": "dev@testapp.com",
    "application_id": "5330336c-143a-415a-b220-fc9932bc029d",
    "application_secret": "eb5cb7df-356e-475f-8afb-2eebe63a37bb",
    "redirection_endpoint": "testapp.com/app",
    "scope": "clients_module",
    "public": false,
    "countries": [],
    "grant_access_url": "testapp.com/access/{database_code}"
}

Get information for existing application.

Get information for existing application.

Application token should be retrieved to make this request.
Application information can be received only for application for which token was got.

For your convenience, you can use me instead of id of application.

Authorization: Application

GET/applications/{id}{?fields}
Full URL: https://api.aihelps.com/v1/applications/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of application to get. id should match token application or "me" can be used9245f5b4-d66e-483c-b7c4-fd55f9677bb3
fieldsarray[string]yeslist of fields to return (separated by comma)application_name,application_id,application_url,developer_name,contact_email,redirection_endpoint,application_secret,scope,created
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "9245f5b4-d66e-483c-b7c4-fd55f9677bb3"
    "application_name": "Test application",
    "application_url": "testapp.com",
    "developer_name": "ABC Solutions",
    "contact_email": "dev@testapp.com",
    "application_id": "5330336c-143a-415a-b220-fc9932bc029d",
    "application_secret": "eb5cb7df-356e-475f-8afb-2eebe63a37bb",
    "redirection_endpoint": "testapp.com/app",
    "scope": "clients_module",
    "public": false,
    "countries": [],
    "grant_access_url": "testapp.com/access/{database_code}"
}

Change information for existing application.

Change information for existing application. Requirements for fields left same as during creation of new application.

Application token should be retrieved to make this request.
Application information can be received only for application for which token was got.

For your convenience, you can use me instead of id of application.

Authorization: Application

PUT/applications/{id}{?fields}
Full URL: https://api.aihelps.com/v1/applications/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of application to update. id should match token application or "me" can be used9245f5b4-d66e-483c-b7c4-fd55f9677bb3
fieldsarray[string]list of fields to return (separated by comma)application_name,application_id,application_url,developer_name,contact_email,redirection_endpoint,application_secret,scope,created
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "application_name": "Test application",
    "application_url": "testapp.com",
    "developer_name": "ABC Solutions",
    "contact_email": "dev@testapp.com",
    "redirection_endpoint": "testapp.com/app",
    "scope": "clients_module"
}
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "9245f5b4-d66e-483c-b7c4-fd55f9677bb3"
    "application_name": "Test application",
    "application_url": "testapp.com",
    "developer_name": "ABC Solutions",
    "contact_email": "dev@testapp.com",
    "application_id": "5330336c-143a-415a-b220-fc9932bc029d",
    "application_secret": "4809691c-0c3b-456f-aa3f-f3fca5b67010",
    "redirection_endpoint": "testapp.com/app",
    "scope": "clients_module",
    "public": false,
    "countries": [],
    "grant_access_url": "testapp.com/access/{database_code}"
}

Delete existing application.

Delete existing application.

Application token should be retrieved to make this request.
Application information can be received only for application for which token was got.

For your convenience, you can use me instead of id of application.

All access tokens (including Application token used to delete application) for this application will become invalid.

Authorization: Application

DELETE/applications/{id}
Full URL: https://api.aihelps.com/v1/applications/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of application to update. id should match token application or "me" can be used9245f5b4-d66e-483c-b7c4-fd55f9677bb3
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

One of the easisest ways for applications to get access to business databases - publish application in Marketplace and/or create access requests.
If application is public, user can easily grant access for application through Marketplace (all public applications are shown by default). If not public, access can be requested via /auth/database, applications with access requests are also shown in Marketplace. There in Marketplace user can grant access for specific application in one click. If grant_access_url is not empty, request will be iimediately sent to this url. Otherwise application should periodically check /auth/database for access granted.
Methods in this section needed for Marketplace internal needs (or you can use them if you want to create custom marketplace). They work with Database token with full scope.

Get list of applications that are either public (and available for all countries or country database belongs to) or which requests access to this database.

Get list of applications that are either public (and available for all countries or country database belongs to) or which requests access to this database.
Information is much shorter than info that can be extracted via Application token and contains only "public" information.

Authorization Database

Scope full

  • Parameter
    • fields: application_name,application_url,scope,public,status (array[string], required) - list of fields to return (separated by comma).
GET/applications{?fields}
Full URL: https://api.aihelps.com/v1/applications{?fields}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "3286cc03-3f88-4c8e-8d94-0af35b67beaf",
        "application_name": "Test application",
        "application_url": "testapp.com",
        "scope":
        [
            "clients_module",
        ],
        "public": true,
        "status": "none"
    },
    {
        "id": "7c527f8e-2551-40a0-b878-79dc3b16dd18",
        "application_name": "My first app",
        "application_url": "",
        "scope":
        [
            "full",
        ],
        "public": false,
        "status": "pending"
    }
]
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "application_name": {
            "type": "string"
        },
        "application_url": {
            "type": "string"
        },
        "scope": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "public": {
            "type": "boolean"
        },
        "status": {
            "enum": [
                "none",
                "pending",
                "granted",
                "refused"
            ]
        }
    }
}

Grant access for application to current database.

Grant access for application to current database. If grant_access_url was set for application, call to that url will be made with substituted database code.

Authorization Database

Scope full

  • Parameter
    • id: 9245f5b4-d66e-483c-b7c4-fd55f9677bb3 (identifier, required) - application id
PUT/applications/{id}/grant
Full URL: https://api.aihelps.com/v1/applications/{id}/grant
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Revoke access for application to current database.

Revoke access for application to current database. If only request was done, request revokes. If request was already accepted and access tokens was generated, all access tokens become invalid.

Authorization Database

Scope full

  • Parameter
    • id: 9245f5b4-d66e-483c-b7c4-fd55f9677bb3 (identifier, required) - application id
PUT/applications/{id}/revoke
Full URL: https://api.aihelps.com/v1/applications/{id}/revoke
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Each application has list of active tokens, received by authorization process.
Because authorization process can be initiated either by application or by client (inside program), there is need check if application already has token for specific database.
Plus deleting unnecessary tokens available.

Get all application active tokens (including expired but with `refresh_token`, thus can be updated).

Get all application active tokens (including expired but with refresh_token, thus can be updated).

For your convenience, you can use me instead of id of application.

Application token (if active) will be also listed, but with database and scope null fields.

If needed, can be retrieved only tokens for specific database.

Authorization: Application

GET/applications/{id}/tokens{?database}
Full URL: https://api.aihelps.com/v1/applications/{id}/tokens{?database}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of application to get tokens. id should match token application or "me" can be used9245f5b4-d66e-483c-b7c4-fd55f9677bb3
databasestringif database code is set, filter only tokens for this database123456
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "tokens": [
        {
            "access_token": "d075dde6-7c91-4fc0-b1dd-b75b9c99a2f5",
            "expires_at": "2017-12-04T23:46:27Z",
            "refresh_token": "f9e96585-856f-4b48-95ca-9511c0ba5576",
            "type": "Database",
            "scope": [
                "clients",
                "sales"
            ],
            "database": "123456",
            "owner": null,
            "common_owner": null
        },
        {
            "access_token": "167b88db-9ebc-4ef6-a160-f466bd8f6548",
            "expires_at": "2017-08-15T17:28:55Z",
            "refresh_token": "aa742497-a3ae-4f76-9f07-53f93a96248a",
            "type": "Database",
            "scope": [
                "clients",
                "sales"
            ],
            "database": "456789",
            "owner": null,
            "common_owner": null
        },
        {
            "access_token": "a71923bd-84c5-49a3-a7fb-a0825e26bbe4",
            "expires_at": "2017-08-15T17:28:55Z",
            "refresh_token": "13baeeb8-ebe7-4751-86a6-5c960bfe1776",
            "type": "Application",
            "scope": null,
            "database": null,
            "owner": null,
            "common_owner": null
        }
    ]
}

Locations

One database represents data either for one beauty salon/gym or for network of beauty salons/gyms.
Let's name each such salon/gym a location.
Clients list is usually common, price list of services/products also usually common (but some prices can differ), some employees
can work at several locations at once. Schedule, appointments, sales is separate for each location.
This API provides information about all locations and possibility to change that information. But adding/removing locations is not
available - new locations automatically appeared after payment made for using software with additional location (location status set to active),
locations are not disappeared after payment was not made for specific location, but rather set status active to false (so, total number of active locations is defined by number of licenses paid).

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only name, description, category, code, city, street, phone, web_site, geo_position, timezone, pictures_count, active), online_store, reports, services_aggregator (only name, description, category, code, city, street, phone, web_site, geo_position, timezone, pictures_count, active)

GET/locations{?fields,active}
Full URL: https://api.aihelps.com/v1/locations{?fields,active}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,category,code,city,street,phone,geo_position,timezone,active
activebooleanif to show only active/non-active locations.true
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "2a0516e3-ddc9-432c-80e4-8d5f5e97cce3",
        "name": "Salon 123 New York",
        "category": "e2d21375-e772-4af2-8682-2b9460404b8e",
        "code": 594365,
        "city": "New York",
        "street": "1, Main av.",
        "phone": "+1 (555) 111 11 11",
        "timezone": "America/New_York",
        "active": true
    },
    {
        "id": "3fe0e240-d779-4a84-9e0c-825d9a6ddcc4",
        "name": "Salon 123 Los Angelos",
        "category": "e2d21375-e772-4af2-8682-2b9460404b8e",
        "code": 866423,
        "city": "Los Angelos",
        "street": "1, Main av.",
        "phone": "+1 (555) 222 22 22",
        "timezone": "America/Los_Angeles",
        "active": true
    },
    {
        "id": "843b8d24-2564-475f-8451-6ef25f2ccd18",
        "name": "Salon 123 Miami",
        "category": "ba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1",
        "code": 168544,
        "city": "Miami",
        "street": "1, Main av.",
        "phone": "+1 (555) 333 33 33",
        "timezone": "America/New_York",
        "active": true
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only name,city,street,phone,geo_position,timezone,active), online_store, reports, services_aggregator (only name, description, category, code, city, street, phone, web_site, geo_position, timezone, pictures_count, active)

GET/locations/{id}{?fields,active}
Full URL: https://api.aihelps.com/v1/locations/{id}{?fields,active}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of locatione98d5a05-d439-40ec-8dc2-7cce3f216e35
fieldsarray[string]yeslist of fields to return (separated by comma).name,category,code,city,street,phone,geo_position,timezone,active
activebooleanif to show only active/non-active locations.true
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "2dde3a05-c916-8d54-8432-7cce3f5e90ec",
    "name": "Salon 123 New York",
    "category": "e2d21375-e772-4af2-8682-2b9460404b8e",
    "code": 594365,
    "city": "New York",
    "street": "1, Main av.",
    "phone": "+1 (555) 111 11 11",
    "timezone": "America/New_York",
    "active": true
}

Please note, that `code` field can't be updated.

Please note, that code field can't be updated.

pictures list should be updated one-by-one, see next "Add/Replace/Delete location picture" requests.

Authorization: Database

Scope: full

PUT/locations/{id}{?fields}
Full URL: https://api.aihelps.com/v1/locations/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of location1053a26e-c9dd-4ec0-8324-75cf5e98ce3d
fieldsarray[string]list of fields to return (separated by comma)name,category,code,city,street,phone,geo_position,timezone,active
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Salon 123 New York",
    "city": "New York"
}
204Response

Unlike locations, which are bound to paid licenses, location categories can be easily changed. Following methods can be used
to get/update location categories.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, online_store, reports

GET/locations/categories{?fields}
Full URL: https://api.aihelps.com/v1/locations/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "e2d21375-e772-4af2-8682-2b9460404b8e",
        "name": "Business class",
        "parent": null
    },
    {
        "id": "ba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1",
        "name": "Luxury salons",
        "parent": null
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, online_store, reports

GET/locations/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/locations/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of locations categoryba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "ba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1",
    "name": "Luxury salons",
    "parent": null
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/locations/categories{?fields}
Full URL: https://api.aihelps.com/v1/locations/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Nail bars",
    "parent": null
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "966a7cdc-ae92-4d6b-9605-9ab2dd74c776"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/locations/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/locations/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of locations categoryba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1
fieldsarray[string]list of fields to return (separated by comma)name,parent
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Luxury boutiques",
    "parent": null
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/locations/categories/{id}
Full URL: https://api.aihelps.com/v1/locations/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of locations categoryba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, online_store, reports

GET/locations/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/locations/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "categories": [
        {
            "id": "e2d21375-e772-4af2-8682-2b9460404b8e",
            "name": "Business class",
            "parent": null,
            "categories": [],
            "items": [
                {
                    "id": "98d52d05-d1c9-40ec-8e62-7c43ce3a3f5e",
                    "name": "Salon 123 New York",
                    "category": "e2d21375-e772-4af2-8682-2b9460404b8e",
                    "code": 594365,
                    "city": "New York",
                    "street": "1, Main av.",
                    "phone": "+1 (555) 111 11 11"
                },
                {
                    "id": "3fe0e240-d779-4a84-9e0c-825d9a6ddcc4",
                    "name": "Salon 123 Los Angelos",
                    "category": "e2d21375-e772-4af2-8682-2b9460404b8e",
                    "code": 866423,
                    "city": "Los Angelos",
                    "street": "1, Main av.",
                    "phone": "+1 (555) 222 22 22"
                }
            ]
        },
        {
            "id": "ba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1",
            "name": "Luxury salons",
            "parent": null,
            "categories": [],
            "items": [
                {
                    "id": "843b8d24-2564-475f-8451-6ef25f2ccd18",
                    "name": "Salon 123 Miami",
                    "category": "ba41dfa4-4ce1-4328-aa91-3dfa68a4d5c1",
                    "code": 168544,
                    "city": "Miami",
                    "street": "1, Main av.",
                    "phone": "+1 (555) 333 33 33"
                }
            ]
        }
    ],
    "items": []
}

Clients

Clients in context of Beauty Pro/Fitness Pro are beauty salon/fitness gym visitors (customers).

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, online_store (only name, firstname, middlename, lastname, gender, birthday, card_number, phone, email, comments fields), reports, services_aggregator (only name, firstname, middlename, lastname, gender, birthday, card_number, email, photo_exists, photo, postal_code, city, street, building, phone fields and only with phone or email filter), client_access_token (only with filter client)

GET/clients{?fields,location,phone,email,card_number,name,archive}
Full URL: https://api.aihelps.com/v1/clients{?fields,location,phone,email,card_number,name,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,firstname,middlename,lastname,title,gender,birthday,location,balance,bonus,card_number,phone,email,photo_exists,photo,postal_code,city,street,building,apartment,categories,categories_names,first_visit,first_visit_description,last_visit,last_visit_description,feedback,additional_fields,do_not_send_sms_notification,do_not_send_sms_promotion,do_not_send_email,create_date,deposit_client,referral_source,referral_source_name,status,comments,archive,professional,utm_campaign,utm_source,utm_medium
locationidentifierget clients who enabled in location0799e1bc-86eb-4e0f-82e2-98dfe2cd55f9
phonestringget only client(s) with given phone (several phones can be separated by comma)+355 (55) 255 55 55
emailstringget only client(s) with given email (several emails can be separated by comma)abc@gmail.com
card_numberstringget only client(s) with given card number (several card numbers can be separated by comma)1234F
nameseveral name can be separated by comma
archivebooleanget only archived or non archived clientsfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d6248d-e5e8-9c40-5296-bb10043eab27",
        "name": "John Brown",
        "firstname": "John",
        "middlename": "",
        "lastname": "Brown",
        "title": "",
        "gender": "male",
        "birthday": null,
        "location": "5382f467-a034-440c-bc7f-3dac932f8b99",
        "balance": 20.0,
        "bonus": 0,
        "card_number": [
            "127219432"
        ],
        "phone": [
            "+1 800 555 12 34"
        ],
        "email": [
            "john@gmail.com"
        ],
        "photo_exists": true,
        "photo": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab991/photo",
        "postal_code": "",
        "city": "New York",
        "street": "",
        "building": "",
        "apartment": "",
        "first_visit": null,
        "last_visit": null,
        "feedback": null,
        "do_not_send_sms_notification": false,
        "do_not_send_sms_promotion": false,
        "do_not_send_email": false,
        "deposit_client": null,
        "referral_source": null,
        "referral_source_name": "",
        "status": "potential",
        "comments": "VIP status",
        "archive": false,
        "utm_campaign": "summer_sale",
        "utm_source": "google",
        "utm_medium": "cpc"
    },
    {
        "id": "6b663d27-90f5-4df0-a8c7-5924b9cd1c39",
        "name": "James Doe",
        "firstname": "John",
        "middlename": "",
        "lastname": "Brown",
        "title": "",
        "gender": "male",
        "birthday": null,
        "location": "5382f467-a034-440c-bc7f-3dac932f8b99",
        "balance": 0,
        "bonus": 0,
        "card_number": [],
        "phone": [
            "+1 800 555 48 15"
        ],
        "email": [],
        "photo_exists": false,
        "photo": null,
        "postal_code": "",
        "city": "New York",
        "street": "",
        "building": "",
        "apartment": "",
        "first_visit": null,
        "last_visit": null,
        "feedback": null,
        "do_not_send_sms_notification": false,
        "do_not_send_sms_promotion": false,
        "do_not_send_email": false,
        "deposit_client": null,
        "referral_source": "5382f467-a034-440c-bc7f-3dac9b2c8191",
        "referral_source_name": "flyers",
        "status", "potential",
        "comments": null,
        "archive": false,
        "professional": "5382f467-a034-440c-bc7f-3dac9b2c8191",
        "utm_campaign": "",
        "utm_source": "",
        "utm_medium": ""
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full,online_store (only name, firstname, middlename, lastname, gender, birthday, card_number, phone, email, comments fields),reports,client_access_token (but id field should match client id, me can be used instead of id)

GET/clients/{id}{?fields}
Full URL: https://api.aihelps.com/v1/clients/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me`)be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]yeslist of fields to return (separated by comma).name,firstname,middlename,lastname,title,gender,birthday,location,balance,bonus,card_number,phone,email,photo_exists,photo,postal_code,city,street,building,apartment,categories,categories_names,first_visit,first_visit_description,last_visit,last_visit_description,feedback,additional_fields,do_not_send_sms_notification,do_not_send_sms_promotion,do_not_send_email,create_date,deposit_client,referral_source,referral_source_name,status,comments,archive,professional,utm_campaign,utm_source,utm_medium
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d6248d-e5e8-9c40-5296-bb10043eab27",
    "name": "John Brown",
    "firstname": "John",
    "middlename": "",
    "lastname": "Brown",
    "title": "",
    "gender": "male",
    "birthday": null,
    "location": "5382f467-a034-440c-bc7f-3dac932f8b99",
    "balance": 20.0,
    "bonus": 0,
    "card_number": [
        "127219432"
    ],
    "phone": [
        "+1 800 555 12 34"
    ],
    "email": [
        "john@gmail.com"
    ],
    "photo_exists": true,
    "photo": "https://api.aihelps.com/v1/images/696320/6b663d27-90f5-4df0-a8c7-5924b9cd1c48/photo",
    "postal_code": "",
    "city": "New York",
    "street": "",
    "building": "",
    "apartment": "",
    "first_visit": null,
    "last_visit": null,
    "feedback": null,
    "do_not_send_sms_notification": false,
    "do_not_send_sms_promotion": false,
    "do_not_send_email": false,
    "deposit_client": null,
    "referral_source": "5382f467-a034-440c-bc7f-3dac9b2c8191",
    "referral_source_name": "flyers",
    "status", "potential",
    "comments": "VIP status",
    "archive": false,
    "professional": "5382f467-a034-440c-bc7f-3dac9b2c8191",
    "utm_campaign": "summer_sale",
    "utm_source": "google",
    "utm_medium": "cpc"
}

Authorization: `Database`

Authorization: Database

Scope: full, online_store (only name, firstname, middlename, lastname, gender, birthday, card_number, phone, email, comments fields), services_aggregator (only firstname, middlename, lastname, gender, birthday, card_number, phone, email, comments fields)

POST/clients{?fields}
Full URL: https://api.aihelps.com/v1/clients{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,firstname,middlename,lastname,title,gender,birthday,location,balance,bonus,card_number,phone,email,photo_exists,photo,postal_code,city,street,building,apartment,categories,categories_names,first_visit,first_visit_description,last_visit,last_visit_description,feedback,additional_fields,do_not_send_sms_notification,do_not_send_sms_promotion,do_not_send_email,create_date,deposit_client,referral_source,referral_source_name,status,comments,archive,professional,utm_campaign,utm_source,utm_medium
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
Body
{
    "firstname": "John",
    "lastname": " Doe",
    "phone": "+1 555 123 45 67",
    "email": "johndoe@gmail.com",
    "utm_campaign": "summer_sale",
    "utm_source": "google",
    "utm_medium": "cpc"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full,client_access_token (but id field should match client id, me can be used instead of id)

PUT/clients/{id}{?fields}
Full URL: https://api.aihelps.com/v1/clients/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me`)be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]list of fields to return (separated by comma)name,firstname,middlename,lastname,title,gender,birthday,location,balance,bonus,card_number,phone,email,photo_exists,photo,postal_code,city,street,building,apartment,categories,categories_names,first_visit,first_visit_description,last_visit,last_visit_description,feedback,additional_fields,do_not_send_sms_notification,do_not_send_sms_promotion,do_not_send_email,create_date,deposit_client,referral_source,referral_source_name,status,comments,archive,professional,utm_campaign,utm_source,utm_medium
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "phone": [
        "+1 555 123 45 67",
        "+1 555 123 45 68"
    ],
    "gender": "male",
    "utm_campaign": "summer_sale",
    "utm_source": "google",
    "utm_medium": "cpc"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/clients/{id}
Full URL: https://api.aihelps.com/v1/clients/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of clientcc903b03-ecaf-46d4-a030-bbfd1882f490
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response


Clients can be splitted into categories. This is quite helpful for filtering clients.

Authorization `Database`

Authorization Database

Scope full, reports

  • Parameter
    • fields: name,automatic (array[string], required) - list of fields to return (separated by comma).
GET/clientcategories{?fields}
Full URL: https://api.aihelps.com/v1/clientcategories{?fields}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "3286cc03-3f88-4c8e-8d94-0af35b67beaf",
        "name": "VIP",
        "automatic": true
    }
]

Authorization `Database`

Authorization Database

Scope full, reports

  • Parameter
    • id: bf45f298-3073-413a-876f-0f17f45e374c (identifier, required) - id of a category
    • fields: name, automatic (array[string], required) - list of fields to return (separated by comma).
GET/clientcategories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/clientcategories/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bf45f298-3073-413a-876f-0f17f45e374c",
    "name": "VIP",
    "automatic": false
}

Authorization `Database`

Authorization Database

Scope full

POST/clientcategories{?fields}
Full URL: https://api.aihelps.com/v1/clientcategories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,automatic
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Gold",
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "d8f244e8-f84d-4c21-b674-90135978216d",
    "name": "Gold",
    "automatic": false
}

Authorization `Database`

Authorization Database

Scope full

PUT/clientcategories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/clientcategories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of a client categoryeaf52652-3524-4c76-b6d9-0998bfd50fb9
fieldsarray[string]list of fields to return (separated by comma)name,automatic
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Gold",
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "d8f244e8-f84d-4c21-b674-90135978216d",
    "name": "Gold",
    "automatic": false
}

Authorization `Database`

Authorization Database

Scope full

DELETE/clientcategories/{id}
Full URL: https://api.aihelps.com/v1/clientcategories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of a client category, that should be removed6f300bd6-fa07-44a4-aed2-cca3719e52f5
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

This endpoint provide reculculatig dynamic categories for the client, for example

This endpoint provide reculculatig dynamic categories for the client, for example
in case of changing client infomation or his conditions.

Authorization Database

Scope full

POST/clients/{id}/recalculateCategoriesAsync
Full URL: https://api.aihelps.com/v1/clients/{id}/recalculateCategoriesAsync
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client.be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

This endpoint provide reculculatig dynamic categories for all clients,

This endpoint provide reculculatig dynamic categories for all clients,
checking the customer's compliance with this category.
This can be used in case of changing category or clients conditions.

Authorization Database

Scope full

POST/clients/categories/{id}/recalculateClientsAsync
Full URL: https://api.aihelps.com/v1/clients/categories/{id}/recalculateClientsAsync
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of category.be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

This endpoint provide reculculatig all dynamic categories for all clients,

This endpoint provide reculculatig all dynamic categories for all clients,
checking the customer's compliance with this categories.
This can be used once daily in case of changing category or clients conditions.

Authorization Database

Scope full

POST/clients/categories/recalculateClientsAsync
Full URL: https://api.aihelps.com/v1/clients/categories/recalculateClientsAsync
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (but id field should match client id, me can be used instead of id)

GET/clients/{id}/photo{?width,height,resize,access_token}
Full URL: https://api.aihelps.com/v1/clients/{id}/photo{?width,height,resize,access_token}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesclient id. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me`)cbaf2626-0f2b-4cae-a6dd-ca7ddaf2a1db
widthnumberimage width needed100
heightnumberimage height needed100
resizeenum[string]type of resize for imagefit
access_tokenstringtoken used for API requests9c4068e2-c81f-4d70-ad31-8f627ed9bced
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response

Set correct Content-Type header and put image in request body.

Set correct Content-Type header and put image in request body.
Providing no request body means deleting image.

Authorization: Database, Client

Scope: full, client_access_token (but id field should match client id, me can be used instead of id)

PUT/clients/{id}/photo
Full URL: https://api.aihelps.com/v1/clients/{id}/photo
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesclient id. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me`)f90a87cb-ef7f-444f-a05f-bf81ec055627
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Delete client photo.

Delete client photo. Same result as PUT /clients/{id}/photo with empty request body.

Authorization: Database, Client

Scope: full, client_access_token (but id field should match client id, me can be used instead of id)

DELETE/clients/{id}/photo
Full URL: https://api.aihelps.com/v1/clients/{id}/photo
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesclient id. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me`)f90a87cb-ef7f-444f-a05f-bf81ec055627
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Change history for client card fields and related data (categories, relations, files, etc.). Text fields (eventType, fieldNameConvert, converted values) are localized using Content-Language header.
Data only for the last 2 months is available. If you need older data you have to contact us individually.

Authorization: `Database`

Authorization: Database

Scope: full

GET/clients/changeLogs{?client}
Full URL: https://api.aihelps.com/v1/clients/changeLogs{?client}
Parameters
NameTypeRequiredDescriptionExample
clientidentifieryesclient idcbaf2626-0f2b-4cae-a6dd-ca7ddaf2a1db
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "date": "2019-01-15T10:30:00.000Z",
        "eventType": "Updated",
        "fieldName": "Phone",
        "fieldNameConvert": "Phone",
        "employeeName": "John Doe",
        "tableName": "client",
        "fieldBeforeConvert": "+1 555 111 11 11",
        "fieldAfterConvert": "+1 555 222 22 22",
        "event": 2,
        "gender": "Male"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

Same as GET /clients/changeLogs. Pass client id in client query parameter.

GET/clients/changeLogs/{id}{?client}
Full URL: https://api.aihelps.com/v1/clients/changeLogs/{id}{?client}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryeschange log entry id (reserved for future use)a1b2c3d4-e5f6-7890-abcd-ef1234567890
clientidentifieryesclient idcbaf2626-0f2b-4cae-a6dd-ca7ddaf2a1db
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "date": "2019-01-15T10:30:00.000Z",
        "eventType": "Updated",
        "fieldName": "Phone",
        "fieldNameConvert": "Phone",
        "employeeName": "John Doe",
        "tableName": "client",
        "fieldBeforeConvert": "+1 555 111 11 11",
        "fieldAfterConvert": "+1 555 222 22 22",
        "event": 2,
        "gender": "Male"
    }
]

Relation between clients and employees or client and client or employee and employee

Authorization: `Database`

Authorization: Database

Scope: full

GET/clients/relations{?fields}
Full URL: https://api.aihelps.com/v1/clients/relations{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).from_client,to_client,relation_type
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d4b305-e198-f02c-2743-cca9390c6d9b",
        "from_client": "88d3d8a4-0629-b0ce-5798-55163380117b",
        "to_client": "88d3d8a4-0629-b0ce-5798-55160e7a6556",
        "relation_type": "Child"
    },
    {
        "id": "88d4c84b-9562-db0e-25f9-8879620d3872",
        "from_client": "88d4c84b-59f2-fb62-25f9-88792de3ea4c",
        "to_client": "88d4c84b-1b9b-3e06-25f9-88796d89a302",
        "relation_type": "Sib"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

GET/clients/relations/{id}{?fields}
Full URL: https://api.aihelps.com/v1/clients/relations/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client relationbe0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]yeslist of fields to return (separated by comma).from_client,to_client,relation_type
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d4b305-e198-f02c-2743-cca9390c6d9b",
        "from_client": "88d3d8a4-0629-b0ce-5798-55163380117b",
        "to_client": "88d3d8a4-0629-b0ce-5798-55160e7a6556",
        "relation_type": "Child"
    }
]


Client history based on appointments, group appointments and sales. This endpoint helps to receive client history in one unified view (both sales and appointments) for some client.
But any changes should be done to original appointments or sales. Data is subject to the 2-month data history limit.

Get client history for specified client id.

Get client history for specified client id.

Authorization: Database

Scope: full

GET/clients/{id}/history{?fields}
Full URL: https://api.aihelps.com/v1/clients/{id}/history{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesclient id. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me/history`)be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]yeslist of fields to return (separated by comma)date,duration,professional,professional_name,professional_photo_exists,paid,items(id,name,type,picture,quantity,sum,sale_id),client_notified,feedback
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d39450-0c81-9ca8-139a-8eb20176600b",
        "date": "1799-12-31T00:00:00.000Z",
        "duration": 60,
        "professional": null,
        "professional_name": "",
        "professional_photo_exists": false,
        "paid": true,
        "items": [
            {
                "id": "88d37eed-6689-d1d3-6bee-ad104a954fc2",
                "name": "Premium",
                "type": "Card",
                "picture": null,
                "quantity": 1,
                "sum": 5000,
                "sale_id": "88d39450-0c81-9ca8-139a-8eb20176600b"
            }
        ],
        "client_notified": true,
        "feedback": {
            "date": "2018-04-28T21:20:11.000Z",
            "ratings": 5,
            "text": "well"
        }
    },
    {
        "id": "88d395df-bf56-7e8e-5278-6cf9506aaed4",
        "date": "2016-06-16T16:00:00.000Z",
        "duration": 35,
        "professional": "88d37eed-0e73-b347-6bee-ad103615dee1",
        "professional_name": "John Doe",
        "professional_photo_exists": false,
        "paid": true,
        "items": [
            {
                "id": "88d37ef2-5930-80f8-6bee-ad1021c2fd8b",
                "name": "Epilation",
                "type": "Service",
                "picture": null,
                "quantity": 1,
                "sum": 0,
                "sale_id": "88d395df-bf56-7e8e-5278-6cf9506aaed4"
            }
        ],
        "client_notified": true,
        "feedback": null
    },
    {
        "id": "88d39eaf-dc0e-ac59-1be5-be5c762ccc88",
        "date": "2016-06-27T20:00:00.000Z",
        "duration": 60,
        "professional": "88d37eeb-cb47-bedb-6bee-ad1048f62926",
        "professional_name": "",
        "professional_photo_exists": false,
        "paid": false,
        "items": [],
        "client_notified": true,
        "feedback": null
    }
]

Represents clients feedback details.

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module,client_access_token

GET/clients/feedbacks{?fields,public}
Full URL: https://api.aihelps.com/v1/clients/feedbacks{?fields,public}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)firstname,public,date,text,ratings
publicbooleanreturn only public feedbackstrue
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "9802426c-92a8-41f0-976b-5a643e3df6f2",
        "firstname": "John",
        "public": true,
        "date": "2019-01-01T10:00:00.000Z",
        "text": "cool professional",
        "ratings": {
            "a860ecab-e030-48c8-aeba-4c5a419db8c5": 2,
            "bd603053-a530-4cd0-b67e-db84192a8ea9": 5
        }
    },
    {
        "id": "4a87cc85-a4a2-40fa-930c-c0833ef24251",
        "firstname": "Bob",
        "public": true,
        "date": "2019-01-01T10:00:00.000Z",
        "text": "cool professional",
        "ratings": {
            "c680c43d-07ad-4050-959d-279a2c1ba272": 2,
            "32006adc-a269-43b8-83e7-6fb5ca5bbef3": 5
        }
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module,client_access_token (but id field should match client id, me can be used instead of id)

GET/clients/{id}/feedback{?fields,public}
Full URL: https://api.aihelps.com/v1/clients/{id}/feedback{?fields,public}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me/feedback`)be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]yeslist of fields to return (separated by comma)firstname,public,date,text,ratings
publicbooleanget only public/non-public feedbackstrue
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "4a87cc85-a4a2-40fa-930c-c0833ef24253",
    "firstname": "John",
    "public": true,
    "date": "2019-01-01T10:00:00.000Z",
    "text": "cool professional",
    "ratings": {
        "a860ecab-e030-48c8-aeba-4c5a419db8c5": 2,
        "bd603053-a530-4cd0-b67e-db84192a8ea9": 5
    }
}

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full,client_access_token (but id field should match client id, me can be used instead of id)

PUT/clients/{id}/feedback{?fields}
Full URL: https://api.aihelps.com/v1/clients/{id}/feedback{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me/feedback`)be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]list of fields to return (separated by comma)firstname,public,date,text,ratings
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "public": false,
    "text": "bad"
}
204Response

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full,client_access_token (but id field should match client id, me can be used instead of id)

DELETE/clients/{id}/feedback
Full URL: https://api.aihelps.com/v1/clients/{id}/feedback
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/clients/me/feedback`)be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response


This article provides information about referral sources, from which location can attract new clients

Authorization `Database`

Authorization Database

Scope full, client_module, reports

  • Parameter
    • fields: name,archive (array[string], required) - list of fields to return (separated by comma).
    • archive: false (boolean, optional) - get only archive or none archive referral source
GET/referralsources{?fields,archive}
Full URL: https://api.aihelps.com/v1/referralsources{?fields,archive}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "3286cc03-3f88-4c8e-8d94-0af35b67beaf",
        "name": "advertising",
        "archive": false
    },
    {
        "id": "3286cc03-3f88-4c8e-8d94-0af35b67b1a1",
        "name": "flyers",
        "archive": false
    }
]

Authorization `Database`

Authorization Database

Scope full, client_module, reports

  • Parameter
    • id: bf45f298-3073-413a-876f-0f17f45e374c (identifier, required) - id of referral source
    • fields: name, archive (array[string], required) - list of fields to return (separated by comma).
GET/referralsources/{id}{?fields}
Full URL: https://api.aihelps.com/v1/referralsources/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3286cc03-3f88-4c8e-8d94-0af35b67b1a1",
    "name": "flyers",
    "archive": false
}

Authorization `Database`

Authorization Database

Scope full

POST/referralsources{?fields}
Full URL: https://api.aihelps.com/v1/referralsources{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "flyers"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "d8f244e8-f84d-4c21-b674-90135978216d",
    "name": "flyers"
}

Authorization `Database`

Authorization Database

Scope full

PUT/referralsources/{id}{?fields}
Full URL: https://api.aihelps.com/v1/referralsources/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of a client categoryeaf52652-3524-4c76-b6d9-0998bfd50fb9
fieldsarray[string]list of fields to return (separated by comma)name,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "flyers"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "d8f244e8-f84d-4c21-b674-90135978216d",
    "name": "flyers"
}

Authorization `Database`

Authorization Database

Scope full

DELETE/referralsources/{id}
Full URL: https://api.aihelps.com/v1/referralsources/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of referral source, that should be removed6f300bd6-fa07-44a4-aed2-cca3719e52f5
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Employees

Employees are all persons working in beauty salon/fitness gym: professionals, administrators, directors, cleaning managers, client managers etc.
Some of them can login to program, some not. All employees are grouped into positions, more details about positions, read subsection Position.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module (available fields: photo_exists,photo,gender,default_appointment_duration,name,name_parts,sex,positions,position_names,roles,archive,public,address,schedules,services), reports, services_aggregator (only photo_exists, gender, default_appointment_duration, name, positions, position_names, roles, archive, public, address, schedules, services, archive)

GET/employees{?fields,location,position,role,service,free_time,free_time_skip_appointments,archive,public,client_gender,archive_service,name}
Full URL: https://api.aihelps.com/v1/employees{?fields,location,position,role,service,free_time,free_time_skip_appointments,archive,public,client_gender,archive_service,name}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,firstname,middlename,lastname,title,phone,email,gender,photo_exists,photo,positions,position_names,roles,permissions,archive,public,address,schedules,all_locations,feedback_count,average_feedback_rating,prepaymentRequired,comments,commentsPlainText
locationarray[identifier]get only employees which works in given location (several locations can be separated by comma)73a386aa-dfdd-4bba-be50-084c4104c599
positionarray[identifier]get only employees with given position (several positions can be separated by comma)1bd1288c-3457-429a-ab06-5071ca1704c3
rolearray[string]get only employees of given role (several roles can be separated by comma)professional
servicearray[identifier]get only employees that can provide all given services (several services can be separated by comma)aad32c8c-1cb7-429a-ab06-5071c4debca3
free_timestringget only employees who will be free at specified time range. If `location` filter is set, looks only at specified location (otherwise search in all).2018-11-29T19:30:00.000Z..2018-11-29T20:30:00.000Z
free_time_skip_appointmentsarray[identifier]if free_time filter used, specifies which appointments should be skipped checking (several appointments can be separated by comma) - skipped appointments will be treated as free timebc4311b8-329c-40a9-a784-04cb5f7fe1aa
archivebooleanget only archive or none archive employeesfalse
publicbooleanget only public or non public employeesfalse
client_genderenum[string]get only professionals who can provide services for given gendermale
archive_servicebooleanif `client_gender` filter used, check only archive/non-archive services for professionalsfalse
nameseveral name can be separated by comma
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d4d8c0-3830-5b07-7bfe-b80f0650b9f3",
        "name": "John Brown",
        "firstname": "John",
        "middlename": "",
        "lastname": "Brown",
        "title": "",
        "phone": [
            "+1 (800) 555 55 55"
        ],
        "email": [
            "bob@yahoo.com"
        ],
        "gender": "male",
        "photo_exists": true,
        "photo": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab923/photo",
        "positions": [
            "88d354c4-6ac5-a672-6996-67b22cd78ca6",
            "88d4d8c4-512f-7d55-7bfe-b80f413625dc"
        ],
        "roles": "professional",
        "permissions": [],
        "archive": false,
        "public": true,
        "services": [],
        "schedules": [
            {
                "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
                "schedule": null,
                "start_day": "1800-01-01T00:00:00.000Z"
            },
            {
                "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
                "schedule": null,
                "start_day": "1799-12-31T00:00:00.000Z"
            }
        ],
        "address": {
            "city": "New York",
            "street": "17 Avenue",
            "building": "17",
            "apartment": "",
            "postal_code": "222204"
        },
        "feedback_count": 5,
        "average_feedback_rating": 4.5,
        "prepaymentRequired": false,
        "comments": "Employee1",
        "commentsPlainText": "Employee1"
    },
    {
        "id": "72fcfa1d-65a7-404c-8c41-7449265ae489",
        "name": "John Doe",
        "firstname": "John",
        "middlename": "",
        "lastname": "Doe",
        "title": "",
        "phone": [
            "+1 (800) 555 55 55"
        ],
        "email": [
            "John@yahoo.com"
        ],
        "gender": "male",
        "photo_exists": true,
        "photo": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155cacb21/photo",
        "positions": [
            "ff13c4c4-6ac5-a672-6996-67bc2bd7aca1",
            "88d4d8c4-512f-7d55-7bfe-b80f4136c5aa"
        ],
        "roles": "professional",
        "permissions": [],
        "archive": false,
        "public": true,
        "services": [],
        "schedules": [
            {
                "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
                "schedule": null,
                "start_day": "1800-01-01T00:00:00.000Z"
            }
        ],
        "address": {
            "city": "Los Angelos",
            "street": "West lane",
            "building": "11",
            "apartment": "",
            "postal_code": "03065"
        },
        "feedback_count": 5,
        "average_feedback_rating": 4,
        "prepaymentRequired": false,
        "comments": "Employee2",
        "commentsPlainText": "Employee2"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module (available fields: photo_exists,photo,gender,default_appointment_duration,name,name_parts,sex,positions,position_names,roles,archive,public,address,schedules,services), reports, services_aggregator (only photo_exists,g ender, default_appointment_duration, name, positions, position_names, roles, archive, public, address, schedules, services, archive)

GET/employees/{id}{?fields}
Full URL: https://api.aihelps.com/v1/employees/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee id (`me` can be used for employee token)432c41bf-0cd7-4f13-83dd-a0c26ce29143
fieldsarray[string]yeslist of fields to return (separated by comma).name,firstname,middlename,lastname,title,phone,email,gender,photo_exists,positions,position_names,roles,archive,public,address,schedules,all_locations,feedback_count,average_feedback_rating,photo,prepaymentRequired,comments,commentsPlainText
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "432c41bf-0cd7-4f13-83dd-a0c26ce29143",
    "name": "John Brown",
    "firstname": "John",
    "middlename": "",
    "lastname": "Brown",
    "title": "",
    "phone": [
        "+1 (800) 555 55 55"
    ],
    "email": [
        "Doe@yahoo.com"
    ],
    "gender": "male",
    "photo_exists": true,
    "photo": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab91a/photo",
    "positions": [
        "ff13c4c4-6ac5-a672-6996-67bc2bd7aca1",
        "88d4d8c4-512f-7d55-7bfe-b80f4136c5aa"
    ],
    "roles": "professional",
    "permissions": [],
    "archive": false,
    "public": true,
    "services": [],
    "schedules": [
        {
            "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
            "schedule": null,
            "start_day": "1800-01-01T00:00:00.000Z"
        }
    ],
    "address": {
        "city": "New York",
        "street": "17 Avenue",
        "building": "17",
        "apartment": "",
        "postal_code": "222204"
    },
    "feedback_count": 5,
    "average_feedback_rating": 4.5,
    "prepaymentRequired": false,
    "comments": "Employee2",
    "commentsPlainText": "Employee2"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/employees{?fields}
Full URL: https://api.aihelps.com/v1/employees{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,firstname,middlename,lastname,title,phone,email,gender,photo_exists,photo,positions,position_names,roles,archive,public,address,schedules,all_locations,feedback_count,average_feedback_rating,prepaymentRequired,comments,commentsPlainText
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "firstname": "John",
    "middlename": "",
    "lastname": "Brown",
    "phone": [
        "+1 555 1234567"
    ],
    "email": "bobcorn@gmail.com"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "475a20e9-23ef-40ce-b2c4-c7dbcf230ebb"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/employees/{id}{?fields}
Full URL: https://api.aihelps.com/v1/employees/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee id (`me` can be used for employee token)432c41bf-0cd7-4f13-83dd-a0c26ce29143
fieldsarray[string]list of fields to return (separated by comma)name,firstname,middlename,lastname,title,phone,email,gender,photo_exists,photo,positions,position_names,roles,archive,public,address,schedules,all_locations,feedback_count,average_feedback_rating,prepaymentRequired,comments,commentsPlainText
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "phone": [
        "+1 555 1234567",
        "+1 555 1234568"
    ],
    "gender": "male",
    "archive": false
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/employees/{id}
Full URL: https://api.aihelps.com/v1/employees/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of employee432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, services_aggregator

GET/employees/{id}/photo{?width,height,resize,access_token}
Full URL: https://api.aihelps.com/v1/employees/{id}/photo{?width,height,resize,access_token}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee id. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/employees/me`)de2f90bc-2f19-4f2c-94d7-a735a07c1ae3
widthnumberimage width needed100
heightnumberimage height needed100
resizeenum[string]type of resize for imagefit
access_tokenstringtoken used for API requests9c4068e2-c81f-4d70-ad31-8f627ed9bced
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response

Set correct Content-Type header and put image in request body.

Set correct Content-Type header and put image in request body.
Providing no request body means deleting image.

Authorization: Database

Scope: full

PUT/employees/{id}/photo
Full URL: https://api.aihelps.com/v1/employees/{id}/photo
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee id. If client access token is used, only id of that client can be set here (string identifier `me` can be used instead of id: `/employees/me`)8f423935-ff1b-4a61-b0a9-8533ce5e683a
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

In some cases there is no difference, which one of selected list of professionals will provide a service.

In some cases there is no difference, which one of selected list of professionals will provide a service. In that case you can let API to select best-matching employee.
Current strategy is to select employee which is least busy this day (so API tries to make all professionals busy same label).

Authorization: Database

Scope: full, clients_module, services_aggregator

GET/employees/pick_professional{?date,professionals}
Full URL: https://api.aihelps.com/v1/employees/pick_professional{?date,professionals}
Parameters
NameTypeRequiredDescriptionExample
datedatetimeyesdate to choose employee2019-09-09
professionalsarray[identifier]yesemployee ids to select from (several employees are separated by comma)8f423935-ff1b-4a61-b0a9-8533ce5e683a
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "professional": "8f423935-ff1b-4a61-b0a9-8533ce5e683a"
}

All employees are divided into several categories:

  1. owners - owner, director and other persons who have unlimited or big access to program possibilities
  2. administrators - persons responsible for managing appointments and tickets
  3. professionals - persons who are making services itself
  4. assistants - persons, who helps professionals to make services
  5. temporary professionals - persons who are not working in salon/gym, but can be invited sometimes to make some services/group lessons
  6. client managers - persons responsible for calling potential and active clients and receiving their calls
  7. cashiers - separate persons in big salons/gyms responsible only for receiving cash from clients
  8. technical stuff - cleaning managers, engineers and other employees (one and only type of stuff who can't login program)
    Each category has it's own meaning, details for categories will be described later.
    There can be more than one group of persons in each category. For example, professionals can be: stylists, cosmetologists, manicurists, etc.;
    administrators can be grouped as top-administrators and normal administrators. Each such group is named a position.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only name field), reports

GET/positions{?fields,role}
Full URL: https://api.aihelps.com/v1/positions{?fields,role}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,role,permissions,parent
rolearray[string]get only positions with given role (several roles can be separated by comma)professional
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "04c5daec-2c11-4ce9-b00d-03a03d50356f",
        "name": "Stylists",
        "role": "professional",
        "permissions": [
            "",
            ""
        ]
    },
    {
        "id": "e28ebfd0-f847-4c3f-b2a1-07f4257b0764"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only name field), reports

GET/positions/{id}{?fields}
Full URL: https://api.aihelps.com/v1/positions/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of position04c5daec-2c11-4ce9-b00d-03a03d50356f
fieldsarray[string]yeslist of fields to return (separated by comma).name,role,permissions,parent
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "432c41bf-0cd7-4f13-83dd-a0c26ce29143",
}

Running application on a new system requires setting up connection to the database.
To simplify this process, invitation code can be used.

Generate an invitation and send it to an employee's email.

Generate an invitation and send it to an employee's email.

The e-mail message will contain url, which should be used to download and run the setup. Invitation code will be embedded into the setup.

Generated setup file will be valid for 14 days and can be used only once.

Method returns email on which invitation was sent (first email, if employee has more than one email).

Authorization: Database

Scope: full

POST/employees/{id}/code
Full URL: https://api.aihelps.com/v1/employees/{id}/code
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of an employee432c41bf-0cd7-4f13-83dd-a0c26ce29143
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "receiver_email": "example@employeeemail.com"
}

Validate an invitation code.

Validate an invitation code.

When running setup for the first time on a new system, application with embedded invitation code will sent it to the server to validate.

If code is valid, server will send database code and id of an employee, who was invited.

Authorization: none

GET/employees/codes/{code}
Full URL: https://api.aihelps.com/v1/employees/codes/{code}
Parameters
NameTypeRequiredDescriptionExample
codestringyesinvitation code to validateFE6A2BCF
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "database_code": "123456",
    "employee_id": "432c41bf-0cd7-4f13-83dd-a0c26ce29143"
}


Predefined schedules are designed to create templates for employees workdays.

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • fields: name,type,byWorkshifts,workDaysCount,freeDaysCount,workStart,workEnd,workShift,oddActive,evenActive,oddStart,oddEnd,oddShift,evenStart,evenEnd,evenShift,weekSchedule,weekShifts (array[string], required) - list of fields to return (separated by comma).
GET/predefinedSchedules/{?fields}
Full URL: https://api.aihelps.com/v1/predefinedSchedules/{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d896df-3918-481e-67b4-7a05342314b1",
        "name": "test",
        "type": "weekdays",
        "byWorkshifts": false,
        "workDaysCount": 1,
        "freeDaysCount": 1,
        "workStart": "",
        "workEnd": "",
        "workShift": 0,
        "oddActive": false,
        "evenActive": false,
        "oddStart": "",
        "oddEnd": "",
        "oddShift": 0,
        "evenStart": "",
        "evenEnd": "",
        "evenShift": 0,
        "weekSchedule": [
            {
                "weekDay": "monday",
                "timeFrom": "09:00",
                "timeTo": "18:00"
            },
            {
                "weekDay": "tuesday",
                "timeFrom": "09:00",
                "timeTo": "18:00"
            },
            {
                "weekDay": "wednesday",
                "timeFrom": "09:00",
                "timeTo": "18:00"
            },
            {
                "weekDay": "thursday",
                "timeFrom": "09:00",
                "timeTo": "18:00"
            },
            {
                "weekDay": "friday",
                "timeFrom": "09:00",
                "timeTo": "18:00"
            },
            {
                "weekDay": "saturday",
                "timeFrom": "09:00",
                "timeTo": "09:00"
            },
            {
                "weekDay": "sunday",
                "timeFrom": "09:00",
                "timeTo": "09:00"
            }
        ],
        "weekShifts": [
            {
                "weekDay": "monday",
                "dayShift": 0
            },
            {
                "weekDay": "tuesday",
                "dayShift": 0
            },
            {
                "weekDay": "wednesday",
                "dayShift": 0
            },
            {
                "weekDay": "thursday",
                "dayShift": 0
            },
            {
                "weekDay": "friday",
                "dayShift": 0
            },
            {
                "weekDay": "saturday",
                "dayShift": 0
            },
            {
                "weekDay": "sunday",
                "dayShift": 0
            }
        ]
    },
    {
        "id": "88d83a01-d791-95f8-2a0a-8b443dd6ebb3",
        "name": "Eveeryday",
        "type": "weekdays",
        "byWorkshifts": false,
        "workDaysCount": 1,
        "freeDaysCount": 1,
        "workStart": "",
        "workEnd": "",
        "workShift": 0,
        "oddActive": false,
        "evenActive": false,
        "oddStart": "",
        "oddEnd": "",
        "oddShift": 0,
        "evenStart": "",
        "evenEnd": "",
        "evenShift": 0,
        "weekSchedule": [
            {
                "weekDay": "monday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            },
            {
                "weekDay": "tuesday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            },
            {
                "weekDay": "wednesday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            },
            {
                "weekDay": "thursday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            },
            {
                "weekDay": "friday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            },
            {
                "weekDay": "saturday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            },
            {
                "weekDay": "sunday",
                "timeFrom": "00:00",
                "timeTo": "00:00"
            }
        ],
        "weekShifts": [
            {
                "weekDay": "monday",
                "dayShift": 0
            },
            {
                "weekDay": "tuesday",
                "dayShift": 0
            },
            {
                "weekDay": "wednesday",
                "dayShift": 0
            },
            {
                "weekDay": "thursday",
                "dayShift": 0
            },
            {
                "weekDay": "friday",
                "dayShift": 0
            },
            {
                "weekDay": "saturday",
                "dayShift": 0
            },
            {
                "weekDay": "sunday",
                "dayShift": 0
            }
        ]
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • id: 88d83a01-d791-95f8-2a0a-8b443dd6ebb3 (identifier, required) - id of resource
    • fields: name,type,byWorkshifts,workDaysCount,freeDaysCount,workStart,workEnd,workShift,oddActive,evenActive,oddStart,oddEnd,oddShift,evenStart,evenEnd,evenShift,weekSchedule,weekShifts (array[string], required) - list of fields to return (separated by comma).
GET/predefinedSchedules/{id}{?fields}
Full URL: https://api.aihelps.com/v1/predefinedSchedules/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d83a01-d791-95f8-2a0a-8b443dd6ebb3",
    "name": "Everyday",
    "type": "weekdays",
    "byWorkshifts": false,
    "workDaysCount": 1,
    "freeDaysCount": 1,
    "workStart": "",
    "workEnd": "",
    "workShift": 0,
    "oddActive": false,
    "evenActive": false,
    "oddStart": "",
    "oddEnd": "",
    "oddShift": 0,
    "evenStart": "",
    "evenEnd": "",
    "evenShift": 0,
    "weekSchedule": [
        {
            "weekDay": "monday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "tuesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "wednesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "thursday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "friday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "saturday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "sunday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        }
    ],
    "weekShifts": [
        {
            "weekDay": "monday",
            "dayShift": 0
        },
        {
            "weekDay": "tuesday",
            "dayShift": 0
        },
        {
            "weekDay": "wednesday",
            "dayShift": 0
        },
        {
            "weekDay": "thursday",
            "dayShift": 0
        },
        {
            "weekDay": "friday",
            "dayShift": 0
        },
        {
            "weekDay": "saturday",
            "dayShift": 0
        },
        {
            "weekDay": "sunday",
            "dayShift": 0
        }
    ]
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/predefinedSchedules{?fields}
Full URL: https://api.aihelps.com/v1/predefinedSchedules{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,type,byWorkshifts,workDaysCount,freeDaysCount,workStart,workEnd,workShift,oddActive,evenActive,oddStart,oddEnd,oddShift,evenStart,evenEnd,evenShift,weekSchedule,weekShifts
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
Body
{
    "name": "two by two",
    "type": "nAfterM",
    "byWorkshifts": false,
    "workDaysCount": 2,
    "freeDaysCount": 2,
    "workStart": "09:00",
    "workEnd": "18:00",
    "workShift": 0,
    "oddActive": false,
    "evenActive": false,
    "oddStart": "",
    "oddEnd": "",
    "oddShift": 0,
    "evenStart": "",
    "evenEnd": "",
    "evenShift": 0,
    "weekSchedule": [
        {
            "weekDay": "monday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "tuesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "wednesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "thursday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "friday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "saturday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "sunday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        }
    ],
    "weekShifts": [
        {
            "weekDay": "monday",
            "dayShift": 0
        },
        {
            "weekDay": "tuesday",
            "dayShift": 0
        },
        {
            "weekDay": "wednesday",
            "dayShift": 0
        },
        {
            "weekDay": "thursday",
            "dayShift": 0
        },
        {
            "weekDay": "friday",
            "dayShift": 0
        },
        {
            "weekDay": "saturday",
            "dayShift": 0
        },
        {
            "weekDay": "sunday",
            "dayShift": 0
        }
    ]
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d89784-6cc2-7e6a-6668-ee372dd3d84b",
    "name": "two by two",
    "type": "nAfterM",
    "byWorkshifts": false,
    "workDaysCount": 2,
    "freeDaysCount": 2,
    "workStart": "09:00",
    "workEnd": "18:00",
    "workShift": 0,
    "oddActive": false,
    "evenActive": false,
    "oddStart": "08:00",
    "oddEnd": "21:00",
    "oddShift": 0,
    "evenStart": "08:00",
    "evenEnd": "21:00",
    "evenShift": 0,
    "weekSchedule": [
        {
            "weekDay": "monday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "tuesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "wednesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "thursday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "friday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "saturday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "sunday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        }
    ],
    "weekShifts": [
        {
            "weekDay": "monday",
            "dayShift": 0
        },
        {
            "weekDay": "tuesday",
            "dayShift": 0
        },
        {
            "weekDay": "wednesday",
            "dayShift": 0
        },
        {
            "weekDay": "thursday",
            "dayShift": 0
        },
        {
            "weekDay": "friday",
            "dayShift": 0
        },
        {
            "weekDay": "saturday",
            "dayShift": 0
        },
        {
            "weekDay": "sunday",
            "dayShift": 0
        }
    ]
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/predefinedSchedules/{id}{?fields}
Full URL: https://api.aihelps.com/v1/predefinedSchedules/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid resource88d89784-6cc2-7e6a-6668-ee372dd3d84b
fieldsarray[string]yeslist of fields to return (separated by comma).name,type,byWorkshifts,workDaysCount,freeDaysCount,workStart,workEnd,workShift,oddActive,evenActive,oddStart,oddEnd,oddShift,evenStart,evenEnd,evenShift,weekSchedule,weekShifts
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "two by two 2",
    "type": "nAfterM",
    "byWorkshifts": false,
    "workDaysCount": 2,
    "freeDaysCount": 2,
    "workStart": "09:00",
    "workEnd": "18:00",
    "workShift": 0,
    "oddActive": false,
    "evenActive": false,
    "oddStart": "08:00",
    "oddEnd": "21:00",
    "oddShift": 0,
    "evenStart": "08:00",
    "evenEnd": "21:00",
    "evenShift": 0,
    "weekSchedule": [
        {
            "weekDay": "monday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "tuesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "wednesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "thursday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "friday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "saturday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "sunday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        }
    ],
    "weekShifts": [
        {
            "weekDay": "monday",
            "dayShift": 0
        },
        {
            "weekDay": "tuesday",
            "dayShift": 0
        },
        {
            "weekDay": "wednesday",
            "dayShift": 0
        },
        {
            "weekDay": "thursday",
            "dayShift": 0
        },
        {
            "weekDay": "friday",
            "dayShift": 0
        },
        {
            "weekDay": "saturday",
            "dayShift": 0
        },
        {
            "weekDay": "sunday",
            "dayShift": 0
        }
    ]
}
200Response
Body
{
    "id": "88d89784-6cc2-7e6a-6668-ee372dd3d84b",
    "name": "two by two 2",
    "type": "nAfterM",
    "byWorkshifts": false,
    "workDaysCount": 2,
    "freeDaysCount": 2,
    "workStart": "09:00",
    "workEnd": "18:00",
    "workShift": 0,
    "oddActive": false,
    "evenActive": false,
    "oddStart": "08:00",
    "oddEnd": "21:00",
    "oddShift": 0,
    "evenStart": "08:00",
    "evenEnd": "21:00",
    "evenShift": 0,
    "weekSchedule": [
        {
            "weekDay": "monday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "tuesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "wednesday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "thursday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "friday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "saturday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        },
        {
            "weekDay": "sunday",
            "timeFrom": "00:00",
            "timeTo": "00:00"
        }
    ],
    "weekShifts": [
        {
            "weekDay": "monday",
            "dayShift": 0
        },
        {
            "weekDay": "tuesday",
            "dayShift": 0
        },
        {
            "weekDay": "wednesday",
            "dayShift": 0
        },
        {
            "weekDay": "thursday",
            "dayShift": 0
        },
        {
            "weekDay": "friday",
            "dayShift": 0
        },
        {
            "weekDay": "saturday",
            "dayShift": 0
        },
        {
            "weekDay": "sunday",
            "dayShift": 0
        }
    ]
}

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/predefinedSchedules/{id}
Full URL: https://api.aihelps.com/v1/predefinedSchedules/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid resource88d89784-6cc2-7e6a-6668-ee372dd3d84b
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

This endpoint get predefined schedule Name by context.

This endpoint get predefined schedule Name by context. Headers Content-Language is required.

Authorization: Database

Scope: full

GET/predefinedSchedules:proposeName
Full URL: https://api.aihelps.com/v1/predefinedSchedules:proposeName
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
Content-Languageen
Body
{
    "type": "nAfterM",
    "byWorkshifts": false,
    "workDaysCount": 1,
    "freeDaysCount": 1,
    "workStart": "00:00",
    "workEnd": "00:01"
},
{
    "type": "evenOdd",
    "oddActive": true,
    "evenActive": true,
    "oddStart": "00:10",
    "oddEnd": "00:20",
    "evenStart": "01:00",
    "evenEnd": "02:00"
},
{
    "type": "weekdays",
    "weekSchedule": [
        {
            "weekDay": "monday",
            "timeFrom": "10:00",
            "timeTo": "12:00"
        },
        {
            "weekDay": "tuesday",
            "timeFrom": "10:00",
            "timeTo": "12:00"
        },
        {
            "weekDay": "wednesday",
            "timeFrom": "10:00",
            "timeTo": "12:00"
        },
        {
            "weekDay": "thursday",
            "timeFrom": "10:00",
            "timeTo": "14:00"
        },
        {
            "weekDay": "sunday",
            "timeFrom": "11:00",
            "timeTo": "12:00"
        }
    ]
}
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "name": "Mo 09:00-18:00, We-Th 09:00-18:00, Sa 09:00-18:00"
}

Get free time for employees for given date or time period.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, services_aggregator

  • Parameter
    • from: 2019-01-01T10:00:00.000Z (datetime, required) - start date to get free time
    • to: 2019-01-03T10:00:00.000Z (datetime, required) - end date to get free time
    • duration: 120 (number, required) - number of minutes for planned appointment
    • step: 30m (enum[string], optional) - time steps in minutes which will be checked and returned if free time. Each returned step for professional is free time range {returned time;returned time + duration} (only if it is 100% free - even 1 minute of a previous appointment and the entire slot for 3 hours will be busy and will not be returned). If step set auto then step is selected automatically depending on provided or calculated duration (step is selected between 15, 30 and 60 minutes depending on duration).
      • Members
        • 5m
        • 10m
        • 15m
        • 20m
        • 30m
        • 60m
        • 90m
        • 120m
        • 150m
        • 180m
        • auto
    • professionals: 88d4b305-e198-f02c-2743-cca9390c631c (array[string], optional) - get free time only for given professionals (several professionals are separated by comma)
    • location: a7dd57e5-c495-46d4-b54d-753061d355a0 (array[identifier], optional) - get free time only for given location
    • services: e9968ac9-528c-4fd9-9af8-ef7023420d0a (array[identifier], optional) - get free time for professionals that can handle all given services (any professional can handle all given services). Also checks if resources are available for given services.
    • skip_appointments: c8258b28-4499-4d9c-a48d-d14e9c5ac622 (array[identifier], optional) - consider time used by given appointments as free (several appointments are separated by comma)
    • skip_sales: ef1d31ae-3970-441c-ad91-4aa4b8ec20b4 (array[identifier], optional) - consider time used by given sales as free (several sales are separated by comma)
    • skip_group_lessons: f80000fe-207e-44ed-b684-effa83430834 (array[identifier], optional) - consider time used by given group lessons as free (several group lessons are separated by comma)
    • exclude: 2019-01-01T10:00:00.000Z..2019-01-02T10:00:00.000Z (array[rangedate], optional) - consider provided time ranges as busy (several time ranges are separated by comma)
    • add_now_time: 20 (number, optional) - number of minutes from now that should be considered as busy (do not book for upcoming N minutes)
      • Default: 0
    • nearest_day_only: true (boolean, optional) - if true then take free time for nearest day (one day), if false then for all time from attribute from to attribute to
    • client_gender: male (enum[string], optional) - get only professionals who can provide services of given sex (works only if specific services not provided via services filter)
      • Members
        • male
        • female
    • public_employees: true (boolean, optional) - get only professionals for which public (employee attribute) is either true or false. public true means client can book professional by himself.
      • Default: none
    • gaps_mode: none (enum[string], optional) - mode used to optimize gaps in professional time (more aggressive node returns less time slots)
      • Default: none
      • Members
        • none - no optimizations, all available time slots returned
        • optimal - ignoring step, step calculated based on duration
        • maximal - allows booking only on start or end of free time slot (for example, booking for 1 hour if free time slots 9:00-12:00 and 14:00-21:00 available will return 9:00, 11:00, 14:00 and 20:00), specific positions allowed depends from gaps_positions
        • maximal_if_has_appointment - use maximal mode if professional has more than one free time slot for specific day (for example, 9:00-12:00 and 14:00-21:00, at least one appointment already assigned), if only one time slot (for example, 9:00-21:00, no appointments yet or appointments at day start/end) use optimal mode
    • gaps_positions: day_start (array[string], optional) - for maximal & maximal_if_has_appointment gaps_mode defines what times are available for booking (several options can be selected). For example, professional works from 9:00 till 21:00, already has bookings 9:00-10:30, 13:00-14:00 and 18:00-18:30, so free time slots are 10:30-13:00, 14:00-18:00 and 18:30-21:00, duration is 1 hour. See possible positions in options descriptions.
      • Default: day_start
      • Members
        • day_start - at day start (or first free time after day start if any time at day start already booked). In example above will return time 10:30.
        • before_appointment - time just before appointment in the middle of the day. In example above will return time 12:00 and 17:00.
        • after_appointment - time just after appointment in the middle of the day. In example above will return time 14:00 and 18:30.
        • day_end - just before day end (or last free time before day end if any time at day end already booked). In example above will return time 20:00.
GET/employees/free_time{?step,duration,professionals,from,to,location,services,skip_appointments,skip_sales,skip_group_lessons,exclude,add_now_time,nearest_day_only,client_gender,public_employees,gaps_mode,gaps_positions}
Full URL: https://api.aihelps.com/v1/employees/free_time{?step,duration,professionals,from,to,location,services,skip_appointments,skip_sales,skip_group_lessons,exclude,add_now_time,nearest_day_only,client_gender,public_employees,gaps_mode,gaps_positions}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "88d4b305-e198-f02c-2743-cca9390c631c": {
        "2019-01-01": [
            "10:00",
            "10:30",
            "11:00"
        ],
        "2019-01-02": [
            "10:00",
            "10:30",
            "11:00"
        ]
    },
    "023276a7-7ca9-45c9-9f9c-b536ec20315b": {
        "2019-01-01": [
            "10:00",
            "10:30",
            "11:00"
        ],
        "2019-01-02": [
            "10:00",
            "10:30",
            "11:00"
        ]
    }
}

Assignments of predefined schedules to employees.

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/employeeschedule{?fields,employee,location,from,to}
Full URL: https://api.aihelps.com/v1/employeeschedule{?fields,employee,location,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).location,predefinedSchedule,employee,scheduleStartDate
employeeidentifierget only schedules for given employee0997d37b-49fc-4bd6-8c24-0fbcacb141a7
locationidentifierget only schedules for given location3635cbcf-54e0-4d23-aeb5-6ecb58abb129
fromdatetimeget schedules with `scheduleStartDate` at or after specified date2019-01-01T00:00:00.000Z
todatetimeget schedules with `scheduleStartDate` before specified date2019-02-01T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "246db366-061f-45ac-984d-de8050c045a1",
        "location": "3635cbcf-54e0-4d23-aeb5-6ecb58abb129",
        "predefinedSchedule": "04c5daec-2c11-4ce9-b00d-03a03d50356f",
        "employee": "0997d37b-49fc-4bd6-8c24-0fbcacb141a7",
        "scheduleStartDate": "2019-01-01T00:00:00.000Z"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/employeeschedule/{id}{?fields}
Full URL: https://api.aihelps.com/v1/employeeschedule/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee schedule id246db366-061f-45ac-984d-de8050c045a1
fieldsarray[string]yeslist of fields to return (separated by comma).location,predefinedSchedule,employee,scheduleStartDate
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "246db366-061f-45ac-984d-de8050c045a1",
    "location": "3635cbcf-54e0-4d23-aeb5-6ecb58abb129",
    "predefinedSchedule": "04c5daec-2c11-4ce9-b00d-03a03d50356f",
    "employee": "0997d37b-49fc-4bd6-8c24-0fbcacb141a7",
    "scheduleStartDate": "2019-01-01T00:00:00.000Z"
}

Actual or planned employee work time for specific days.

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/employeeday{?fields,employee,location,from,to}
Full URL: https://api.aihelps.com/v1/employeeday{?fields,employee,location,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).location,hall,employee,dateStart,dateEnd
employeeidentifierget only days for given employee0997d37b-49fc-4bd6-8c24-0fbcacb141a7
locationidentifierget only days for given location3635cbcf-54e0-4d23-aeb5-6ecb58abb129
fromdatetimeget days with start date at or after specified date2019-01-01T00:00:00.000Z
todatetimeget days with end date before specified date2019-02-01T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "905e5ff6-9d41-465b-aced-7ea81a7e2ee3",
        "location": "3635cbcf-54e0-4d23-aeb5-6ecb58abb129",
        "hall": "e1462348-3bda-45fe-b9bc-a2ee8df8b60e",
        "employee": "0997d37b-49fc-4bd6-8c24-0fbcacb141a7",
        "dateStart": "2019-01-15T09:00:00.000Z",
        "dateEnd": "2019-01-15T18:00:00.000Z"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/employeeday/{id}{?fields}
Full URL: https://api.aihelps.com/v1/employeeday/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee day id905e5ff6-9d41-465b-aced-7ea81a7e2ee3
fieldsarray[string]yeslist of fields to return (separated by comma).location,hall,employee,dateStart,dateEnd
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "905e5ff6-9d41-465b-aced-7ea81a7e2ee3",
    "location": "3635cbcf-54e0-4d23-aeb5-6ecb58abb129",
    "hall": "e1462348-3bda-45fe-b9bc-a2ee8df8b60e",
    "employee": "0997d37b-49fc-4bd6-8c24-0fbcacb141a7",
    "dateStart": "2019-01-15T09:00:00.000Z",
    "dateEnd": "2019-01-15T18:00:00.000Z"
}

Employee days off (holidays, sick leaves, etc.).

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/employeedayoff{?fields,employee,location,from,to}
Full URL: https://api.aihelps.com/v1/employeedayoff{?fields,employee,location,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).location,employee,date
employeeidentifierget only days off for given employee0997d37b-49fc-4bd6-8c24-0fbcacb141a7
locationidentifierget only days off for given location3635cbcf-54e0-4d23-aeb5-6ecb58abb129
fromdatetimeget days off with date at or after specified date2019-01-01T00:00:00.000Z
todatetimeget days off with date before specified date2019-02-01T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "cfbb963e-3ceb-4764-b3f4-805f3a3e056b",
        "location": "3635cbcf-54e0-4d23-aeb5-6ecb58abb129",
        "employee": "0997d37b-49fc-4bd6-8c24-0fbcacb141a7",
        "date": "2019-01-20T00:00:00.000Z"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/employeedayoff/{id}{?fields}
Full URL: https://api.aihelps.com/v1/employeedayoff/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesemployee day off idcfbb963e-3ceb-4764-b3f4-805f3a3e056b
fieldsarray[string]yeslist of fields to return (separated by comma).location,employee,date
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cfbb963e-3ceb-4764-b3f4-805f3a3e056b",
    "location": "3635cbcf-54e0-4d23-aeb5-6ecb58abb129",
    "employee": "0997d37b-49fc-4bd6-8c24-0fbcacb141a7",
    "date": "2019-01-20T00:00:00.000Z"
}

Each employee has two accounts in system:

  1. In each database employee has access information stored about employee, specific to that database (contacts, schedule, salary etc.). If employee has access to several databases, in each database id of that employee would be different.
  2. Common employee account - stored not in specific database, but on top level, independently from specific database. Even if employee lost access to last database, such account information still exists. We name this accounts "users" (to differ from employee account in specific database). Such user has unique id (different from ids of connected employees accounts), general information, list of contacts (phone numbers and e-mails, either verified or not) and list of connected employees accounts in different databases.
    This section describes several endpoints helping to work with user account. All these endpoints need valid employee token.
    Do not mess this section /me/* endpoints with information about current employee in active database: /employees/me endpoint.
    New user can easily be created and even contacts be added. But to be able to receive access token, user should verify at least one contact (either phone or e-mail) and
    use that contact for login (receiving token). User password can be set after verifying any contact and this password can be used for further logins.

Authorization: `Database`

Authorization: Database

Scope: any

GET/me{?fields}
Full URL: https://api.aihelps.com/v1/me{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).firstname,lastname,password,databases,contacts
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "38dc3801-a1aa-40b8-8e58-f00d81bc0019",
    "firstname": "John",
    "lastname": "Doe",
    "password": true,
    "databases": [
        {
            "id": 123456,
            "name": "ABC Salon NY",
            "locations": [
                {
                    "id": "96e7b6c7-1813-4719-8676-544b1488637e",
                    "name": "ABC Salon NY Brooklyn",
                    "city": "New York",
                    "address": "2818 Foster Ave",
                    "active": true
                },
                {
                    "id": "d80e7df4-fa60-4c78-9f27-3f6cca49accb",
                    "name": "ABC Salon NY Manhatten",
                    "city": "New York",
                    "address": "",
                    "active": false
                },
                {
                    "id": "7eb575ee-59b1-471d-87c5-ca10ac15712d",
                    "name": "ABC Salon NY Queens",
                    "city": "New York",
                    "address": "",
                    "active": true
                }
            ]
        },
        {
            "id": 123457,
            "name": "ABC Salon LA",
            "locations": [
                {
                    "id": "8642faa0-d830-44cc-ac9a-add946edad65",
                    "name": "ABC Salon LA Downtown",
                    "city": "Los Angelos",
                    "address": "",
                    "active": false
                },
                {
                    "id": "abc21c49-47b5-4f80-b5e7-f3d61338984e",
                    "name": "ABC Salon LA Hollywood",
                    "city": "Los Angelos",
                    "address": "",
                    "active": true
                }
            ]
        },
        {
            "id": 123458,
            "name": "ABC Salon SF",
            "locations": [
                {
                    "id": "de491f53-0969-4d08-9b04-b6d58b44f610",
                    "name": "ABC Salon SF Bay Area",
                    "city": "San Fransisco",
                    "address": "",
                    "active": false
                }
            ]
        }
    ],
    "contacts": [
        {
            "type": "phone",
            "contact": "18005550123",
            "verified": true
        },
        {
            "type": "email",
            "contact": "a@gmail.com",
            "verified": false
        }
    ]
}

Authorization: `Database`

Authorization: Database

Scope: any

PUT/me{?fields}
Full URL: https://api.aihelps.com/v1/me{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)firstname,lastname,password,databases,contacts
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "firstname": "Johnathan",
    "lastname": "Brown",
    "password": "VemTVHy9SrRg"
}
204Response

Add user contact without verification.

Add user contact without verification. Contact can't be used for login until validated and has information purpose only.

You can't add contact without verification if it already exists in someone else contacts list, either verified or not. Use adding contact with verification in this case.

Authorization: Database

Scope: any

POST/me/contacts/{contact}
Full URL: https://api.aihelps.com/v1/me/contacts/{contact}
Parameters
NameTypeRequiredDescriptionExample
contactstringyescontact to add18005550123
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Contact verification can be used in several cases:

Contact verification can be used in several cases:

  1. user has contact and contact is not verified yet
  2. contact belongs to no one yet - on this call contact will be added to your contacts list (as not verified), next logic is same as for your non-verified contact (combine two steps in one: adding contact + verification)
  3. contact belongs to someone else - after verification contact will be stolen from that user or user accounts will be combined (see next endpoint for details)

This endpoint just send sms or e-mail with code (call this endpoint once more if you need to resend message) for your or any other contact.

Method returns error "Your contact already verified" if you have this contact in your contact list and this contact is verified.

Pause should be kept between re-sending message on same contact. If you try to resend sms less than in a minute or e-mail less than in 5 minutes, error will be received with
number of seconds needed to wait before sending message once again will be allowed.

Required header is "Content-Language": it defines language of sms/e-mail text, smth. like "Your login code is: " in english.

Authorization: Database

Scope: any

POST/me/contacts/{contact}{?send_code}
Full URL: https://api.aihelps.com/v1/me/contacts/{contact}{?send_code}
Parameters
NameTypeRequiredDescriptionExample
contactstringyescontact to add18005550123
send_codestringyespass this parameter without value to send code
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
204Response

If you receive code sent by previous endpoint, pass it as `code` parameter.

If you receive code sent by previous endpoint, pass it as code parameter. If code is correct, result will be following:

  1. If contact already in your list (or was quietly added when code was sent) - it becomes verified
  2. If contact in someone else contact list (user2), several cases exists:
    1. contact was not verified and user2 has no verified contact - seems that user2 is the same user registered in system on another contact but never made login. User2 account will be merged into current user account (with all non-verified contacts and access to databases).
    2. contact was not verified but user2 has at least one verified contact - user2 already logged into system, this disputable contact can be added by mistake for user2 and merging accounts is not secure - current user and user2 can be two different persons. So system just steals this contact from user2 and makes it verified. If current user and user2 are really one person, current user should add any verified user2 contact or user2 should add any current user verified contact - and we go to case 2.3).
    3. contact was verified - current user has right for this contact and user2 has right for it - possible only when current user and user2 are same person. So it will be safe to merge user2 account into current user account (with all verified & non-verified contacts and access to databases).

If provided code is wrong, error returned. After 5 wrong attempts contact blocks for 10 minutes for verifications and new code will be generated (now always 12-digit for both phone
and e-mail for security reasons). After next 5 wrong attempts contact blocks for another 10 minutes and new code generated.

For user convenience system add dashes for long codes. These dashes are optional and do not influence on verification (you even can set you own separators in code - system strips all non-digits from code before check).

Authorization: Database

Scope: any

POST/me/contacts/{contact}{?code}
Full URL: https://api.aihelps.com/v1/me/contacts/{contact}{?code}
Parameters
NameTypeRequiredDescriptionExample
contactstringyescontact to add18005550123
codestringyesverification code received in sms or e-mail6040-9487-1473
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Remove user contact.

Remove user contact. If contact is verified and it is only one user verified contact, it can't be removed.

Authorization: Database

Scope: any

DELETE/me/contacts/{contact}
Full URL: https://api.aihelps.com/v1/me/contacts/{contact}
Parameters
NameTypeRequiredDescriptionExample
contactstringyescontact to remove18005550123
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

<a name="select-database"></a>

When employee access token received, initially it is not connected to any database and location - thus no database specific requests can be made. To select specific database and location (inside database), call this endpoint. If you need to change database or/and location, this method can be called for second time (or more).

On success, token will be re-registered to new database and location (all requests will be made to new database, old database become unavailable). So, only one
database accessible via one access token at once (there should be no situations where you need access to several databases at once).
Access token, expire date and refresh token will be the same.

Authorization: Database

Scope: any

  • Attributes
    • database: 123456 (number, required) - 6-digit database code
    • location: 1f296585-856f-4b48-95ca-9511c0ba5c71 (identifier, required) - location id (Locations)(#locations)
POST/me/select_database
Full URL: https://api.aihelps.com/v1/me/select_database
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "database": 123456,
    "location": "2dabff53-0e22-463f-98e4-d37b501c6545"
}
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "access_token": "d075dde6-7c91-4fc0-b1dd-b75b9c99a2f5",
    "expires_at": "2016-08-12T14:18:27.000Z",
    "refresh_token": "f9e96585-856f-4b48-95ca-9511c0ba5576",
    "server": 1,
    "database": 123456,
    "location": "2dabff53-0e22-463f-98e4-d37b501c6545",
    "scope":
    [
        "clients",
        "sales"
    ],
    "possibilities":
    [
        "Clients",
        "Services",
        "Products",
        "Salary",
        ...
    ],
    "user": "38dc3801-a1aa-40b8-8e58-f00d81bc0019",
    "employee": "94467e16-13a6-4159-bde8-f78326fa4c52"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "expires_at": {
            "type": "string"
        },
        "refresh_token": {
            "type": "string"
        },
        "server": {
            "type": "number"
        },
        "database": {
            "type": "string"
        },
        "location": {
            "type": "string"
        },
        "scope": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "possibilities": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "user": {
            "type": "string"
        },
        "employee": {
            "type": "string"
        }
    }
}

Services

Services usually provided by professionals, take some time to be done and usually are planned in schedule.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only category, name, duration, gender, location_prices, description, descriptionPlainText, sex, price_currency, picture, public, parent, archive, noProfessionalPriceInNativeCurrency, location_prices_in_native_currency fields), reports, services_aggregator (only category, name, duration, gender, location_prices, description, descriptionPlainText, sex, price_currency, picture, public, parent, archive, noProfessionalPriceInNativeCurrency, location_prices_in_native_currency fields)

  • Parameter
    • fields: name,description,descriptionPlainText,duration,gender,price_currency,no_professional_price,category,picture,pictureUrl,public,location_prices,halls,resources,color,article,barcode,with_assistant,service_by_time,department,archive (array[string], required) - list of fields to return (separated by comma).
    • client_gender: male (enum[string], optional) - get only services for given gender
      • Members
        • male
        • female
    • public: true (boolean, optional) - get only public or non public services
    • has_professional_price: true (boolean, optional) - get only services which can be provided by some professional (exclude non professional services if true) or only non professional services if false
    • position: 6ade5e30-9ec9-4975-9a1b-53fdc4b1bb05 (identifier, optional) - get only services, which can be provided by given position professionals (several positions can be separated by comma)
    • professional: 88d44832-8c92-01da-6c10-c5991fd7bb08 (identifier, optional) - get only services, which can be provided by given professionals (several professionals can be separated by comma)
    • free_time: 2018-11-29T19:30:00.000Z (date, optional) - get only services free at specified time start (duration is equal to service duration, custom for each service). If location filter is set, looks only at specified location (otherwise search in all).
    • free_time_skip_appointments: bc4311b8-329c-40a9-a784-04cb5f7fe1aa (array[identifier], optional) - if free_time filter used, specifies which appointments should be skipped checking (several appointments can be separated by comma) - skipped appointments will be treated as free time
    • location: 73a386aa-dfdd-4bba-be50-084c4104c599 (array[identifier], optional) - used in free_time filter (several locations can be separated by comma)
    • archive: false (boolean, optional) - get only archived or non archived services
    • service_by_time: false (boolean, optional) - get only services by time (true) or not by time (false)
GET/services{?fields,client_gender,public,position,has_professional_price,professional,free_time,free_time_skip_appointments,location,archive,service_by_time}
Full URL: https://api.aihelps.com/v1/services{?fields,client_gender,public,position,has_professional_price,professional,free_time,free_time_skip_appointments,location,archive,service_by_time}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d60be6-fba7-49c0-3d28-066a5cb5f1b9",
        "name": "Compex",
        "description": "Complex service",
        "descriptionPlainText": "Complex service",
        "duration": 60,
        "gender": "both",
        "price_currency": "UAH",
        "no_professional_price": null,
        "category": "c867e139-a433-4e4a-885d-ab81489ad488",
        "picture": null,
        "pictureUrl": "",
        "public": true,
        "location_prices": [
            {
                "location": "88d60c1b-5ddd-a723-0312-ba0507cf5e92",
                "position": "88660d76-a42f-442f-ba18-4378888e430f",
                "price": 200,
                "staff_price": 0
            }
        ],
        "halls": null,
        "resources": null,
        "color": "White",
        "article": null,
        "barcode": null,
        "with_assistant": false,
        "service_by_time": false,
        "department": "b45c58a6-a0ba-4ee2-afda-cb0d6e7102b4",
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only category, name, duration, gender, location_prices, description, descriptionPlainText, sex, price_currency, picture, public, parent, archive, noProfessionalPriceInNativeCurrency, location_prices_in_native_currency), reports

GET/services/{id}{?fields}
Full URL: https://api.aihelps.com/v1/services/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesservice iddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]yeslist of fields to return (separated by comma).name,description,descriptionPlainText,duration,gender,price_currency,no_professional_price,category,picture,pictureUrl,public,location_prices,halls,resources,color,article,barcode,with_assistant,service_by_time,department,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d60be6-fba7-49c0-3d28-066a5cb5f1b9",
    "name": "Compex",
    "description": "Complex service",
    "descriptionPlainText": "Complex service",
    "duration": 60,
    "gender": "both",
    "price_currency": "UAH",
    "no_professional_price": null,
    "category": "f1c36ed0-ee16-4a8a-83df-ad7e4e3d2a03",
    "picture": "0b646349-e7be-4179-97bd-c7155caab923",
    "pictureUrl": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab923/picture",
    "public": true,
    "location_prices": 
    [
        {
            "location": "00df7375-1e7b-44d8-be05-a7777e79b012",
            "position": "d68cab7f-443f-454c-80f1-8ba8498cb0a4",
            "price": 200,
            "staff_price": null
        }
    ],
    "halls": 
    [
        "d68cab7f-443f-454c-80f1-8ba8498cb0a4"
    },
    "resources": 
    [
        "a2f61d84-e659-472b-8a1a-284721c979ae"
    ],
    "color": "#ffffff",
    "article": "234124",
    "barcode": "12351",
    "with_assistant": false,
    "service_by_time": false,
    "department": "88d6133e-95ba-3880-77ef-874262f695de",
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/services{?fields}
Full URL: https://api.aihelps.com/v1/services{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,description,duration,gender,price_currency,no_professional_price,category,picture,pictureUrl,public,location_prices,halls,resources,color,article,barcode,with_assistant,service_by_time,department,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Compex",
    "description": "",
    "duration": 60,
    "gender": "both",
    "price_currency": "UAH",
    "no_professional_price": null,
    "category": "88d60be9-abea-1947-53d9-31154749b7b9",
    "picture": null,
    "public": true,
    "location_prices": 
    [
        {
            "location": "8660d976-a42f-442f-ba18-4378888e430f",
            "position": "b45c58a6-a0ba-4ee2-afda-cb0d6e7102b4",
            "price": 200,
            "staff_price": 0
        }
    ],
    "halls": 
    [
        "d68cab7f-443f-454c-80f1-8ba8498cb0a4"
    },
    "resources": 
    [
        "a2f61d84-e659-472b-8a1a-284721c979ae"
    ],
    "color": "White",
    "article": "125122",
    "barcode": "51251",
    "with_assistant": false,
    "service_by_time": false,
    "department": "88d6133e-95ba-3880-77ef-874262f695de"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/services/{id}{?fields}
Full URL: https://api.aihelps.com/v1/services/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesservice id751392d5-a113-44e4-bb30-0d9e190b2f4c
fieldsarray[string]list of fields to return (separated by comma)name,description,duration,gender,price_currency,no_professional_price,category,picture,pictureUrl,public,location_prices,halls,resources,color,article,barcode,with_assistant,service_by_time,department,archive
PUTRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
Body
[
    "name": "Compex",
    "description": "",
    "duration": 60
]
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/services/{id}
Full URL: https://api.aihelps.com/v1/services/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesservice idcc903b03-ecaf-46d4-a030-bbfd1882f490
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

To simplify management, services can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/services/categories{?fields,archive}
Full URL: https://api.aihelps.com/v1/services/categories{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,picture,archive
archivebooleanget only archived or non archived service categoriesfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
        "name": "Haircuts",
        "parent": null,
        "picture": "529e4dca-c512-44ac-aa53-d2470a5ced91",
        "archive": false
    },
    {
        "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
        "name": "Manicure",
        "parent": null,
        "picture": "893453b0-fd84-450a-bc2f-42083272d792",
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/services/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/services/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of services categoryc9edc51c-a95a-4f9c-84fd-67022b957d79
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,picture,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
    "name": "Haircuts",
    "parent": null,
    "picture": "8bd5bc40-dbfa-4b73-b4a6-18fb4359890a",
    "archive": false,
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/services/categories{?fields}
Full URL: https://api.aihelps.com/v1/services/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent,picture,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Other",
    "parent": null,
    "picture": "8bd5bc40-dbfa-4b73-b4a6-18fb4359890a"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c742"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/services/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/services/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of services categorybd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)name,parent,picture,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Visage",
    "parent": null,
    "picture": "8bd5bc40-dbfa-4b73-b4a6-18fb4359890a"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/services/categories/{id}
Full URL: https://api.aihelps.com/v1/services/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of services categorybd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/services/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/services/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "archive": false,
    "categories":
    [
        {
            "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
            "name": "Haircuts",
            "parent": null,
            "archive": false,
            "categories":
            [
            ],
            "items":
            [
                {
                    "id": "88d60be6-fba7-49c0-3d28-066a5cb5f1b9",
                    "name": "Compex",
                    "description": "Complex service",
                    "duration": 60,
                    "gender": "both",
                    "price_currency": "UAH",
                    "no_professional_price": null,
                    "category": "f1c36ed0-ee16-4a8a-83df-ad7e4e3d2a03",
                    "picture": null,
                    "public": true,
                    "location_prices": 
                    [
                        {
                            "location": "00df7375-1e7b-44d8-be05-a7777e79b012",
                            "position": "d68cab7f-443f-454c-80f1-8ba8498cb0a4",
                            "price": 200,
                            "staff_price": 0
                        }
                    ],
                    "halls": 
                    [
                        "d68cab7f-443f-454c-80f1-8ba8498cb0a4"
                    },
                    "resources": 
                    [
                        "a2f61d84-e659-472b-8a1a-284721c979ae"
                    ],
                    "color": "#ffffff",
                    "article": "234124",
                    "barcode": "12351",
                    "with_assistant": false,
                    "service_by_time": false,
                    "department": "88d6133e-95ba-3880-77ef-874262f695de",
                    "archive": false
                }
            ]
        },
        {
            "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
            "name": "Manicure",
            "parent": null,
            "archive": false,
            "categories":
            [
            ],
            "items":
            [
            ]
        }                    
    ],
    "items":
    [
    ]
}

Information about materials (products) used for providing services

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • fields: service,location,storage,is_professional_storage,product,quantity,units (array[string], required) - list of fields to return (separated by comma).
    • locations: 88d4df1a-c2dc-5114-1de2-2be2630ee8bd (array[identifier], optional) - get service materials with given locations (several locations can be separated by comma)
    • services: 88d3f821-36f8-3abe-7bf8-d11a0599e32f (array[identifier], optional) - get service materials with given services (several services can be separated by comma)
GET/services/materials{?fields,services,locations}
Full URL: https://api.aihelps.com/v1/services/materials{?fields,services,locations}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d4e876-5c20-00ce-594b-c2161095f936",
        "service": "88d3f821-36f8-3abe-7bf8-d11a0599e32f",
        "product": "88d3dbcd-881b-a70a-2213-b3c423431ab4",
        "location": "88d4df1a-c2dc-5114-1de2-2be2630ee8bd",
        "storage": "88d3da27-c1d3-01c5-57c4-98ca1b09490d",
        "is_professional_storage": false,
        "quantity": 15,
        "units": "ml"
    },
    {
        "id": "3993ffb4-c353-453f-ba4c-f128df6d8559",
        "service": "88d4b941-54d4-17e2-675a-dfa432472027",
        "product": "9a3cb892-1b74-4e19-9a3d-6ba70f36673d",
        "location": "88d4df1a-c2dc-5114-1de2-2be2630ee8bd",
        "storage": "88d3da27-c1d3-01c5-57c4-98ca1b09490d",
        "is_professional_storage: false,
        "quantity": 15,
        "units": "ml"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • id: be0b6712-e680-42a7-8b99-b6b2d9fcb1fe (identifier, required) - id of service material
    • fields: service,location,storage,is_professional_storage,product,quantity,units (array[string], required) - list of fields to return (separated by comma)
GET/services/materials/{id}{?fields}
Full URL: https://api.aihelps.com/v1/services/materials/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "be0b6712-e680-42a7-8b99-b6b2d9fcb1fe",
    "service": "88d4b941-54d4-17e2-675a-dfa432472027",
    "product": "2766e147-c7a0-4aae-a384-25716b5e69e2",
    "location": "88d4df1a-c2dc-5114-1de2-2be2630ee8bd",
    "storage": "898222b4-205b-4d00-8053-138de7f77e8d",
    "is_professional_storage": false,
    "quantity": 15,
    "units": "ml"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/services/materials{?fields}
Full URL: https://api.aihelps.com/v1/services/materials{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)service,location,storage,is_professional_storage,product,quantity,units
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
[
    {
        "service": "88d4b941-54d4-17e2-675a-dfa432472027",
        "product": "8bfa2bd5-33b0-4ff8-8073-8cd817caccc7",
        "location": "f78e5f86-35d6-4f83-9e39-74a47ec99155",
        "storage": "88d3da27-c1d3-01c5-57c4-98ca1b09490d",
        "is_professional_storage": false,
        "quantity": 15
    }
]
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "79dbd056-7f23-4e87-892f-c45e1976e697"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/services/materials/{id}{?fields}
Full URL: https://api.aihelps.com/v1/services/materials/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid service materials751392d5-a113-44e4-bb30-0d9e190b2f4c
fieldsarray[string]list of fields to return (separated by comma)service,product,quantity
PUTRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
Body
[
    "service": "0a125def-907e-4be4-bbdd-4416b61d351c",
    "product": "88d3dbcd-881b-a70a-2213-b3c423431ab4",
    "location": "f78e5f86-35d6-4f83-9e39-74a47ec99155",
    "storage": "88d3da27-c1d3-01c5-57c4-98ca1b09490d",
    "is_professional_storage": false,
    "quantity": 15
]
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/services/materials/{id}
Full URL: https://api.aihelps.com/v1/services/materials/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of service materialcc903b03-ecaf-46d4-a030-bbfd1882f490
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response


Resources are crucial for providing some services. Each service may use a resource while being provided. Thus, resources limit the number of such services that can be provided simultaneously.

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • fields: name,locations (array[string], required) - list of fields to return (separated by comma).
GET/resources/{?fields}
Full URL: https://api.aihelps.com/v1/resources/{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d59509-afd8-0b76-3b19-bdda1cfe67f9",
        "name": "Apparatus 2",
        "locations": [
            {
                "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
                "count": 2
            },
            {
                "location": "88d525ff-c965-b53b-248f-3ef123c68b02",
                "count": 2
            }
        ]
    },
    {
        "id": "88d59509-be48-6485-3b19-bdda39d8af18",
        "name": "Deus ex machina",
        "locations": [
            {
                "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
                "count": 1
            },
            {
                "location": "88d525ff-c965-b53b-248f-3ef123c68b02",
                "count": 1
            }
        ]
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • id: f6c0daf0-6903-4c9e-a0e2-4381676dc364 (identifier, required) - id of resource
    • fields: name,locations (array[string], required) - list of fields to return (separated by comma)
GET/resources/{id}{?fields}
Full URL: https://api.aihelps.com/v1/resources/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d59509-afd8-0b76-3b19-bdda1cfe67f9",
        "name": "Apparatus 2",
        "locations": [
            {
                "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
                "count": 2
            },
            {
                "location": "88d525ff-c965-b53b-248f-3ef123c68b02",
                "count": 2
            }
        ]
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

POST/resources{?fields}
Full URL: https://api.aihelps.com/v1/resources{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,locations
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
Body
{
    "name": "Apparatus 2",
    "location": [
        {
            "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
            "count": 2
        }
    ]
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/resources/{id}{?fields}
Full URL: https://api.aihelps.com/v1/resources/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid resourcef6c0daf0-6903-4c9e-a0e2-4381676dc364
fieldsarray[string]list of fields to return (separated by comma)name,locations
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Apparatus 2",
    "location": [
        {
            "location": "88d45ef0-6e9a-cfb6-0b47-d56566fe9691",
            "count": 2
        }
    ]
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/resources/{id}
Full URL: https://api.aihelps.com/v1/resources/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid resourcecc903b03-ecaf-46d4-a030-bbfd1882f490
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Products

All information about products.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,online_store,reports

  • Parameter
    • fields: name,description,category,picture,pictureUrl,vendor_code,barcode,volume,supply_price,supply_price_currency,supply_price_in_native_currency,units,location_prices,portion_quantity,stocks,package_price_currency,portion_price_currency,unit_price_currency,staff_package_price_currency,staff_portion_price_currency,staff_unit_price_currency,can_sale_package,can_sale_portion,can_sale_units,tare_weight,critical_quantity,requisites,is_receipt,product_receipts,count_as_cost_for_salary,tax,department,price_for_salary_calculation,payed_calculation,consignment_supplier,archive (array[string], required) - list of fields to return (separated by comma).
    • archive: false (boolean, optional) - get only archived or non archived products
    • name: Cotton pads (string, optional) - get only products with given name (several names can be separated by comma)
GET/products{?fields,archive,name}
Full URL: https://api.aihelps.com/v1/products{?fields,archive,name}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
        "name": "Cotton pads",
        "description": "120 cotton pads for face",
        "category": "88d61182-23fc-c6c9-03da-4259788d120a",
        "picture": null,
        "pictureUrl": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab923/picture",
        "vendor_code": "30402",
        "barcode": "31142",
        "volume": 120,
        "supply_price": 300,
        "supply_price_currency": "USD",
        "supply_price_in_native_currency": 300,
        "units": "pcs",
        "portion_quantity": 10,
        "package_price_currency": "USD",
        "portion_price_currency": "USD",
        "unit_price_currency": "USD",
        "staff_package_price_currency": "USD",
        "staff_portion_price_currency": "USD",
        "staff_unit_price_currency": "USD",
        "can_sale_package": true,
        "can_sale_portion": false,
        "can_sale_units": false,
        "tare_weight": 1,
        "critical_quantity": 1,
        "requisites": "88d4feb7-f4a9-931b-1a0f-5bbe3ee6bc06",
        "product_receipts": null,
        "count_as_cost_for_salary": true,
        "tax": 0,
        "department": "88d38b8c-2d06-1612-15f9-dd6301fef099",
        "price_for_salary_calculation": 0,
        "payed_calculation": false,
        "consignment_supplier": "88d419f7-17f3-d48b-00ca-aea77f0775df",
        "location_prices": [
            {
                "location": "88d60c1b-5ddd-a723-0312-ba0507cf5e92",
                "price": 1000,
                "staff_price": 800,
                "automatic_price": null,
                "original_automatic_price": null,
                "portion_price": 500,
                "staff_portion_price": 400,
                "automatic_portion_price": 0,
                "original_automatic_portion_price": 0,
                "unit_price": null,
                "staff_unit_price": 8,
                "automatic_unit_price": null,
                "original_automatic_unit_price": null
            }
        ],
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,online_store,reports

  • Parameter
    • id: f6c0daf0-6903-4c9e-a0e2-4381676dc364 (identifier, required) - product id
    • fields: name,description,category,picture,pictureUrl,vendor_code,barcode,volume,supply_price,supply_price_currency,supply_price_in_native_currency,units,location_prices,portion_quantity,stocks,package_price_currency,portion_price_currency,unit_price_currency,staff_package_price_currency,staff_portion_price_currency,staff_unit_price_currency,can_sale_package,can_sale_portion,can_sale_units,tare_weight,critical_quantity,requisites,is_receipt,product_receipts,,count_as_cost_for_salary,tax,department,price_for_salary_calculation,payed_calculation,consignment_supplier,archive (array[string], required) - list of fields to return (separated by comma)
GET/products/{id}{?fields}
Full URL: https://api.aihelps.com/v1/products/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
    "name": "Cotton pads",
    "description": "120 cotton pads for face",
    "category": "88d61182-23fc-c6c9-03da-4259788d120a",
    "picture": "0b646349-e7be-4179-97bd-c7155caab923",
    "pictureUrl": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab923/picture",
    "vendor_code": "30402",
    "barcode": "30402",
    "volume": 1,
    "supply_price": 300,
    "supply_price_currency": "USD",
    "supply_price_in_native_currency": 300,
    "units": "pcs",
    "portion_quantity": 10,
    "package_price_currency": "USD",
    "portion_price_currency": "USD",
    "unit_price_currency": "USD",
    "staff_package_price_currency": "USD",
    "staff_portion_price_currency": "USD",
    "staff_unit_price_currency": "USD",
    "can_sale_package": true,
    "can_sale_portion": false,
    "can_sale_units": false,
    "tare_weight": 1,
    "critical_quantity": 0,
    "requisites": "88d4feb7-f4a9-931b-1a0f-5bbe3ee6bc06",
    "product_receipts": null,
    "count_as_cost_for_salary": true,
    "tax": 0,
    "department": "88d38b8c-2d06-1612-15f9-dd6301fef099",
    "price_for_salary_calculation": 0,
    "payed_calculation": false,
    "consignment_supplier": "88d419f7-17f3-d48b-00ca-aea77f0775df",
    "location_prices": [
        {
            "location": "88d60c1b-5ddd-a723-0312-ba0507cf5e92",
            "price": 1000,
            "staff_price": 800,
            "original_automatic_price": 0,
            "automatic_price": 0,
            "portion_price": 500,
            "staff_portion_price": null,
            "original_automatic_portion_price": 0,
            "automatic_portion_price": 0,
            "unit_price": 10,
            "staff_unit_price": 8,
            "automatic_unit_price": null,
            "original_automatic_unit_price": null
        }
    ],
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/products{?fields}
Full URL: https://api.aihelps.com/v1/products{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,description,category,picture,pictureUrl,vendor_code,barcode,volume,supply_price,supply_price_currency,supply_price_in_native_currency,units,location_prices,portion_quantity,stocks,package_price_currency,portion_price_currency,unit_price_currency,staff_package_price_currency,staff_portion_price_currency,staff_unit_price_currency,can_sale_package,can_sale_portion,can_sale_units,tare_weight,critical_quantity,requisites,is_receipt,product_receipts,,count_as_cost_for_salary,tax,department,price_for_salary_calculation,payed_calculation,consignment_supplier,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Smartgel 3 ml",
    "description": "nail polish remover",
    "category": "88d61182-23fc-c6c9-03da-4259788d120a",
    "picture": null,
    "vendor_code": "124512",
    "barcode": "12351",
    "volume": 3,
    "supply_price": 300,
    "supply_price_currency": "USD",
    "supply_price_in_native_currency": 300,
    "units": "ml",
    "portion_quantity": 1,
    "package_price_currency": "USD",
    "portion_price_currency": "USD",
    "unit_price_currency": "USD",
    "staff_package_price_currency": "USD",
    "staff_portion_price_currency": "USD",
    "staff_unit_price_currency": "USD",
    "can_sale_package": true,
    "can_sale_portion": false,
    "can_sale_units": false,
    "tare_weight": 0,
    "critical_quantity": 0,
    "requisites": "88d4feb7-f4a9-931b-1a0f-5bbe3ee6bc06",
    "product_receipts": null,
    "count_as_cost_for_salary": true,
    "tax": 0,
    "department": "88d38b8c-2d06-1612-15f9-dd6301fef099",
    "price_for_salary_calculation": 0,
    "payed_calculation": false,
    "consignment_supplier": "88d419f7-17f3-d48b-00ca-aea77f0775df",
    "location_prices": [
        {
            "location": "88d60c1b-5ddd-a723-0312-ba0507cf5e92",
            "price": 200,
            "staff_price": null,
            "automatic_price": 0,
            "portion_price": null,
            "staff_portion_price": 18,
            "automatic_portion_price": 0,
            "unit_price": 2,
            "staff_unit_price": 1.8,
            "automatic_unit_price": 0
        }
    ],
    "archive": false
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/products/{id}{?fields}
Full URL: https://api.aihelps.com/v1/products/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentiferyesproduct idf6c0daf0-6903-4c9e-a0e2-4381676dc364
fieldsarray[string]list of fields to return (separated by comma)name,description,category,picture,pictureUrl,vendor_code,barcode,volume,supply_price,supply_price_currency,supply_price_in_native_currency,units,location_prices,portion_quantity,stocks,package_price_currency,portion_price_currency,unit_price_currency,staff_package_price_currency,staff_portion_price_currency,staff_unit_price_currency,can_sale_package,can_sale_portion,can_sale_units,tare_weight,critical_quantity,requisites,is_receipt,product_receipts,,count_as_cost_for_salary,tax,department,price_for_salary_calculation,payed_calculation,consignment_supplier,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Smartgel Plus 3 ml"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/products/{id}
Full URL: https://api.aihelps.com/v1/products/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentiferyesid productf6c0daf0-6903-4c9e-a0e2-4381676dc364
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

To simplify products management, products can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,online_store,reports

GET/products/categories{?fields,archive}
Full URL: https://api.aihelps.com/v1/products/categories{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,picture,archive
archivebooleanget only archived or non archived product categoriesfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
        "name": "Loreal",
        "parent": null,
        "picture": "bf78e7aa-f144-418e-b3d9-c6f935d74210",
        "archive": false
    },
    {
        "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
        "name": "Wella",
        "parent": null,
        "picture": "96e8f3d3-71e4-4641-9d16-76fc191ca1f3",
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,online_store,reports

GET/products/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/products/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of products categoryc9edc51c-a95a-4f9c-84fd-67022b957d79
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
    "name": "Loreal",
    "parent": null,
    "picture": "54199865-c6ec-44ec-b047-c7113a4a854f",
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/products/categories{?fields}
Full URL: https://api.aihelps.com/v1/products/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Other",
    "parent": null,
    "picture": "b8f0bf72-5736-457f-8760-ddbae1906e7f"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c742"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/products/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/products/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of products categorybd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)name,parent,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Shwarzkopf",
    "parent": null,
    "picture": "3f692650-e4c6-4175-b167-7be79a51fce6"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/products/categories/{id}
Full URL: https://api.aihelps.com/v1/products/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of products categorybd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,online_store,reports

GET/products/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/products/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "archive": false,
    "categories":
    [
        {
            "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
            "name": "Loreal",
            "parent": null,
            "archive": false,
            "categories":
            [
            ],
            "items":
            [
                {
                    "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
                    "name": "Cotton pads",
                    "description": "120 cotton pads for face",
                    "category": "88d61182-23fc-c6c9-03da-4259788d120a",
                    "picture": null,
                    "vendor_code": "30402",
                    "barcode": "31142",
                    "volume": 120,
                    "units": "pcs",
                    "portion_quantity": 10,
                    "package_price_currency": "USD",
                    "portion_price_currency": "USD",
                    "unit_price_currency": "USD",
                    "staff_package_price_currency": "USD",
                    "staff_portion_price_currency": "USD",
                    "staff_unit_price_currency": "USD",
                    "can_sale_package": true,
                    "can_sale_portion": false,
                    "can_sale_units": false,
                    "tare_weight": 1,
                    "critical_quantity": 1,
                    "requisites": "88d4feb7-f4a9-931b-1a0f-5bbe3ee6bc06",
                    "product_receipts": null,
                    "count_as_cost_for_salary": true,
                    "tax": 0,
                    "department": "88d38b8c-2d06-1612-15f9-dd6301fef099",
                    "price_for_salary_calculation": 0,
                    "payed_calculation": false,
                    "automatic_price": false,
                    "automatic_price_markup": 0,
                    "automatic_portion_price_markup": 0,
                    "automatic_unit_price_markup": 0,
                    "consignment_supplier": "88d419f7-17f3-d48b-00ca-aea77f0775df",
                    "location_prices": [
                        {
                            "location": "88d60c1b-5ddd-a723-0312-ba0507cf5e92",
                            "price": 1000,
                            "staff_price": 800,
                            "automatic_price": 0,
                            "portion_price": 500,
                            "staff_portion_price": 400,
                            "automatic_portion_price": 0,
                            "unit_price": 10,
                            "staff_unit_price": 8,
                            "automatic_unit_price": 0
                        }
                    ],
                    "archive": false
                }
            ]
        },
        {
            "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
            "name": "Wella",
            "parent": null,
            "archive": false
            "categories":
            [
            ],
            "items":
            [
            ]
        }                    
    ],
    "items":
    [
    ]
}

Storage describes place where products are kept. In each location there can be several storages.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, online_store, reports

GET/storages{?fields,location}
Full URL: https://api.aihelps.com/v1/storages{?fields,location}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,saleUnitTypes,location,productsFilter
locationarray[identifier]get only storages in given location (several locations can be separated by comma)12d4b305-e198-f02c-2743-cca93cb16baa
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
        "name": "Reception",
        "saleUnitTypes": [
            "portion"
        ],
        "location": "cb1c6ce2-c81f-4d70-ad31-8f627edb41e1",
        "productsFilter": "none"
    },
    {
        "id": "71668460-255c-491f-b4e6-90cea3f338a9",
        "name": "Backbar",
        "saleUnitTypes": [
            "portion",
            "package"
        ],
        "location": "cb1c6ce2-c81f-4d70-ad31-8f627edb41e1",
        "productsFilter": "all"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, online_store, reports

GET/storages/{id}{?fields}
Full URL: https://api.aihelps.com/v1/storages/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesstorage idbd98b869-2e5c-4e0d-be16-ce715a35c741
fieldsarray[string]yeslist of fields to return (separated by comma).name,saleUnitTypes,location,productsFilter
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bb9114c8-439c-40a9-a784-04885f7fedaf",
    "name": "Reception",
    "saleUnitTypes": [
        "portion",
        "package"
    ],
    "location": "bb4c68e2-c81f-4d70-ad31-8f627ed9bcec",
    "productsFilter": "all"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/storages{?fields}
Full URL: https://api.aihelps.com/v1/storages{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,location,productsFilter
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bce1
Body
{
    "name": "Other",
    "location": "bc520f6d-5c0e-4fc9-9768-c4e1af7fbf3c",
    "productsFilter": "none"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "fc9114c8-439c-40a9-a784-04885f7fedc1"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/storages/{id}{?fields}
Full URL: https://api.aihelps.com/v1/storages/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesstorage iddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]list of fields to return (separated by comma)name,saleUnitTypes,location,productsFilter
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Main storage",
    "location": "bc520f6d-5c0e-4fc9-9768-c4e1af7fbf3c",
    "productsFilter": "all"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/storages/{id}
Full URL: https://api.aihelps.com/v1/storages/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesstorage iddd9114c8-439c-40a9-a784-04885f7fedab
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

To simplify supplier management.

Authorization: `Database`

Authorization: Database

Scope: full

GET/suppliers{?fields,name}
Full URL: https://api.aihelps.com/v1/suppliers{?fields,name}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name
namestringget only suppliers which have name = `Loreal`Loreal
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
        "name": "Loreal"
    },
    {
        "id": "dd9114c8-439c-40a9-a784-048675f7fedab",
        "name": "Gonzo"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

GET/suppliers/{id}{?fields}
Full URL: https://api.aihelps.com/v1/suppliers/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryessupplier iddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]yeslist of fields to return (separated by comma).name
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
    "name": "Loreal"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/suppliers{?fields}
Full URL: https://api.aihelps.com/v1/suppliers{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma).name
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Loreal"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
    "name": "Loreal"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/suppliers/{id}{?fields}
Full URL: https://api.aihelps.com/v1/suppliers/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryessupplier iddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]list of fields to return (separated by comma).name
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Loreal Professional"
}
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
    "name": "Loreal Professional"
}

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/suppliers/{id}
Full URL: https://api.aihelps.com/v1/suppliers/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryessupplier iddd9114c8-439c-40a9-a784-04885f7fedab
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Movements describe such operation types as products order, supply, transfer between storages, replacing one product to another, product waste and return to supplier. Not all fields have meaning for any type. fromStorage only valid for 'transfer', 'replace', 'waste' and 'return' types; toStorage - for 'order', 'supply', 'transfer' and 'replace' types; supplier - for 'supply' and 'return' types; sum - for 'supply', 'waste' and 'return' types; discountSum and transportationCosts - only for 'supply' type. For other movement types these fields have default values - null for identifiers and 0 for numbers.
There is no separate field location for movement. Movement is done for specific storage or two storages, each storage belongs to some location.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/movements{?fields,from,to}
Full URL: https://api.aihelps.com/v1/movements{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).date,supplier
fromdatetimeget only movements which was made at `from` or later2018-09-16T21:02:00.000Z
todatetimeget only movements which was made before `to`2018-09-16T21:02:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
        "date": "2019-02-15T00:00:00.000Z",
        "invoiceDate": "2019-02-13T00:00:00.000Z",
        "invoiceNumber": "AQ418",
        "type": "supply",
        "fromStorage": null,
        "toStorage": "41678090-9109-4750-aa38-6e3444f55fa0",
        "supplier": "f6c0daf0-6903-4c9e-a0e2-4381676dc364",
        "products": [
            {
                "product": "983eb289-1e66-413c-8052-7cbcc3e806bc",
                "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
                "quantity": 1,
                "sum": 1200
            },
            {
                "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
                "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
                "quantity": 1,
                "sum": 300
            }
        ],                    
        "sum": 1500.00,
        "discountSum": 175.00,
        "transportationCosts": 35.00,
        "comment": "need paper invoice"
    },
    {
        "id": "a0ea1078-eb73-499d-96b2-de3dccff28ba",
        "date": "2019-02-18T00:00:00.000Z",
        "invoiceDate": "2019-02-18T00:00:00.000Z",
        "invoiceNumber": "",
        "type": "waste",
        "fromStorage": "41678090-9109-4750-aa38-6e3444f55fa0",
        "toStorage": null,
        "supplier": null
        "products": [
            {
                "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
                "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
                "quantity": -1,
                "sum": -300
            }
        ],                    
        "sum": 300.00,
        "discountSum": 0.00,
        "transportationCosts": 0.00,
        "comment": null
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/movements/{id}{?fields}
Full URL: https://api.aihelps.com/v1/movements/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesstorage idbd98b869-2e5c-4e0d-be16-ce715a35c741
fieldsarray[string]yeslist of fields to return (separated by comma).date,supplier
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
    "date": "2019-02-15T00:00:00.000Z",
    "invoiceDate": "2019-02-13T00:00:00.000Z",
    "invoiceNumber": "AQ418",
    "type": "supply",
    "fromStorage": null,
    "toStorage": "41678090-9109-4750-aa38-6e3444f55fa0",
    "supplier": "f6c0daf0-6903-4c9e-a0e2-4381676dc364",
    "products": [
        {
            "product": "983eb289-1e66-413c-8052-7cbcc3e806bc",
            "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
            "quantity": 1,
            "sum": 1200
        },
        {
            "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
            "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
            "quantity": 1,
            "sum": 300
        }
    ],
    "sum": 1500,
    "discountSum": 175,
    "transportationCosts": 35,
    "comment": "need paper invoice"
}

There is no separate field location for stocktaking. Stocktaking is done for specific storage, each storage belongs to some location.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/stocktakings{?fields,from,to}
Full URL: https://api.aihelps.com/v1/stocktakings{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).date,supplier
fromdatetimeget only stocktakings which was made at `from` or later2018-09-16T21:02:00.000Z
todatetimeget only stocktakings which was made before `to`2018-09-16T21:02:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
        "date": "2019-02-15T00:00:00.000Z",
        "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
        "products": [
            {
                "product": "983eb289-1e66-413c-8052-7cbcc3e806bc",
                "correctionQuantity": 1,
                "correctionSum": 1200
            },
            {
                "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
                "quantity": 1,
                "correctionSum": 300
            }
        ],
        "comment": "needs additional verification"
    },
    {
        "id": "a0ea1078-eb73-499d-96b2-de3dccff28ba",
        "date": "2019-02-18T00:00:00.000Z",
        "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
        "products": [
            {
                "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
                "correctionQuantity": -1,
                "correctionSum": -300
            }
        ],
        "comment": null
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/stocktakings/{id}{?fields}
Full URL: https://api.aihelps.com/v1/stocktakings/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesstorage idbd98b869-2e5c-4e0d-be16-ce715a35c741
fieldsarray[string]yeslist of fields to return (separated by comma).date,supplier
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
    "date": "2019-02-15T00:00:00.000Z",
    "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
    "products": [
        {
            "product": "983eb289-1e66-413c-8052-7cbcc3e806bc",
            "correctionQuantity": 1,
            "correctionSum": 1200
        },
        {
            "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
            "quantity": 1,
            "correctionSum": 300
        }
    ],
    "comment": "needs additional verification"
}

Cards

Different types of discount/bonus cards, clips, subscriptions, etc.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, reports

GET/cards{?fields,public,archive}
Full URL: https://api.aihelps.com/v1/cards{?fields,public,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,description,price,price_currency,category,picture,pictureUrl,visits,public,location_prices,archive,discounts
publicbooleanget only public or non public cardstrue
archivebooleanget only archived or non archived cardsfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
        "name": "Discount -5%",
        "description": "Discount card for all services -5%",
        "price": 0,
        "category": null,
        "picture": null,
        "pictureUrl": "",
        "visits": 10,
        "public": true,
        "discounts": 
        [
            {
                "item_type": "service",
                "item": "88d4d8c3-81e1-39b5-7bfe-b80f3ff3ab65",
                "quantity_type": "unlimited",
                "quantity": null,
                "discount": 100
            },
            {
                "item_type": "service",
                "item": "88d4d8c3-81e2-c055-7bfe-b80f0881ee12",
                "quantity_type": "quantity",
                "quantity": 10,
                "discount": 100
            }
        ]
        "location_prices": 
        [
            {
                "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
                "price": 150
            },
            {
                "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
                "price": 100
            }
        ],
        "archive": false,
        "availableCards":
        [
            1,
            2
        ]
    },
    {
        "id": "71668460-255c-491f-b4e6-90cea3f338a9",
        "name": "10 haircuts",
        "description": "",
        "price": 300,
        "category": "9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea",
        "picture": "9b6f7731-69a1-4c9d-844a-90dc75e2acb1",
        "pictureUrl": "https://api.aihelps.com/v1/images/696320/9b6f7731-69a1-4c9d-844a-90dc75e2acb1/picture",
        "visits": "unlimited"
        "public": true,
        "discounts": 
        [
            {
                "item_type": "Service",
                "item": "88d4d8c3-81e1-39b5-7bfe-b80f3ff3ab65",
                "quantity_type": "unlimited",
                "quantity": null,
                "discount": 100
            },
            {
                "item_type": "Service",
                "item": "88d4d8c3-81e2-c055-7bfe-b80f0881ee12",
                "quantity_type": "quantity",
                "quantity": 10,
                "discount": 100
            }
        ]
        "location_prices": 
        [
            {
                "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
                "price": 510
            },
            {
                "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
                "price": 500
            }
        ],
        "archive": false,
        "availableCards":
        [
            1,
            2
        ]
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, reports

GET/cards/{id}{?fields}
Full URL: https://api.aihelps.com/v1/cards/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of carddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]yeslist of fields to return (separated by comma).name,description,price,price_currency,category,picture,pictureUrl,visits,public,location_prices,archive,discounts
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
    "name": "Discount -5%",
    "description": "Discount card for all services -5%",
    "price": 0,
    "category": null,
    "visits": 10,
    "public": true,
    "discounts": 
    [
        {
            "item_type": "Service",
            "item": "88d4d8c3-81e1-39b5-7bfe-b80f3ff3ab65",
            "quantity_type": "unlimited",
            "quantity": null,
            "discount": 100
        },
        {
            "item_type": "Service",
            "item": "88d4d8c3-81e2-c055-7bfe-b80f0881ee12",
            "quantity_type": "quantity",
            "quantity": 10,
            "discount": 100
        }
    ]
    "location_prices": 
    [
        {
            "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
            "price": 510
        }
    ],
    "archive": false,
    "availableCards":
        [
            1,
            2
        ]
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/cards{?fields}
Full URL: https://api.aihelps.com/v1/cards{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,description,price,price_currency,category,picture,pictureUrl,visits,public,location_prices,archive,discounts
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
Body
{
    "name": "Discount -10%",
    "description": "Discount card for all services -10%"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dd9114c8-439c-40a9-a784-04885f7fedab"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/cards/{id}{?fields}
Full URL: https://api.aihelps.com/v1/cards/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of carddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]list of fields to return (separated by comma)name,description,price,price_currency,category,picture,pictureUrl,visits,public,location_prices,archive,discounts
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "price": 500
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/cards/{id}
Full URL: https://api.aihelps.com/v1/cards/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of carddd9114c8-439c-40a9-a784-04885f7fedab
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

To simplify cards management, cards can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, reports

GET/cards/categories{?fields,archive}
Full URL: https://api.aihelps.com/v1/cards/categories{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,archive
archivebooleanget only archived or non archived card categoriesfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea",
        "name": "Haircuts cards",
        "parent": null,
        "archive": false
    },
    {
        "id": "35dbc6f4-76c6-4cfa-a1f9-a0e8ba91f807",
        "name": "Special cards",
        "parent": null,
        "archive": false
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module,client_access_token (but client field should match client id), reports

GET/cards/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/cards/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of cards category9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea",
    "name": "Haircuts cards",
    "parent": null,
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/cards/categories{?fields}
Full URL: https://api.aihelps.com/v1/cards/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Year subscriptions",
    "parent": null
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "2af87771-fb9e-4db6-a5db-c602cb1586c0"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/cards/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/cards/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of cards category9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea
fieldsarray[string]list of fields to return (separated by comma)name,parent,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Haircuts special offers",
    "parent": null
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/cards/categories/{id}
Full URL: https://api.aihelps.com/v1/cards/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of cards category9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, reports

GET/cards/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/cards/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "archive": false,
    "categories":
    [
        {
            "id": "9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea",
            "name": "Haircuts cards",
            "parent": null,
            "archive": false
            "categories":
            [
            ],
            "items":
            [
                {
                    "id": "71668460-255c-491f-b4e6-90cea3f338a9",
                    "name": "10 haircuts",
                    "description": "",
                    "price": 300,
                    "category": "9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea",
                    "public": true,
                    "archive": false
                }
            ]
        },
        {
            "id": "35dbc6f4-76c6-4cfa-a1f9-a0e8ba91f807",
            "name": "Special cards",
            "parent": null,
            "archive": false
            "categories":
            [
            ],
            "items":
            [
            ]
        }
    ],
    "items":
    [
        {
            "id": "dd9114c8-439c-40a9-a784-04885f7fedab",
            "name": "Discount -5%",
            "description": "Discount card for all services -5%",
            "price": 0,
            "category": null,
            "public": true,
            "archive": false
        }
    ]
}


Describes cards that are sold to clients. Each card type can be sold many times, new clientcard object is created on each sale.
Each client card has name (equal to card name), start and end dates.

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (but client field should match client id and only name, activated, cancelled, start_date, used_visits, left_visits, end_date, sum, delayed_payments, discounts, bonuses, accumulated_discount, accumulated_bonus, accumulated_percent, freeze_days, client, total_visits, timeOfDay, additionalCard, freezeIntervals, description, descriptionPlainText, availableLocations fields), reports

GET/clientcards{?fields,client}
Full URL: https://api.aihelps.com/v1/clientcards{?fields,client}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,client,activated,start_date,end_date,cancelled,sum,delayed_payments,total_visits,used_visits,left_visits,discounts,bonuses,accumulated_discount,accumulated_bonus,accumulated_percent,freeze_days
clientarray[identifier]get only cards for specified clients.'88d61987-617d-07b8-2c08-a8d6570241a9'
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d61987-93e8-57f1-537e-62c54f9a3355",
        "name": "*Package 10 author (different groups)",
        "client": "88d61987-617d-07b8-2c08-a8d6570241a9",
        "activated": true,
        "start_date": "2018-09-13T00:00:00.000Z",
        "end_date": "2018-10-13T00:00:00.000Z",
        "cancelled": false,
        "sum": 1000,
        "delayed_payments": null,
        "total_visits": 10,
        "used_visits": 2,
        "left_visits": 8,
        "discounts": [
            {
                "item_type": "service",
                "item": "88d61987-617d-07b8-2c08-a8d657024ba1",
                "quantity_type": "unlimited",
                "total_quantity": null,
                "used_quantity": 4,
                "left_quantity": null,
                "discount": 10
            },
            {
                "item_type": "product",
                "item": null,
                "quantity_type": "quantity",
                "total_quantity": 10,
                "used_quantity": 3,
                "left_quantity": 7,
                "discount": 10
            }
        ],
        "accumulated_discount": null,
        "accumulated_bonus": null,
        "accumulated_percent": null,
        "freeze_days": 0,
        "network_card": true,
        "all_locations_available": true
    },
    {
        "id": "88d61990-0b28-65fd-0550-4b62087b4316",
        "name": "*Package 10 author (different groups)",
        "client": "88d60d95-ae50-76b3-5016-ff2d301ea21d",
        "activated": true,
        "start_date": "2018-09-13T00:00:00.000Z",
        "end_date": "2018-10-13T00:00:00.000Z",
        "cancelled": false,
        "sum": 1000,
        "delayed_payments": null,
        "total_visits": "unlimited",
        "used_visits": 0,
        "left_visits": "unlimited",
        "discounts": [
            {
                "item_type": "service",
                "item": "88d61987-617d-07b8-2c08-a8d657024ba1",
                "quantity_type": "unlimited",
                "total_quantity": null,
                "used_quantity": 4,
                "left_quantity": null,
                "discount": 10
            },
            {
                "item_type": "product",
                "item": null,
                "quantity_type": "quantity",
                "total_quantity": 10,
                "used_quantity": 3,
                "left_quantity": 7,
                "discount": 10
            }
        ],
        "accumulated_discount": null,
        "accumulated_bonus": null,
        "accumulated_percent": null,
        "freeze_days": 0,
        "network_card": true,
        "all_locations_available": true
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (but client field should match client id and only name, activated, cancelled, start_date, used_visits, left_visits, end_date, sum, delayed_payments, discounts, bonuses, accumulated_discount, accumulated_bonus, accumulated_percent, freeze_days, client, total_visits, timeOfDay, additionalCard, freezeIntervals, description, descriptionPlainText, availableLocations fields), reports

GET/clientcards/{id}{?fields}
Full URL: https://api.aihelps.com/v1/clientcards/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of carddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]yeslist of fields to return (separated by comma).name,client,activated,start_date,end_date,cancelled,sum,delayed_payments,total_visits,used_visits,left_visits,discounts,bonuses,accumulated_discount,accumulated_bonus,accumulated_percent,freeze_days
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d61990-0b28-65fd-0550-4b62087b4316",
    "name": "Package 10 author (different groups)",
    "client": "88d60d95-ae50-76b3-5016-ff2d301ea21d",
    "activated": true,
    "start_date": "2018-09-13T00:00:00.000Z",
    "end_date": "2018-10-13T00:00:00.000Z",
    "cancelled": false,
    "sum": 1000,
    "delayed_payments": null,
    "total_visits": 10,
    "used_visits": 2,
    "left_visits": 8,
    "discounts": [
        {
            "item_type": "service",
            "item": "88d61987-617d-07b8-2c08-a8d657024ba1",
            "quantity_type": "quantity",
            "total_quantity": 20,
            "used_quantity": 4,
            "left_quantity": 16,
            "discount": 10
        }
    ],
    "accumulated_discount": null,
    "accumulated_bonus": null,
    "accumulated_percent": null,
    "freeze_days": 0,
    "network_card": true,
    "all_locations_available": true
}

Certificates

Gift certificates with predefined sum or services list. Certificates can be organized into categories.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/certificates{?fields,name,location,barcode,number,client,status,archive}
Full URL: https://api.aihelps.com/v1/certificates{?fields,name,location,barcode,number,client,status,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,location,description,barcode,number,one_time,price,total_sum,used_sum,left_sum,expire_date,services,status,client,archive
namestringget only certificates where name contains given text (several phrases can be separated by comma)Valentine
locationidentifierget only certificates from given location (several locations can be separated by comma)0be9ab15-2569-47e1-96e3-ae3211a7a7ec
barcodestringget only certificate(s) with given barcode (several barcodes can be separated by comma)2782843833907
numbernumberget only certificate with given number (several numbers can be separated by comma)1412
clientidentifierget only certificates for given client (several clients can be separated by comma)fc3c5f2c-3dee-4b63-b555-1912482b3b69
statusstringget only certificates of given status (several statuses can be separated by comma)fully_utilized
archivebooleanget only archived or non archived certificatesfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "5227a78f-fe20-4c1b-8136-a43c7d26f3d5",
        "name": "Happy Valentines Day $100",
        "location": "6f712b8e-1569-4104-833d-50a8f87bb09c",
        "description": "Certificate for Happy Valentines Day contains $100 in deposit",
        "barcode": "2782843833907",
        "number": 1412,
        "one_time": false,
        "price": 100,
        "total_sum": 100,
        "used_sum": 50,
        "left_sum": 50,
        "services": [],
        "expire_date": "2019-02-15T00:00:00.000Z",
        "client": "fc3c5f2c-3dee-4b63-b555-1912482b3b69",
        "status": "sold",
        "archive": false
    },
    {
        "id": "eed48dd4-3371-4e9d-bb06-ad8bc2b2bd3c",
        "name": "End of Winter Massages",
        "location": "6f712b8e-1569-4104-833d-50a8f87bb09c",
        "description": "Certificate for several massages",
        "barcode": "2782843833435",
        "number": 1753,
        "one_time": false,
        "price": 300,
        "total_sum": 1000,
        "used_sum": 100,
        "left_sum": 900,
        "services": [
            {
                "service": "eb2de366-7de6-4712-85ce-0e6d242770f5",
                "total_quantity": 10,
                "used_quantity": 0,
                "left_quantity": 10
            },
            {
                "service": "bd44104d-c2e4-44d3-ba9f-e5a38d1fb5aa",
                "total_quantity": 100,
                "used_quantity": 2,
                "left_quantity": 98
            }
        ],
        "expire_date": "2019-03-01T00:00:00.000Z",
        "client": "fc3c5f2c-3dee-4b63-b555-1912482b3b69",
        "status": "used",
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/certificates/{id}{?fields}
Full URL: https://api.aihelps.com/v1/certificates/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of certificate5227a78f-fe20-4c1b-8136-a43c7d26f3d5
fieldsarray[string]yeslist of fields to return (separated by comma).name,location,description,barcode,number,one_time,price,total_sum,used_sum,left_sum,expire_date,services,status,client,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "5227a78f-fe20-4c1b-8136-a43c7d26f3d5",
    "name": "Happy Valentines Day $100",
    "location": "6f712b8e-1569-4104-833d-50a8f87bb09c",
    "description": "Certificate for Happy Valentines Day contains $100 in deposit",
    "barcode": "2782843833907",
    "number": 1412,
    "one_time": false,
    "price": 100,
    "total_sum": 100,
    "used_sum": 50,
    "left_sum": 50,
    "services": [],
    "expire_date": "2019-02-15T00:00:00.000Z",
    "client": "fc3c5f2c-3dee-4b63-b555-1912482b3b69",
    "status": "sold",
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/certificates{?fields}
Full URL: https://api.aihelps.com/v1/certificates{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,location,description,barcode,number,one_time,price,total_sum,used_sum,left_sum,expire_date,services,status,client,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
Body
{
    "name": "$200 Gift certificate",
    "number": 735,
    "price": 200,
    "total_sum": 100
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "eecf8043-6789-48a0-afb7-660ab8786aea"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/certificates/{id}{?fields}
Full URL: https://api.aihelps.com/v1/certificates/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of certificate5227a78f-fe20-4c1b-8136-a43c7d26f3d5
fieldsarray[string]list of fields to return (separated by comma)name,location,description,barcode,number,one_time,price,total_sum,used_sum,left_sum,expire_date,services,status,client,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "client": "e4deddc0-ecf6-4399-831c-90f43932aa81"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/certificates/{id}
Full URL: https://api.aihelps.com/v1/certificates/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of certificatedd9114c8-439c-40a9-a784-04885f7fedab
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

To simplify certificates management, certificates can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/certificates/categories{?fields,archive}
Full URL: https://api.aihelps.com/v1/certificates/categories{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,archive
archivebooleanget only archived or non archived certificate categoriesfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "748337fe-ac89-44a8-8f78-2046241d3271",
        "name": "Deposit certificates",
        "parent": null,
        "archive": false
    },
    {
        "id": "64c0b701-f79a-4dd6-97bc-9c5f9e7c8ebc",
        "name": "Special certificates",
        "parent": null,
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/certificates/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/certificates/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of certificates category748337fe-ac89-44a8-8f78-2046241d3271
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "9b6f7731-69a1-4c9d-844a-90d2f1e2a8ea",
    "name": "Deposit certificates",
    "parent": null,
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/certificates/categories{?fields}
Full URL: https://api.aihelps.com/v1/certificates/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "For men",
    "parent": null
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "8bc889be-1cfb-455c-a965-a98c4fbe9bb8"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/certificates/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/certificates/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of certificates category8bc889be-1cfb-455c-a965-a98c4fbe9bb8
fieldsarray[string]list of fields to return (separated by comma)name,parent,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Offers for men",
    "parent": null
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/certificates/categories/{id}
Full URL: https://api.aihelps.com/v1/certificates/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of certificates category8bc889be-1cfb-455c-a965-a98c4fbe9bb8
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/certificates/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/certificates/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "archive": false,
    "categories": [
        {
            "id": "748337fe-ac89-44a8-8f78-2046241d3271",
            "name": "Deposit certificates",
            "parent": null,
            "archive": false,
            "categories": [],
            "items": [
                {
                    "id": "5227a78f-fe20-4c1b-8136-a43c7d26f3d5",
                    "name": "Happy Valentines Day $100",
                    "location": "6f712b8e-1569-4104-833d-50a8f87bb09c",
                    "description": "Certificate for Happy Valentines Day contains $100 in deposit",
                    "barcode": "2782843833907",
                    "number": 1412,
                    "one_time": false,
                    "price": 100,
                    "total_sum": 100,
                    "used_sum": 50,
                    "left_sum": 50,
                    "services": [],
                    "expire_date": "2019-02-15T00:00:00.000Z",
                    "client": "fc3c5f2c-3dee-4b63-b555-1912482b3b69",
                    "status": "sold",
                    "archive": false
                }
            ]
        },
        {
            "id": "64c0b701-f79a-4dd6-97bc-9c5f9e7c8ebc",
            "name": "Special certificates",
            "parent": null,
            "archive": false,
            "categories": [],
            "items": [
                {
                    "id": "eed48dd4-3371-4e9d-bb06-ad8bc2b2bd3c",
                    "name": "End of Winter Massages",
                    "location": "6f712b8e-1569-4104-833d-50a8f87bb09c",
                    "description": "Certificate for several massages",
                    "barcode": "2782843833435",
                    "number": 1753,
                    "one_time": false,
                    "price": 300,
                    "total_sum": 100,
                    "used_sum": 50,
                    "left_sum": 50,
                    "services": [
                        {
                            "service": "eb2de366-7de6-4712-85ce-0e6d242770f5",
                            "total_quantity": 3,
                            "used_quantity": 2,
                            "left_quantity": 1
                        },
                        {
                            "service": "bd44104d-c2e4-44d3-ba9f-e5a38d1fb5aa",
                            "total_quantity": 3,
                            "used_quantity": 2,
                            "left_quantity": 1
                        }
                    ],
                    "expire_date": "2019-03-01T00:00:00.000Z",
                    "client": "fc3c5f2c-3dee-4b63-b555-1912482b3b69",
                    "status": "used",
                    "archive": false
                }
            ]
        }
    ],
    "items": []
}

Groups

Groups keep information about group, such as name, group schedule this group, location prices. To simplify groups management, groups can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, reports

GET/groups{?fields,archive}
Full URL: https://api.aihelps.com/v1/groups{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,category,picture,pictureUrl,schedules,public,location_prices,archive
archivebooleanget only archived or non archived groupsfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d492f3-a3d2-a47b-5727-32c726a49eb0",
        "name": "20.30 Classic Boxing(LITVINENKO)",
        "category": null,
        "picture": "0b646349-e7be-4179-97bd-c7155caab923",
        "pictureUrl": "https://api.aihelps.com/v1/images/696320/0b646349-e7be-4179-97bd-c7155caab923/picture",
        "schedules": [
            {
                "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
                "trainers": [
                    "88d5933d-5d10-3650-74d8-4f87020a31eb"
                ]
            }
        ],
        "location_prices": [
            {
                "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
                "price": 150
            },
            {
                "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
                "price": 300
            },
            {
                "location": "88d670d2-42c1-0942-2d52-3c107ce4ad0b",
                "price": 250
            }
        ],
        "archive": false
    },
    {
        "id": "88d48be2-f6e6-e7a8-5bed-d7e145fd0eff",
        "name": "7.00 Classik Boxing (ELOHIN)",
        "category": null,
        "picture": null,
        "pictureUrl": "",
        "schedules": [
            {
                "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
                "trainers": [
                    "88d48be2-4a37-13d9-5bed-d7e15bd486ee"
                ]
            }
        ],
        "location_prices": [
            {
                "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
                "price": 150
            },
            {
                "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
                "price": 200
            },
            {
                "location": "88d670d2-42c1-0942-2d52-3c107ce4ad0b",
                "price": 250
            }
        ],
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module, reports

GET/groups/{id}{?fields}
Full URL: https://api.aihelps.com/v1/groups/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,category,picture,pictureUrl,schedules,public,location_prices,archive
ididentifieryesid of group432c41bf-0cd7-4f13-83dd-a0c26ce29143
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "432c41bf-0cd7-4f13-83dd-a0c26ce29143",
    "name": "20.30 Classic Boxing(LITVINENKO)",
    "category": null,
    "picture": "674f53c0-c623-464a-addc-173a35997f3e",
    "pictureUrl": "https://api.aihelps.com/v1/images/696320/674f53c0-c623-464a-addc-173a35997f3e/picture",
    "schedules": [
        {
            "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
            "trainers": [
                "88d5933d-5d10-3650-74d8-4f87020a31eb"
            ]
        }
    ],
    "location_prices": [
        {
            "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
            "price": 150
        },
        {
            "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
            "price": 200
        },
        {
            "location": "88d670d2-42c1-0942-2d52-3c107ce4ad0b",
            "price": 250
        }
    ],
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/groups{?fields}
Full URL: https://api.aihelps.com/v1/groups{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,category,picture,pictureUrl,schedules,public,location_prices,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "20.30 Classic Boxing(LITVINENKO)",
    "category": null,
    "picture": "674f53c0-c623-464a-addc-173a35997f3e",
    "location_prices": [
        {
            "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
            "price": 150
        },
        {
            "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
            "price": 200
        },
        {
            "location": "88d670d2-42c1-0942-2d52-3c107ce4ad0b",
            "price": 250
        }
    ],
    "archive": false
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "475a20e9-23ef-40ce-b2c4-c7dbcf230ebb"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/groups/{id}{?fields}
Full URL: https://api.aihelps.com/v1/groups/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid groupa1a9b38e-1627-4218-8beb-3c72230124bc
fieldsarray[string]list of fields to return (separated by comma)name,category,picture,pictureUrl,schedules,public,location_prices,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "20.30 Classic Boxing(LITVINENKO)",
    "category": null,
    "picture": "674f53c0-c623-464a-addc-173a35997f3e",
    "location_prices": [
        {
            "location": "88d48bd0-ac0d-ae7f-42ac-dddc77408d38",
            "price": 150
        },
        {
            "location": "88d670d2-4294-2ce2-2d52-3c106bb0deca",
            "price": 200
        },
        {
            "location": "88d670d2-42c1-0942-2d52-3c107ce4ad0b",
            "price": 250
        }
    ],
    "archive": false
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/groups/{id}
Full URL: https://api.aihelps.com/v1/groups/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of groups432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Each group can have different schedules in different locations. One groupschedule represent schedule for one specific group for one specific location.
Each such groupschedule represents information about lessons start times, duration and professional (or several).

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

GET/groupschedules{?fields}
Full URL: https://api.aihelps.com/v1/groupschedules{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)location,group,group_name,professionals,professionals_names
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "location": "ee2eaacc-4775-40c1-99bc-78451ef66f54",
        "group": "75a236ad-a957-4573-aac1-769e9bb65eb2",
        "professionals": [
            "490a1856-8889-4ec9-a03c-cf09ebea4f3d",
            "e29bc115-3a65-4f91-81d0-fdc5ca9a8c67"
        ],
        "professionals_names": [
            "Bob",
            "John"
        ]
    },
    {
        "location": "15116d0b-ef50-4704-a08f-e2110355e6b0",
        "group": "e5e23b9f-7d92-4518-8714-782edee848f3",
        "professionals": [
            "9e45d349-ee5c-4c37-8d80-866efe72dd8e",
            "0e968a65-eb76-4966-90c7-d4744c4af333"
        ],
        "professionals_names": [
            "Kevin",
            "David"
        ]
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

GET/groupschedules/{id}{?fields}
Full URL: https://api.aihelps.com/v1/groupschedules/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)location,group,group_name,professionals,professionals_names
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "location": "ee2eaacc-4775-40c1-99bc-78451ef66f54",
    "group": "75a236ad-a957-4573-aac1-769e9bb65eb2",
    "professionals": [
        "490a1856-8889-4ec9-a03c-cf09ebea4f3d",
        "e29bc115-3a65-4f91-81d0-fdc5ca9a8c67"
    ],
    "professionals_names": [
        "Bob",
        "John"
    ]
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/groupschedules{?fields}
Full URL: https://api.aihelps.com/v1/groupschedules{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)location,group,group_name,professionals,professionals_names
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "location": "ee2eaacc-4775-40c1-99bc-78451ef66f54",
    "group": "75a236ad-a957-4573-aac1-769e9bb65eb1",
    "professionals": [
        "490a1856-8889-4ec9-a03c-cf09ebea4f3a",
        "e29bc115-3a65-4f91-81d0-fdc5ca9a8c6c"
    ]
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c741"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/groupschedules/{id}{?fields}
Full URL: https://api.aihelps.com/v1/groupschedules/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesgroups schedule idbd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)location,group,group_name,professionals,professionals_names
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "location": "ee2eaacc-4775-40c1-99bc-78451ef66f54",
    "group": "75a236ad-a957-4573-aac1-769e9bb65eb1"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/groupschedules/{id}
Full URL: https://api.aihelps.com/v1/groupschedules/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesgroup schedule idbd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

To simplify groups management, groups can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/groups/categories{?fields,archive}
Full URL: https://api.aihelps.com/v1/groups/categories{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,picture,archive
archivebooleanget only archived or non archived group categoriesfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
        "name": "TRX",
        "parent": null,
        "picture": "a9e3b96e-8a1d-4070-96f5-0c1b15349f00",
        "archive": false
    },
    {
        "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
        "name": "Yoga",
        "parent": null,
        "picture": "e8ae17d0-60f5-46b2-b761-8417367737be",
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/groups/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/groups/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of groups categoryc9edc51c-a95a-4f9c-84fd-67022b957d79
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent,picture,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
    "name": "TRX",
    "parent": null,
    "picture": "2b604ce8-d035-4d10-8af0-18fc7123b29d",
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/groups/categories{?fields}
Full URL: https://api.aihelps.com/v1/groups/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent,picture,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Other",
    "parent": null,
    "picture": "1ea5b057-5a79-4180-a557-bafbfb37cd70",
    "archive": false
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c742"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/groups/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/groups/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of groups categorybd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)name,parent,picture,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Box",
    "parent": null,
    "picture": "1ce07b1d-5a1e-411e-b9e9-3f1915c1eade"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/groups/categories/{id}
Full URL: https://api.aihelps.com/v1/groups/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of groups categorybd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/groups/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/groups/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "archive": false,
    "categories":
    [
        {
            "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
            "name": "TRX",
            "parent": null,
            "archive": false
            "categories":
            [
            ],
            "items":
            [
                {
                    "id": "88d51648-c8c9-23bc-701d-2a562dade0f9",
                    "name": "TRX Day",
                    "category": "88d6719a-1e3b-ddd0-4a7d-aadf0d39db2b",
                    "picture": null,
                    "archive": false
                },
                {
                    "id": "88d5a478-ae15-8084-3b46-d5184883e3c5",
                    "name": "TRX 19:00",
                    "category": "88d6719a-1e3b-ddd0-4a7d-aadf0d39db2b",
                    "picture": null,
                    "archive": false
                },
                {
                    "id": "88d51648-fc5b-6266-701d-2a5641936e3d",
                    "name": "TRX for Mam's 16:00",
                    "category": "88d6719a-1e3b-ddd0-4a7d-aadf0d39db2b",
                    "picture": null,
                    "archive": false
                }
            ]
        },
        {
            "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
            "name": "Yoga",
            "parent": null,
            "archive": false,
            "categories":
            [
            ],
            "items":
            [
            ]
        }                    
    ],
    "items":
    [
    ]
}


Group lesson represents one lesson of specific group. Info about group lesson include lesson start date, duration, group and professional.

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module (only group, group_name, group_picture, location, group_price, date, duration, professional, professional_name, filled_completely, descriptionPlainText fields), client_access_token (only group, group_name, group_picture, location, group_price, date, duration, professional, professional_name, filled_completely, descriptionPlainText fields), reports

GET/grouplessons{?fields,from,to,location,group,professional,public,has_location_prices,publicProfessional}
Full URL: https://api.aihelps.com/v1/grouplessons{?fields,from,to,location,group,professional,public,has_location_prices,publicProfessional}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).date,duration,location,group,group_name,group_price,group_picture,professional,professional_name,assistant,assistant_name,hall,filled_completely,descriptionPlaintext
fromdatetimereturn only lessons started at date or later2019-01-01T10:00:00.000Z
todatetimereturn only lessons started at date or earlier2019-01-01T12:00:00.000Z
locationarray[identifier]get only lessons in given location (several locations can be separated by comma)12d4b305-e198-f02c-2743-cca93cb16baa
grouparray[identifier]get only given groups lessons (several groups can be separated by comma)8a6b32dd-53bb-4181-b7e5-1afb4e74f0f6
professionalarray[identifier]get only lessons with given professionals (several professionals can be separated by comma)5829ad23-0b78-41ed-a3ef-240725e31262
publicbooleanif group lesson is available for online bookingtrue
has_location_pricesbooleanget only group lesson where has pricetrue
publicProfessionalbooleanget group lessons with no professionals or with at least one active professionaltrue
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "c1efb8e7-00ec-4513-8745-739169e7b251",
        "date": "2019-01-01T10:00:00.000Z",
        "duration": 60,
        "location": "23c32b29-f871-448a-8646-d235a9b40d22",
        "group": "c20d2ff7-379b-4f02-b69d-c0c3aae52a02",
        "group_name": "Pilates",
        "group_price": 600,
        "group_picture": "90044752-ebb8-4de6-8202-25533dcdb7a5",
        "professional": "a64742ef-f39f-4828-a688-6efc44041b06",
        "professional_name": "Kevin",
        "assistant": "b1cac8b2-ebb8-fdef-b212-fcf13dcb1ccc",
        "assistant_name": "Bob",
        "hall": "b1cac8b2-ebb8-fdef-b212-ccfd2dcb1b1a",
        "filled_completely": false,
        "descriptionPlaintext": "the best group ever"
    },
    {
        "id": "c1efb8e7-00ec-4513-8745-739169e7b452",
        "date": "2019-01-01T10:00:00.000Z",
        "duration": 60,
        "location": "e9291108-f440-4822-a0d7-880fb5d09849",
        "group": "efcba4e6-c2c2-4a18-9ffb-7288caa91de2",
        "group_name": "Pilates",
        "group_price": 600,
        "group_picture": "de570138-91fe-4427-8ee6-c950b6d2bb17",
        "professional": "cb201d83-c4e2-44fb-9cac-5bfa145d699d",
        "professional_name": "Bob",
        "assistant": "b1cac8b2-ebb8-fdef-b212-fcf13dcb1ccc",
        "assistant_name": "Bob",
        "hall": "b1cac8b2-ebb8-fdef-b212-ccfd2dcb1b1a",
        "filled_completely": true,
        "descriptionPlaintext": "the best group ever"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module (only date, duration, group, group_name, group_price, group_picture, professional, professional_name fields), reports

GET/grouplessons/{id}{?fields}
Full URL: https://api.aihelps.com/v1/grouplessons/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesgroup lesson idadac3979-cf71-47fa-9a39-5f366fd1378e
fieldsarray[string]yeslist of fields to return (separated by comma).date,duration,location,group,group_name,group_price,group_picture,professional,professional_name,assistant,assistant_name,hall,filled_completely,descriptionPlaintext
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "adac3979-cf71-47fa-9a39-5f366fd1378e",
    "date": "2019-01-01T10:00:00.000Z",
    "duration": 60,
    "location": "23c32b29-f871-448a-8646-d235a9b40d22",
    "group": "c20d2ff7-379b-4f02-b69d-c0c3aae52a02",
    "group_name": "Pilates",
    "group_price": 600,
    "group_picture": "90044752-ebb8-4de6-8202-25533dcdb7a5",
    "professional": "1234c7b2-ebb8-fdef-b212-fccc3dc9bca1",
    "professional_name: "John",
    "assistant": "b1cac8b2-ebb8-fdef-b212-fcf13dcb1ccc",
    "assistant_name": "Bob",
    "hall": null,
    "filled_completely": true,
    "descriptionPlaintext": "the best group ever"
}

Authorization: `Database`

Authorization: Database

Scope: full

Custom errors:

  1. TIME_CONFLICT - one or several appointment services conflicts with other appointments services, group lessons or non working time
POST/grouplessons/{?fields}
Full URL: https://api.aihelps.com/v1/grouplessons/{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)date,duration,location,group,group_name,group_price,group_picture,professional,professional_name,assistant,assistant_name,hall,filled_completely,descriptionPlaintext
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2019-01-01T10:00:00.000Z",
    "duration": 60,
    "location": "23c32b29-f871-448a-8646-d235a9b40d22",
    "group": "c20d2ff7-379b-4f02-b69d-c0c3aae52a02",
    "group_price": 600,
    "professional": "a64742ef-f39f-4828-a688-6efc44041b06",
    "filled_completely": false
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c742"
}

Authorization: `Database`

Authorization: Database

Scope: full

Custom errors:

  1. TIME_CONFLICT - one or several appointment services conflicts with other appointments services, group lessons or non working time
PUT/grouplessons/{id}{?fields}
Full URL: https://api.aihelps.com/v1/grouplessons/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesgroup lesson idbd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)date,duration,location,group,group_name,group_price,group_picture,professional,professional_name,assistant,assistant_name,hall,descriptionPlaintext
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "duration": 60,
    "location": "23c32b29-f871-448a-8646-d235a9b40d22",
    "group": "c20d2ff7-379b-4f02-b69d-c0c3aae52a02",
    "group_price": 600
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/grouplessons/{id}
Full URL: https://api.aihelps.com/v1/grouplessons/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesgroups lesson idbd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

A group appointment is a preliminary booking of a single client for a single group lesson. It is unrelated to regular appointments (/appointments) - use this resource only when enrolling a client in a group lesson.
The resource has only three fields: id, client, and group_lesson. There is no PUT endpoint; to change a booking, delete the group appointment (DELETE /group_appointments/{id}) and create a new one (POST /group_appointments). Group appointments appear in client history with item type group_appointment.

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id)

GET/group_appointments{?fields,client}
Full URL: https://api.aihelps.com/v1/group_appointments{?fields,client}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).client,group_lesson
clientstringget appointments only for given client (several clients can be separated by comma)f4b1a3b8-83c3-4bda-aaf4-8589c945dcc3
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "8a14c75f-a0b4-4acd-afa1-cb2efff93d2b",
        "client": "601f3b0f-8637-49ff-b699-a34dd1f378a2",
        "group_lesson": "33147ead-b003-4465-97e9-bb320a5f03b1"
    },
    {
        "id": "40d89d84-ac9a-4965-8121-086ef1f2dd7c",
        "client": "985d5a2d-819e-4ae0-984f-d14569637ac4",
        "group_lesson": "c2eb6f56-713c-4d3b-b98c-3ecabf013082"
    },  
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id)

GET/group_appointments/{id}
Full URL: https://api.aihelps.com/v1/group_appointments/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesgroup lesson idadac3979-cf71-47fa-9a39-5f366fd1378e
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "adac3979-cf71-47fa-9a39-5f366fd1378e",
    "client": "601f3b0f-8637-49ff-b699-a34dd1f378a2",
    "group_lesson": "33147ead-b003-4465-97e9-bb320a5f03b1"
}

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id), clients_module

Custom errors:

  1. ALREADY_EXISTS - client already booked on group lesson or max clients in group reached (see error details)
POST/group_appointments
Full URL: https://api.aihelps.com/v1/group_appointments
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
Body
{
    "client": "60444aac-8c98-4725-bef3-4e6868b95833",
    "group_lesson": "881f83ca-987d-4c58-97ae-a5796c4cfe27"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bb765afbc321",
}

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id)

DELETE/group_appointments/{id}
Full URL: https://api.aihelps.com/v1/group_appointments/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifiergroup appointment idd291df13-0782-44fc-a409-18df9dbca888
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Pictures

All price pictures (services, products, cards, etc.) are stored in pictures. Each item contains picture informationand picture itself.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

GET/pictures{?fields}
Full URL: https://api.aihelps.com/v1/pictures{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,category
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "7d11956f-64e8-454e-af32-736dbcb9cb31",
        "name": "Fitness",
        "category": "ebb2776c-14d3-4409-9bfc-594cc6722a1c"
    },
    {
        "id": "239e1f2a-5fee-4b9d-9efd-481fd813f942",
        "name": "Training program",
        "category": "0a27b0a8-1ce3-45f6-b0b8-6e6f6ce86f8b"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

GET/pictures/{id}{?fields}
Full URL: https://api.aihelps.com/v1/pictures/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryespicture id3ed3c526-3b6b-46da-9976-6fc3d52400a3
fieldsarray[string]yeslist of fields to return (separated by comma)name,category
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "51fbd5c0-6b29-456e-8d9f-779da67e3cdf",
    "name": "Hall rental",
    "category": "ebb2776c-14d3-4409-9bfc-594cc6722a1c"
}

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

GET/pictures/{id}/image{?width,height,resize,access_token}
Full URL: https://api.aihelps.com/v1/pictures/{id}/image{?width,height,resize,access_token}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid picture.3ed3c526-3b6b-46da-9976-6fc3d52400a3
widthnumberimage width needed100
heightnumberimage height needed100
resizeenum[string]type of resize for imagefit
access_tokenstringtoken used for API requests9c4068e2-c81f-4d70-ad31-8f627ed9bced
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response

To simplify pictures management, pictures can be arranged in categories.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/pictures/categories{?fields}
Full URL: https://api.aihelps.com/v1/pictures/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
        "name": "Groups",
        "parent": null
    },
    {
        "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
        "name": "Loreal products",
        "parent": null
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/pictures/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/pictures/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of pictures categoryc9edc51c-a95a-4f9c-84fd-67022b957d79
fieldsarray[string]yeslist of fields to return (separated by comma).name,parent
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
    "name": "Groups",
    "parent": null
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/pictures/categories{?fields}
Full URL: https://api.aihelps.com/v1/pictures/categories{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,parent
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Other",
    "parent": null
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c742"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/pictures/categories/{id}{?fields}
Full URL: https://api.aihelps.com/v1/pictures/categories/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of pictures categorybd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)name,parent
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Stylists services",
    "parent": null
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/pictures/categories/{id}
Full URL: https://api.aihelps.com/v1/pictures/categories/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of pictures categorybd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/pictures/tree{?fields,categories_fields,empty_categories}
Full URL: https://api.aihelps.com/v1/pictures/tree{?fields,categories_fields,empty_categories}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)name,parent
categories_fieldsarray[string]yeslist of categories fields to return (separated by comma)name,category
empty_categoriesstringif empty categories should be returned (otherwise empty categories are not returned)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": null,
    "name": "",
    "parent": null,
    "categories":
    [
        {
            "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
            "name": "Groups",
            "parent": null
            "categories":
            [
            ],
            "items":
            [
                {
                    "id": "7d11956f-64e8-454e-af32-736dbcb9cb31",
                    "name": "Fitness",
                    "category": "c9edc51c-a95a-4f9c-84fd-67022b957d79"
                },
                {
                    "id": "239e1f2a-5fee-4b9d-9efd-481fd813f942",
                    "name": "Training program",
                    "category": "c9edc51c-a95a-4f9c-84fd-67022b957d79"
                }
            ]
        },
        {
            "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
            "name": "Loreal products",
            "parent": null
            "categories":
            [
            ],
            "items":
            [
            ]
        }                    
    ],
    "items":
    [
    ]
}

Appointments

Appointment is planned visit for specified client (employee or guest also can be clients) on specified date into specified location.
Appointments are one of the most complex objects in API: they have complex validation, several unique checks and sending messages on different events.
While updating appointment, try to call update appointment endpoint and pass there all services, products, etc., not updating each appointment sub-item one-by-one,
cause in such situation all these operations and validations will be called each time.
Field selection example. To load an appointment with nested services and products in one request:

GET /appointments/{id}?fields=date,client,services(service,start,duration,professional),products(product,quantity)

This returns the appointment date and client id, each service with its id, start time, duration and professional, and each product with product id and quantity. Use nested parentheses to select fields inside array resources (same syntax as elsewhere in the API).
Sub-resource endpoints vs update modes. For reading or changing appointment items you can either use dedicated sub-resource endpoints (/appointments/items/...) or update the parent appointment in one of three ways (see Update appointment items below). Prefer updating the whole appointment (mode 3 with action=insert/update/delete) when editing multiple items at once - it runs validations once and is safer for concurrent changes. Use sub-resource endpoints when you need to add, update or delete a single item without knowing the appointment id.


Description of appointment states:

  • reserved - temporary state used for editing appointments. Main task of such appointments - reserve professionals/halls/resources time while editing appointment and simplifies process of editing appointment. Important moment: time reservation is valid only 15 minutes after created_date. If more needed, update created_date. Appointment state can't be changed to this state - only new appointment with this state can be created.
  • planned - default appointment state after creation. Appointment is valid.
  • confirmed - same as planned, but user confirmed his visit.
  • cancelled - appointment was cancelled and saved only for history reasons (also state can be changed to other states).
    Appointment items can be payed separately, so there is no appointment payed state. Only appointments in planned or confirmed states can contain payed items (paying for item automatically switch appointment state from planned to confirmed). Payed items are items with sale field not equals to null.
    Appointments and appointment items are subject to the 2-month data history limit.
    Validations
    Two last validations (time conflict): mention that checks are executed only if at least one of described parameters changed, so if appointment was saved with force parameter and now you changed, for example, notifySms fields, no checks will be done and no errors happen. If you set force=true parameter, 409 error will be returned, but result will conflict timeConflicts field with list of conflicts.
    Sending messages
    Adding/updating/deleting appointments or changing appointment services also triggers some messages sent to client/employee or professional:
    first_start is smallest field start from all appointment services, first_professional - professional field from corresponding appointment service. These 2 values also will be used in message text.
    These messages are sent only if client/employee set, his number provided and do_not_send_sms_notification option not set for client. Changing client/employee is treated like deleting appointment for old client and creating new one for new client, thus 2 messages will be sent: "Appointment cancelled" for old client and "New appointment created" for new one.
    Depending from program settings and notifySms client can receive one or several notification messages "Reminder about appointment" at specified number of hours or days before first_start. Changing appointment services can cause first_start change - in this case all reminder messages not sent yet will be cancelled and new messages planned to send (only if it is still enough time for that message - if options set to send one message in 1 day and another in 2 hours, but appointment changed 4 hours before first_start, only second notification will be planned to send). Along with "Appointment cancelled" message all reminder messages not sent yet will be cancelled.
    There are some other messages (like request for feedback or periodical services reminder), but they are triggered by other endpoints (like purchase) and will be described there.
    If NotifyProfessionalsSMS option is set, professional and assistant are also notified about appointment via message. They receive notification "You have new appointment" on creating new appointment in planned or confirmed states or changing state of existing appointment from reserved or cancelled to planned or confirmed states (for appointments where appointment service exists for current professional or assistant); adding appointment service with professional or assistant to existing appointment in planned or confirmed states or changing appointment services so that first appointment service start or total duration (last appointment service end) for professional or assistant changed.
    Appointment edit
    Typical process of creating new/edit existing appointment dialog should be following:
  1. If edit existing appointment, make local copy of current appointment with all items (or create empty appointement info for new appointment).
  2. On any services items change: if not yet created, create separate reserve appointment and save all new service items to it. Any change to service items should be reflected in this reserve appointement and saved to API. If you reserve error about conflict, highlight conflicted items in interface with detailed description. To skip conflicts with original appointment (while editing existing appointment), in reserve appointment save only time not existing in original appointment.
  3. Do not forget to update reserve createDate each 10-14 minutes (in 15 minutes you reserved time will become free and someone else can occupy it)
  4. All payed items in appointment can't be changed. Also, you can't change date, location, client and employee if at least one payed item exists. And can't remove appointment.
  5. If user change date, location or client/employee, you should check for valid appointment with these new date, location and client/employee. If exists, show combined information for both your new/existing appointment with changes you made + information from appointment with new requisites. If user change one of these 3 parameters once more, all changes to appointment with new requisites should be cancelled and check if other appointment with your new requisites exists. And process repeated.
  6. If user wants to exit without saving changes, you need to remove reserve appointment, if created.
  7. If user wants to exit and save changes, you save all changes to one appointment and try to save it. If conflicts found, show all conflicts to user. User can either refuse to save (see previous item) or force save with conflicts.
    This process is pretty complex. To make it easier, we implemented several helpers based on reserve appointments, making edit appointment simplier. So, previous process now looks so:
  8. If you want new appointment, create new one with reserved state. If you want to edit existing appointment, create new one with reserved state and pass copy={id} parameter in query string with id of appointment you want to edit. Do not forget to pass "state": "reserved" in body in both cases. You will receive id of newly created reserved appointment.
  9. Any change to appointment or appointment items - just save changes to your reserve appointment (except setting state field to some other than reserve - this field usage is reserved; save state somewhere else). Pass force=true, so conflicts will be returned, but will not cause an error. If any, highlight conflicted items in interface with detailed description.
  10. Do not forget to update reserve createDate each 10-14 minutes (in 15 minutes you reserved time will become free and someone else can occupy it). Updating createDate left - user can still just close page with appointment edited. But If he reopens it even in several hours, you can update createDate and receive back all conflicts if found.
  11. Still the same: all payed items in appointment can't be changed. Also, you can't change date, location, client and employee if at least one payed item exists. And can't remove appointment.
  12. If user change date, location or client/employee, just update corresponding fields of reserve appointment and save to API. All complex logic of finding existing appointment, merging with existing data (and un-merging from from previous appointment) will be done in API. After changing one of these fields you need to reload all appointment fields and items. Merging appointments with different states can lead to situation you don't know what state to show in appointment edit dialog: use actualState field instead of state (remember, state always be reserved for reserved appointment). If you try to add appointment with client/employee + date + location and state planned or confirmed or change appointment these fields so there is another appointments with same fields - current appointment will be merged with already existing one and id of existing appointment will be used as id of combined appointments. All fields will be merged (for example, string fields combined, bool fields - non-default value will be taken and so on). Please mention: in case of updating existing appointment and changing client/employee, date, location or state, id of your appointment can change (you will receive other id in responce than you provided for update, id field is always returned for updating appointments). If no client/employee set for appointment, no checks and merging will happen - there can be many appointments with no client/employee for one date and location - all these "guests" are treated as different ones. Also, there can be many appointments in cancelled or reserved state for one client/employee + day + location - they all will be OK until trying to change status to planned or confirmed.
  13. If user wants to exit without saving changes, just remove reserve appointment.
  14. If user wants to exit and save changes, just set state field to state you want. If conflicts found, show all conflicts to user. User can either refuse to save (see previous item) or force save with conflicts. If it was creating new appointment, appointment state will be changed to provided and merged appointment will be deleted. If it was editing existing appointment, all reserved appointment fields and items will be copied to edited appointment (full overwrite) and both reserved and merged appointment will be deleted.
  15. We strictly recommend not to delete appointments, but cancel them (so, it remains as cancelled in history with information about cancellation). Deleting this cancelled appointment can be done somewhere (for example, in client history), but not in edit appointment dialog (in this case you need to delete reserve, edit and merged appointment- but, once more, we do not recommend to do so).
    Additional validations
    Except validations described earlier, there are some more complex validations, usually taking into account two or more objects and hard to predict and fix forehead. That are either depends from settings or relations between objects in different tables. For example: provided product is not more available on provided storage, provided professional can't handle provided service anymore, card activation date can be only month start according to settings etc. There are two problems here:
  16. smaller one: these dependencies between objects can be changed between data loaded and changes to appointment made. Requires subscribing to changes + additional checks on client but feasible to prevent in many cases (not all though, you can't subscribe to settings changes).
  17. bigger one: you can create a valid appointment with valid appointment items, and save it to database. Then someone can change services, products, settings, etc. in a way that your appointment becomes invalid. So next time you open it (in a week or two, for example) it is already invalid.
    If force parameter is not provided, such validation raise 400 Bad Request error with type "APPOINTMENT_VALIDATION" and list of validation errors on such complex validations. If force=true, list of such failures is returned on each insert/update/get appointment call if "validations" field declared in fields list. So, such appointments can be stored in database. If any such validation fails found, API returns you list of fails in validations error (additional field in result, absent if no fails but always present if any fails found - you can't and don't need to set it in fields parameter). But item can't be sold if some validations failed - you will receive 400 Bad Request error if you try to pay for such invalid item (/sales/purchase endpoint).
    Each validation fail structure is described in validation field.
    We propose to show "Description" (localized or not) with substituted fields (service/product name etc.) to client and do not allow paying for items if any validation fails exists.
    Please take into account that these validations can be returned for items you didn't changed in request in case already stored in database items already fail validations. For example, you update appointment changing services field, but validations fails for products will also be returned.
    Also, important moment: if you insert/update/get appointment item and requested "validations" field in fields, validations will be returned for all items, not only for requested one. This is needed because sometimes items can depend from another items and change in one can raise validation result in others.
    Update appointment items

    Appointment services, products, cards, certificates and dentures can be updated (for existing appointment) in 3 different ways:
  18. using specific endpoints POST '/appointments/items', PUT/DELETE '/appointments/items/{item id}' (where items=services/products/cards/certificates/dentures) - in this way you can add, update or delete item. Benefit of this method - you can update/delete item without knowing appointment id, otherwise we recommend use method 3.
  19. full rewrite all items of specific type: PUT '/appointments/{appointment id}', corresponding array ("services"/"products"/"cards"/"certificates"/"dentures") is array of items. You can't provide ids in this case - they will be automatically generated.
  20. update items of specific type: PUT '/appointments/{appointment id}', corresponding array ("services"/"products"/"cards"/"certificates"/"dentures") is array of items, each having property action=insert/update/delete. Specifying action=insert item will be added (id will be generated), action=update - item will be updated (id is required), action=delete - item will be removed (id is required, all other properties ignored). This method has big advantage over previous - it does not change items you did not specify, thus more safe for concurrent changes.

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id), reports

GET/appointments{?fields,from,to,client,employee,location,state}
Full URL: https://api.aihelps.com/v1/appointments{?fields,from,to,client,employee,location,state}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,location,client,clientName,clientFirstName,clientMiddleName,clientLastName,employee,employeeName,employeeFirstName,employeeMiddleName,employeeLastName,receptionist,notifySms,services,products,certificates,dentures,cards,cancelDate,cancelReason,cancelReceptionist,createDate,feedback,groupComments(id,appointment,professional,start,text)
fromdatetimeget appointments which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointments which starts before specified date2019-01-02T12:00:00.000Z
locationidentifierget appointments only for given location (several locations can be separated by comma)12d4b305-e198-f02c-2743-cca93cb16baa
stateenum[string]get only appointments of specified state (or several states)reserved
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "e132e1c1-0450-4e50-973e-0d59007331ca",
        "state": "planned",
        "date": "2020-01-01",
        "location": "e77673a6-1f77-4e22-b19a-9d5fadfc83c6",
        "client": "f9c254bd-069a-4d4c-87b6-e981cbb966d1",
        "clientName": "John Michael Brown",
        "clientFirstName": "John",
        "clientMiddleName" "Michael",
        "clientLastName: "Brown",
        "employee": null,
        "employeeName": "",
        "employeeFirstName": "",
        "employeeMiddleName": "",
        "employeeLastName: "",
        "receptionist": "13adf8fb-6304-4e1b-a036-1c092b9e82e0",
        "notifySms": "default",
        "services": [
            {
                "service": "13adf8fb-6304-4e1b-b0b6-1cf32b1e82e1",
                "professional": "13adf8fb-6304-4e1b-a136-1c792bfc8ae1",
                "start": "10:00:00",
                "duration": 60,
                "appointment": "13adf8fb-63ae-4d1b-ad36-8c092bf48aee" 
            }
        ],
        "products": [
            {                           
                "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
                "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
                "quantity": 2,
                "type": "package"
            }
        ],
        "certificates": null,
        "cards": null,
        "dentures": null,
        "clientsModule": true,
        "cancelDate": null,
        "cancelReason": null,
        "cancelReceptionist": null,
        "createDate": "2019-01-01T10:00:00.000Z",
        "feedback":
        [
            {
                "id": "13adf8fb-6304-4e1b-a036-1c092b9e82e0",
                "professional": "13adf8fb-6304-4e1b-a036-1c092b9e82e2",
                "date": "2019-01-01T11:27:14.000Z",
                "rating": 5,
                "text": "Good job!",
                "published": true
            }
        ],
        "hasAnySales": true,
        "clientInside": false,
        "original": null,
        "merged": null,
        "groupComments" : []
    },
    {
        "id": "5024efc3-4cf1-4359-a3fc-f94eb4c4e3d2",
        "state": "cancelled",
        "date": "2020-01-01",
        "location": "9b21186c-950d-4f1d-8ad5-0927472ee7c3",
        "client": null,
        "clientName": "",
        "clientName": "",
        "clientFirstName": "",
        "clientMiddleName": "",
        "clientLastName: "",
        "employee": "d4c38e7f-519c-4964-9d0e-8bf91a74146f",
        "employeeName": "John Michael Brown",
        "employeeFirstName": "John",
        "employeeMiddleName": "Michael",
        "employeeLastName: "Brown",
        "receptionist": "13adf8fb-6304-4e1b-a036-1c092b9e82e0",
        "notifySms": "default",
        "clients_module": true,
        "services": [
            {
                "service": "13adf8fb-6304-4e1b-b0b6-1cf32b1e82e1",
                "professional": "13adf8fb-6304-4e1b-a136-1c792bfc8ae1",
                "start": "10:00:00",
                "duration": 60,
                "appointment": "13adf8fb-63ae-4d1b-ad36-8c092bf48aee" 
            },
            {
                "service": "13adf8f2-6304-4e1b-b0b6-1cf3db5eefec",
                "professional": "13adf8fb-6304-4e1b-a136-1c792bfc8ae1",
                "start": "11:00:00",
                "duration": 60,
                "appointment": "13adf8fb-63ae-4d1b-ad36-8c092bf48aee" 
            },
        ],
        "products": null,
        "certificates": null,
        "cards": null,
        "dentures": null,
        "cancelDate": "2019-01-01T11:00:00.000Z",
        "cancelReason": "Plans changed",
        "cancelReceptionist": "8039d005-f519-425f-8c09-11fe7cb25738",
        "createDate": "2019-01-01T10:00:00.000Z",
        "feedback": null,
        "hasAnySales": true,
        "clientInside": false,
        "original": null,
        "merged": null,
        "groupComments" : [
             {
                  "appointment":"88db3f7d-5845-6dee-2bb3-bfbf3ad6e3bf",
                  "professional": null,
                  "start":"2023-04-17T10:00:00",
                  "text": "Text1"
              }
          ]
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), reports, services_aggregator (only state, date, location, client, cancelReason, clientsModule and services fields - services only with start, duration, service, professional subfields)

GET/appointments/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,location,client,clientName,clientFirstName,clientMiddleName,clientLastName,employee,employeeName,employeeFirstName,employeeMiddleName,employeeLastName,receptionist,notifySms,services,products,certificates,dentures,cards,cancelDate,cancelReason,cancelReceptionist,createDate,feedback,groupComments(id,appointment,professional,start,text)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "5c05c7a4-74da-42e5-ac5d-dbc489748143",
    "state": "planned",
    "date": "2019-01-01",
    "location": "e77673a6-1f77-4e22-b19a-9d5fadfc83c6",
    "client": "f9c254bd-069a-4d4c-87b6-e981cbb966d1",
    "clientName": "John Michael Brown",
    "clientFirstName": "John",
    "clientMiddleName" "Michael",
    "clientLastName: "Brown",
    "employee": null,
    "employeeName": "",
    "employeeFirstName": "",
    "employeeMiddleName": "",
    "employeeLastName: "",
    "receptionist": "13adf8fb-6304-4e1b-a036-1c092b9e82e0",
    "notifySms": "default",
    "clientsModule": true,
    "services": [
        {
            "service": "13adf8fb-6304-4e1b-b0b6-1cf32b1e82e1",
            "professional": "13adf8fb-6304-4e1b-a136-1c792bfc8ae1",
            "start": "10:00:00",
            "duration": 60,
            "appointment": "13adf8fb-63ae-4d1b-ad36-8c092bf48aee" 
        }
    ]
    "products": null,
    "certificates": null,
    "cards": null,
    "dentures": null,
    "cancelDate": null,
    "cancelReason": null,
    "cancelReceptionist": null,
    "createDate": "2019-01-01T10:00:00.000Z",
    "feedback":
    [
        {
            "id": "13adf8fb-6304-4e1b-a036-1c092b9e82e0",
            "professional": "13adf8fb-6304-4e1b-a036-1c092b9e82e2",
            "date": "2019-01-01T11:27:14.000Z",
            "rating": 5,
            "text": "Good job!",
            "published": true
        }
    ],
    "hasAnySales": true,
    "clientInside": false,
    "original": null,
    "merged": null,
    "groupComments" : []
}

By default, if `professional` is set, method checks if proposed appointment do not intersects with another appointments, reserves or sales.

By default, if professional is set, method checks if proposed appointment do not intersects with another appointments, reserves or sales.
If found, error 409002 returned (list of intersected items also returned as another_items property). If you want to skip time intersection checks and save appointment anyway, add force parameter to request.

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), services_aggregator (only state, date, location, client, cancelReason, clientsModule and services fields - services only with start, duration, service, professional subfields)

Custom errors:

  1. ALREADY_EXISTS - appointment you trying to edit already have reserve attached.
  2. TIME_CONFLICT - one or several appointment services conflicts with other appointments services, group lessons or non working time

As sending notification smses is not crucial for creating new appointment, error not returned if smses was not sent. Sending these smses is last step after saving new appointment (sending notification smses to client and professional). If failed, additional field returned in response:

{
    "smsError":
    {
        "type": "SMS_BALANCE",
        "message": "Not enough money for sending sms"
    }
}

Where type can be SMS, SMS_AUTH or SMS_BALANCE - use type for checks in code and show corresponding info for user. message describes additional details and can help developer to understood problem.

More details:

Remember, that date & location (can be omitted in request and will be taken from access token) fields are required except case copy parameter provided.

In most cases new appointment will be created with provided properties. But there are several special cases:

  1. if you provide client or employee fields and state = 'planned'/'confirmed'/(not provided equals to 'planned') and appointment with provided date+location+client/employee and state = 'planned'/'confirmed' already exists, new appointment will not be created, but rather existing appointment will be updated (and endpoint will return id of existing appointment). Updated fields are: services/products/cards/certificates/dentures - new items will be appended; comments - updated if not already contains proposed text (to prevent duplicate text in comments); clientsModule - can be set to true if original appointment not set yet; clientsModuleConfirmed - can be set to 'false' if clientsModule set to true; important - can be set to true if original appointment not set yet; notifySms - can be set to non 'default' value if original appointment value is 'default'; receptionist - can be set to provided value if original appointment value was null; controlManager - can be set to provided value if original appointment value was null. So, this case is extremely useful if you want to add one item (for example, service) on specific date+location+client/employee, but don't know if such appointment exists and id of this appointment if exists. Instead of searching and loading appointment by date+location+client/employee, appending item and sving again or inserting new appointment if not found - you can make just one simple call. Also, please take into account, that in case someone edit appointment with separate reserved appointment, all changes except items with sale not null field will be lost.
  2. if you provide client or employee fields and state = 'reserved' and appointment with provided date+location+client/employee and state = 'planned'/'confirmed' already exists, new reserved appointment will be created and found appointment will be marked to merge on edit end. Appointments will be merged in new reserved appointment on same rules as in previous case (info from found appointment will be copied to existing one), but found appointment will left unchanged. 409 Conflict "ALREADY_EXISTS" will be raised if found appointment already has attached valid reserve appointment (both ids of found and altready attched reserved appointment will be returned, so you can delete reserved appointment if needed). Also, same error with id=null will be raised if you try to create reserve but other reserve already exists (in this case id filed will be empty but reserve field will contain id of reserve appointment).
  3. if you provide copy parameter (remember, you can't provide date, location, client, employee fields and should set state = 'reserved' in this case), new reserved appointment will be created, that will be a full copy of copy appointment except new id field and state = 'reserved'. If you want, you can provide new field values for any fields except date, location, client, employee, state, they will be overwritten (services/products/cards/certificates/dentures will replace existing one if provided). 409 Conflict "ALREADY_EXISTS" will be raised if copied appointment already has attached valid reserve appointment (both ids of found and altready attched reserved appointment will be returned, so you can delete reserved appointment if needed).
POST/appointments{?fields,force,copy,skipRequiredPrepayment}
Full URL: https://api.aihelps.com/v1/appointments{?fields,force,copy,skipRequiredPrepayment}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)date,location,client,clientName,clientFirstName,clientMiddleName,clientLastName,employee,employeeName,employeeFirstName,employeeMiddleName,employeeLastName,receptionist,notifySms,services,products,certificates,dentures,cards,cancelDate,cancelReason,cancelReceptionist,createDate,groupComments(id,appointment,professional,start,text)
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
copyidentifierif set, new appointment will be filled with data from proposed appointment (only `id` field will be new). If you set some fields in body, they will override fields from copied appointment. This parameter is useful for creating reserve appointment when editing existing appointment: create reserve as copy from existing, edit it and replace existing on save. Prerequisites: copy appointement should have planned/confirmed state (not reserve or cancelled), you should pass `state` = 'reserved' so result appointment will be reserved and do not pass new `date`, `location`, `client` or `employee` parameters.'e94eb710-dc90-4af1-b836-3cc6b2de3126'
skipRequiredPrepaymentbooleanif true, prepayment is not required for services (in case required prepayment is configured).false
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2018-01-01T10:00:00.000Z",
    "location": "8fe29e48-d5a5-4dcc-800e-80eb6e9cac5c",
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

By default, if `professional` is set, method checks if changed appointment do not intersects with another appointments, reserves or sales.

By default, if professional is set, method checks if changed appointment do not intersects with another appointments, reserves or sales.
If found, error 409002 returned (list of intersected items also returned as another_items property). If you want to skip time intersection checks and save appointment anyway, add force parameter to request.

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id), services_aggregator (only state, date, location, client, cancelReason, clientsModule and services fields - services only with start, duration, service, professional subfields)

Custom errors:

  1. ALREADY_EXISTS - appointment you trying to edit already have reserve attached.
  2. TIME_CONFLICT - one or several appointment services conflicts with other appointments services, group lessons or non working time

As sending notification smses is not crucial for creating updated appointment, error not returned if smses was not sent. Sending these smses is last step after saving updated appointment (sending notification smses to client and professional). If failed, additional field returned in response:

{
    "smsError":
    {
        "type": "SMS_BALANCE",
        "message": "Not enough money for sending sms"
    }
}

Where type can be SMS, SMS_AUTH or SMS_BALANCE - use type for checks in code and show corresponding info for user. message describes additional details and can help developer to understood problem.

More details:

Appointment has one of four states, but not all state changes can be done: reserved appointments can only be created, but changing other states to reserved is illegal.

When changing date, location, client or employee and appointment with new date, location, client/employee and state='planned'/'confirmed' exists, update operation differs a bit for different appointment states:

  1. New state is cancelled - no merging with found appointment at all
  2. Both old and new state are not reserved (planned/confirmed/cancelled) and new state is not cancelled - permanently merge with new appointment, found appointment is deleted. Moreover, 409 Conflict "ALREADY_EXISTS" will be raised if current appointment has attached valid reserve appointment (both ids of found and altready attched reserved appointment will be returned, so you can delete reserved appointment if needed) - you can't change date, location, client or employee fields if someone edit appointment. 409 Conflict "ALREADY_EXISTS" will be raised if found appointment already has attached valid reserve appointment (both ids of found and altready attched reserved appointment will be returned, so you can delete reserved appointment if needed).
  3. Old state is reserved state, new state is any except cancelled - unmerge from previous appointment and merge with new one. Merges in reserved state are not permanent (all merged appointment data is copied into reserved appointment and is commited on reserve appointment change state to planned or confirmed).

If reserved appointment state changes to planned or confirmed, editing process finishes.

  1. If reserve was editing existing appointment, all changes from reserved appointment are applied to original appointment, including data from merged appointment. Reserved and merged (if exist) appointments are deleted.
  2. If reserve was editing new appointment, appointment state changes from from reserved to proposed one, including data from merged appointment, merged (if exists) appointment is deleted.
    As appointment items with sale not null can't be edited, they are copied to final appointment from original and merged appointments. All other items in final appointment are taken from reserved appointment, losing changes to original/merged appointments done after start editing/merging respectively.
PUT/appointments/{id}{?fields,force,skipRequiredPrepayment}
Full URL: https://api.aihelps.com/v1/appointments/{id}{?fields,force,skipRequiredPrepayment}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]list of fields to return (separated by comma)date,location,client,clientName,clientFirstName,clientMiddleName,clientLastName,employee,employeeName,employeeFirstName,employeeMiddleName,employeeLastName,receptionist,notifySms,services,products,certificates,dentures,cards,cancelDate,cancelReason,cancelReceptionist,createDate,groupComments(id,appointment,professional,start,text)
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales should be skipped.true
skipRequiredPrepaymentbooleanif true, prepayment is not required for services (in case required prepayment is configured).false
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2018-01-01T00:00:00.000Z",
    "location": "8fe29e48-d5a5-4dcc-800e-80eb6e9cac5c"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (client field should match client id)

As sending notification smses is not crucial for deleting appointment, error not returned if smses was not sent. Sending these smses is last step after deleting appointment (sending notification sms to client about cancelled visit). If failed, additional field returned in response:

{
    "smsError":
    {
        "type": "SMS_BALANCE",
        "message": "Not enough money for sending sms"
    }
}

Where type can be SMS, SMS_AUTH or SMS_BALANCE - use type for checks in code and show corresponding info for user. message describes additional details and can help developer to understood problem.

DELETE/appointments/{id}
Full URL: https://api.aihelps.com/v1/appointments/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full

API automatically sends notifications to client 1 or 2 hours before appointment start (or other time according to appointment and general settings).
But additional notification can be sent manually if needed by this endpoint.

Next prerequisites are required:

  1. Appointment is in 'planned' or 'confirmed' state
  2. At least one appointment service exists in appointment
  3. Appointment has a client (not a guest) and client had not refused to receive notification smses
  4. Sms service and sms notification text was configured

In these cases 400 Bad Request will be returned.

IF sms succesfully sent, sms send result will be returned:

{
    "status": "Accepted"
}

If error while sending sms happened, next result will be returned:

{
    "smsError":
    {
        "type": "SMS_BALANCE",
        "message": "Not enough money for sending sms"
    }
}

Where type can be SMS, SMS_AUTH or SMS_BALANCE - use type for checks in code and show corresponding info for user. message describes additional details and can help developer to understood problem.

POST/appointments/{id}/sendNotification
Full URL: https://api.aihelps.com/v1/appointments/{id}/sendNotification
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "status": "Accepted"
}

Change history for appointment fields and related items (services, products, cards, certificates, dentures). Text fields are localized using Content-Language header.
Data only for the last 2 months is available. If you need older data you have to contact us individually.

Authorization: `Database`

Authorization: Database

Scope: full, services_aggregator

GET/appointments/changeLogs{?appointment}
Full URL: https://api.aihelps.com/v1/appointments/changeLogs{?appointment}
Parameters
NameTypeRequiredDescriptionExample
appointmentidentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
        "date": "2019-01-15T10:30:00.000Z",
        "eventType": "Updated",
        "fieldName": "Date",
        "fieldNameConvert": "Date",
        "employeeName": "John Doe",
        "tableName": "appointment",
        "fieldBeforeConvert": "15.01.2019 09:00:00",
        "fieldAfterConvert": "15.01.2019 10:00:00",
        "event": 2,
        "gender": "Male"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

Same as GET /appointments/changeLogs. Pass appointment id in appointment query parameter.

GET/appointments/changeLogs/{id}{?appointment}
Full URL: https://api.aihelps.com/v1/appointments/changeLogs/{id}{?appointment}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryeschange log entry id (reserved for future use)b1c2d3e4-f5a6-7890-bcde-f12345678901
appointmentidentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
        "date": "2019-01-15T10:30:00.000Z",
        "eventType": "Updated",
        "fieldName": "Date",
        "fieldNameConvert": "Date",
        "employeeName": "John Doe",
        "tableName": "appointment",
        "fieldBeforeConvert": "15.01.2019 09:00:00",
        "fieldAfterConvert": "15.01.2019 10:00:00",
        "event": 2,
        "gender": "Male"
    }
]


Appointment is planned visit of a client for some date for one or several services.
Two moments to remember:

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/services{?fields,from,to,client,professional,location}
Full URL: https://api.aihelps.com/v1/appointments/services{?fields,from,to,client,professional,location}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)start,duration,assistant,professional,professionalName,professionalPhone,service,serviceName,quantity,teeth,hall,hallName,customMaterials,recommendedBy,date,appointment,state,cancelReason,client,clientName,clientPhone,location,sale
fromdatetimeget appointment services which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointment services which starts before specified date2019-01-01T12:00:00.000Z
professionalidentifierget appointments only for given professional (several professionals can be separated by comma)f43d9001-fb13-4511-8ca6-d75481e811d4
locationidentifierget appointment service only for given location. (several locations can be separated by comma)f43d9001-fb13-4511-8ca6-d75481ad1cdb
clientidentifierget appointment service only for given client. (several clients can be separated by comma)f43d9001-fb13-4511-8ca6-d75481ad322b
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "e132e1c1-0450-4e50-973e-0d59007331ca",
        "start": "10:10:10.000Z",
        "duration": 60,
        "assistant": "4357be34-aa4b-4711-8a4d-34b3059b5b43",
        "professional": "5acc652b-c762-4eda-983b-59cc86ea4481",
        "professionalName": "Bob",
        "professionalPhone": "+38(063)1234567",
        "service": "4b244443-90d3-4182-918a-fe3ac4a03688",
        "quantity": 2,
        "hall": null,
        "hallName": null,
        "date": "2020-01-01",
        "appointment": "4b244443-90d3-4182-918a-fe3ac4a0331b",
        "cancelReason": "",
        "state": "planned",
        "client": "4b244443-90d3-4182-918a-fe3ac4a0dc11",
        "clientName": "John Doe".
        "clientPhone": "+38(063)1234567",
        "location": "4b244443-90d3-4182-918a-fe3ac4a01311",
        "sale": null
    },
    {
        "id": "5024efc3-4cf1-4359-a3fc-f94eb4c4e3d2",
        "start": "10:10:10.000Z",
        "duration": 60 ,
        "assistant": "4357be34-aa4b-4711-8a4d-34b3059b5b43",
        "professional": "5acc652b-c762-4eda-983b-59cc86ea4481",
        "professionalName": "3b0070ed-d302-4765-90f9-ce67a848d370",
        "professionalPhone": "+38(063)1234567",
        "service": "3d2f87de-61fb-4f02-9d6c-93dc6a86fb6a",
        "quantity": 2,
        "hall": null,
        "hallName": null,
        "date": "2020-01-01",
        "state": "confirmed",
        "client": "4b244443-90d3-4182-918a-fe3ac4a0dc11",
        "clientName": "John Doe".
        "clientPhone": "+38(063)1234567",
        "location": "cb244443-90d3-4182-918a-fe3ac4a01311",
        "sale": "1b244443-90d3-4182-918a-fe3afdabaa1a"
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), reports

GET/appointments/services/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/services/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)start,duration,assistant,professional,professionalName,professionalPhone,service,serviceName,quantity,teeth,hall,hallName,customMaterials,recommendedBy,date,appointment,state,cancelReason,client,clientName,clientPhone,location,sale,timeConflicts,validations
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "5c05c7a4-74da-42e5-ac5d-dbc489748143",
    "start": "10:10:10.000Z",
    "duration": 60,
    "assistant": "4357be34-aa4b-4711-8a4d-34b3059b5b43",
    "professional": "5acc652b-c762-4eda-983b-59cc86ea4481",
    "professionalName": "Bob",
    "service": "4b244443-90d3-4182-918a-fe3ac4a03688",
    "quantity": 2,
    "hall": null,
    "date": "2020-01-01",
    "state": "planned",
    "client": "4b244443-90d3-4182-918a-fe3ac4a0dc11",
    "location": "cb244443-90d3-4182-918a-fe3ac4a01311",
    "sale": null
}

By default, if `professional` is set, method checks if proposed appointment do not intersects with another appointments, reserves or sales.

By default, if professional is set, method checks if proposed appointment do not intersects with another appointments, reserves or sales.
If found, error 409002 returned (list of intersected items also returned as another_items property). If you want to skip time intersection checks and save appointment anyway, add force parameter to request.

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id)

Custom errors:

  1. TIME_CONFLICT - one or several appointment services conflicts with other appointments services, group lessons or non working time
  2. SMS, SMS_AUTH and SMS_BALANCE - last step after saving updated appointment is sending notification smses to client and professional. Receiving these errors means save appointment operation successfully finished and stored in database, but notification smses was not sent (not so crucial to rollback appointment, but you should be notified).
POST/appointments/services{?fields,force,skipRequiredPrepayment}
Full URL: https://api.aihelps.com/v1/appointments/services{?fields,force,skipRequiredPrepayment}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)start,duration,assistant,professional,professionalName,professionalPhone,service,serviceName,quantity,teeth,hall,hallName,customMaterials,recommendedBy,date,appointment,state,cancelReason,client,clientName,clientPhone,location,sale,timeConflicts,validations
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
skipRequiredPrepaymentbooleanif true, prepayment is not required for services (in case required prepayment is configured).false
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "start": "10:00:00.000Z",
    "duration": 150,
    "professional": "2783c237-214d-4f13-bae2-ac4eee79ba03"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

By default, if `professional` is set, method checks if changed appointment do not intersects with another appointments, reserves or sales.

By default, if professional is set, method checks if changed appointment do not intersects with another appointments, reserves or sales.
If found, error 409002 returned (list of intersected items also returned as anotherItems property). If you want to skip time intersection checks and save appointment anyway, add force parameter to request.

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id)

Custom errors:

  1. TIME_CONFLICT - one or several appointment services conflicts with other appointments services, group lessons or non working time
  2. SMS, SMS_AUTH and SMS_BALANCE - last step after saving updated appointment is sending notification smses to client and professional. Receiving these errors means save appointment operation successfully finished and stored in database, but notification smses was not sent (not so crucial to rollback appointment, but you should be notified).
PUT/appointments/services/{id}{?fields,force,skipRequiredPrepayment}
Full URL: https://api.aihelps.com/v1/appointments/services/{id}{?fields,force,skipRequiredPrepayment}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]list of fields to return (separated by comma)start,duration,assistant,professional,professionalName,professionalPhone,service,serviceName,quantity,teeth,hall,hallName,customMaterials,recommendedBy,date,appointment,state,cancelReason,client,clientName,clientPhone,location,sale,timeConflicts,validations
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
skipRequiredPrepaymentbooleanif true, prepayment is not required for services (in case required prepayment is configured).false
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "start": "2018-01-01T10:00:00.000Z",
    "duration": 150,
    "professional": "2783c237-214d-4f13-bae2-ac4eee79ba03"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id)

Custom errors:

  1. SMS, SMS_AUTH and SMS_BALANCE - last step after saving updated appointment is sending notification smses to client and professional. Receiving these errors means save appointment operation successfully finished and stored in database, but notification smses was not sent (not so crucial to rollback appointment, but you should be notified).
DELETE/appointments/services/{id}
Full URL: https://api.aihelps.com/v1/appointments/services/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response


Appointment is planned visit of a client for some date for one or several services.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/services/materials{?fields,from,to}
Full URL: https://api.aihelps.com/v1/appointments/services/materials{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)product,storage,quantity,service,appointment
fromdatetimeget appointment service products which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointment service products which starts before specified date2019-01-01T12:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "date": "2020-01-01",
        "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
        "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
        "quantity": 2,
        "appointmentService": "f2c7ed19-2b49-4c8e-8592-9b26c8ab9f1a"
    },
    {
        "date": "2019-01-02",
        "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1bbb",
        "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1c1c",
        "quantity": 2,
        "appointmentService": "cc827fb4-40e9-4a61-bad8-d24a1081c81c"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/services/materials/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/services/materials/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,product,storage,quantity,appointmentService
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "date": "2020-01-01",
    "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
    "quantity": 2,
    "appointmentService": "f2c7ed19-2b49-4c8e-8592-9b26c8ab9f1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/appointments/services/materials{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/services/materials{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)date,product,storage,quantity,appointmentService
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales should be skipped.true
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
    "quantity": 2,
    "appointmentService": "f2c7ed19-2b49-4c8e-8592-9b26c8ab9f1a"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/appointments/services/materials/{id}{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/services/materials/{id}{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]list of fields to return (separated by comma)date,product,storage,quantity,appointmentService
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales should be skipped.true
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
    "quantity": 2,
    "appointmentService": "f2c7ed19-2b49-4c8e-8592-9b26c8ab9f1a"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/appointments/services/materials/{id}
Full URL: https://api.aihelps.com/v1/appointments/services/materials/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response


Appointment is planned visit of a client for some date for one or several services.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/products{?fields,from,to}
Full URL: https://api.aihelps.com/v1/appointments/products{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,product,storage,quantity,type,appointment,sale
fromdatetimeget appointment products which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointment products which starts before specified date2019-01-01T12:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "date": "2020-01-01",
        "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
        "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
        "quantity": 2,
        "type": "package",
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
        "sale": null
    },
    {
        "date": "2020-01-01",
        "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1bbb",
        "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1c1c",
        "quantity": 2,
        "type": "package",
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c81c",
        "sale": null
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), reports

GET/appointments/products/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/products/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,product,storage,quantity,type,appointment,sale
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "date": "2020-01-01",
    "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
    "quantity": 2,
    "type": "package",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
    "sale": null
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/appointments/products{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/products{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)date,product,storage,quantity,type,appointment,sale
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "storage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
    "quantity": 2,
    "type": "package",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/appointments/products/{id}{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/products/{id}{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]list of fields to return (separated by comma)date,product,storage,quantity,type,appointment,sale
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "product": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "strage": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea16aa",
    "quantity": 2,
    "type": "package",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/appointments/products/{id}
Full URL: https://api.aihelps.com/v1/appointments/products/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response


Appointment is planned visit of a client for some date for one or several services.

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/certificates{?fields,from,to}
Full URL: https://api.aihelps.com/v1/appointments/certificates{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,certificate,appointment,sale
fromdatetimeget appointment certificates which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointment certificates which starts before specified date2019-01-01T12:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "date": "2020-01-01T10:10:10.000Z",
        "certificate": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
        "sale": null
    },
    {
        "date": "2020-01-02T10:10:10.000Z",
        "certificate": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1bbb",
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
        "sale": null
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), reports

GET/appointments/certificates/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/certificates/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,certificate,appointment,sale
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "date": "2020-01-01",
    "certificate": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
    "sale": null
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/appointments/certificates{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/certificates{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)date,certificate,appointment
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "certifcate": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/appointments/certificates/{id}{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/certificates/{id}{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]list of fields to return (separated by comma)date,certificate,appointment
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "certificate": "d6d3d3d7-f6c6-46eb-a820-5a68f7ea1611",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/appointments/certificates/{id}
Full URL: https://api.aihelps.com/v1/appointments/certificates/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/cards{?fields,from,to}
Full URL: https://api.aihelps.com/v1/appointments/cards{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,card,cardNumber,activationDate,appointment,sale
fromdatetimeget appointment cards which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointment cards which starts before specified date2019-01-01T12:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "date": "2020-01-01T10:10:10.000Z",
        "card": "cc827fb4-40e9-4a61-bad8-d24a1081c891",
        "activationDate": "2019-01-20T10:10:10.000Z",
        "cardNumber": 2,
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
        "sale": null
    },
    {
        "date": "2019-01-02T10:10:10.000Z",
        "card": "cc827fb4-40e9-4a61-bad8-d24a1081c891",
        "activationDate": "2019-12-12T10:10:10.000Z",
        "cardNumber": 2,
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c891",
        "sale": null
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), reports

GET/appointments/cards/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/cards/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,card,cardNumber,activationDate,appointment,sale
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "date": "2019-01-02T10:10:10.000Z",
    "card": "cc827fb4-40e9-4a61-bad8-d24a1081c891",
    "activationDate": "2019-12-12T10:10:10.000Z",
    "cardNumber": 2,
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c891",
    "sale": null
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/appointments/cards{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/cards{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,card,cardNumber,activationDate,appointment,sale
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2019-01-02T10:10:10.000Z",
    "card": "cc827fb4-40e9-4a61-bad8-d24a1081c891",
    "activationDate": "2019-12-12T10:10:10.000Z",
    "cardNumber": 2,
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c891"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/appointments/cards/{id}{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/cards/{id}{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment card id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,card,cardNumber,activationDate,appointment
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2019-01-02T10:10:10.000Z",
    "activationDate": "2019-12-12T10:10:10.000Z",
    "cardNumber": 2,
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c891"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/appointments/cards/{id}
Full URL: https://api.aihelps.com/v1/appointments/cards/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full, reports

GET/appointments/dentures{?fields,from,to}
Full URL: https://api.aihelps.com/v1/appointments/dentures{?fields,from,to}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,denture,laboratory,technician,professional,comments,teeth,appointment,sale
fromdatetimeget appointment denture cards which starts at or after specified date2019-01-01T10:00:00.000Z
todatetimeget appointment denture cards which starts before specified date2019-01-01T12:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "date": "2020-01-01",
        "denture": "cc827fb4-40e9-4a61-bad8-d24ac0c1c191",
        "laboratory": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1c2",
        "technician": "some text",
        "professional": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1v4",
        "comments": "some text comments",
        "teeth": "some teeth",
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
        "sale": null
    },
    {
        "date": "2020-01-01T10:10:10.000Z",
        "denture": "cc827fb4-40e9-4a61-bad8-d24ac0c1cc92",
        "laboratory": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1c2",
        "technician": "some text",
        "professional": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1v5",
        "comments": "some text comments",
        "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
        "sale": null
    }
]

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (client field should match client id), reports

GET/appointments/dentures/{id}{?fields}
Full URL: https://api.aihelps.com/v1/appointments/dentures/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,denture,laboratory,technician,professional,comments,teeth,appointment,sale
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "date": "2020-01-01T10:10:10.000Z",
    "denture": "cc827fb4-40e9-4a61-bad8-d24ac0c1cc92",
    "laboratory": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1c2",
    "technician": "some text",
    "professional": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1v1",
    "comments": "some text comments",
    "teeth": "some teeth",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b",
    "sale": null
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/appointments/dentures{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/dentures{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,denture,laboratory,technician,professional,comments,teeth,appointment,sale
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "denture": "cc827fb4-40e9-4a61-bad8-d24ac0c1cc92",
    "laboratory": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1c2",
    "technician": "some text",
    "professional": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1v2",
    "comments": "some text comments",
    "teeth": "some teeth",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/appointments/dentures/{id}{?fields,force}
Full URL: https://api.aihelps.com/v1/appointments/dentures/{id}{?fields,force}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment card id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]yeslist of fields to return (separated by comma)date,denture,laboratory,technician,professional,comments,teeth,appointment,sale
forcebooleanIndicates that checking for time conflicts with another appointments, reserves and sales and validations should be skipped.true
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "denture": "cc827fb4-40e9-4a61-bad8-d24ac0c1cc92",
    "laboratory": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1c2",
    "technician": "some text",
    "professional": "cc827fb4-40e9-4a61-bad8-d24ac0c2b1v3",
    "comments": "some text comments",
    "teeth": "some teeth",
    "appointment": "cc827fb4-40e9-4a61-bad8-d24a1081c89b"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/appointments/dentures/{id}
Full URL: https://api.aihelps.com/v1/appointments/dentures/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesappointment id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response
HeaderValue
Content-Typeapplication/json

This endpoint need for take schedule professionals
Endpoints to work with employees schedule

Authorization `Database`

Authorization Database

Scope full

  • Parameter
    • from: 2019-01-01T01:01:01.000Z (datetime, required) - schedule period start
    • to: 2019-01-02T01:01:01.000Z (datetime, required) - schedule period end
    • professional: 0997d37b-49fc-4bd6-8c24-0fbcacb141a7 (identifier, optional) - get schedule only for given professional
    • location: 3635cbcf-54e0-4d23-aeb5-6ecb58abb129 (identifier, optional) - get schedule only for given location, see Locations
GET/schedule{?from,to,professional,location}
Full URL: https://api.aihelps.com/v1/schedule{?from,to,professional,location}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "columns":
    [
        {
            "professional": "dff82ed3-a2a4-46e0-b17f-53c51ed8d4bd",
            "date": "",
            "worktime":
            [
                {
                    "start": "2017-12-31T10:00:00.000Z",
                    "end": "2017-12-31T20:00:00.000Z"
                }
            ],
            "reserves": 
            [
                {
                    "id": "e27d6e58-f33a-4749-8756-4d7fd091747b",
                    "start": "2018-01-01T10:00:00.000Z",
                    "duration": 60
                },
                {
                    "id": "fc17223b-cb46-4827-ab1f-972a1d536f0e",
                    "start": "2018-01-01T10:00:00.000Z",
                    "duration": 60
                }
            ],
            "appointments":
            [
                "b0cb755a-f03d-43ff-91fd-051888bb0de1",
                "4e650711-a2b0-4eed-bf4e-29dc3cd79be4"
            ]
        }
    ],
    "appointments": 
    {
        "b0cb755a-f03d-43ff-91fd-051888bb0de1":
        {
            {
                "id": "a7251983-9e0c-463d-81a6-b7afe8a1d7d9",
                "date": "2019-01-03T12:00:00.000Z",
                "duration": 30,
                "location": "871cf34d-e490-430f-a0d5-21833230cb46",
                "client": "d8bc691e-4907-4f6f-8b9f-cefb52c7eeaa",
                "employee": null,
                "professional": "dff82ed3-a2a4-46e0-b17f-53c51ed8d4bd",
                "assistant": "dff82ed3-a2a4-46e0-b17f-53c5aef8c2b1",
                "services": 
                [
                    "af9714fe-bae4-44b2-ac45-ef5afa97f147",
                    "95310d51-89dd-4cae-9908-b65856e87392"
                ],
                "clients_module": "Desktop",
                "comments": "nice",
                "notifySms": "",
                "cancel": false,
                "cancelDate": null,
                "cancelReason": "",
                "client_notified": true,
                "createDate": "2019-01-01T00:00:00.000Z",
                "paid": false
            },
            {
                "id": "4bf92104-9fba-431c-aa13-d7f2305fdd7a",
                "date": "2019-01-03T11:00:00.000Z",
                "duration": 30,
                "location": "871cf34d-e490-430f-a0d5-21833230cb46",
                "client": "d8bc691e-4907-4f6f-8b9f-cefb52c7eeaa",
                "employee": null,
                "professional": "dff82ed3-a2a4-46e0-b17f-53c51ed8d4bd",
                "assistant": "dff82ed3-a2a4-46e0-b17f-53c5aef8c2b1",
                "services": 
                [
                    "af9714fe-bae4-44b2-ac45-ef5afa97f147",
                    "95310d51-89dd-4cae-9908-b65856e87392"
                ],
                "clients_module": "Desktop",
                "comments": "nice",
                "notifySms": "",
                "cancel": false,
                "cancelDate": null,
                "cancelReason": "",
                "client_notified": true,
                "createDate": "2019-01-01T00:00:00.000Z",
                "paid": false
            }
        }
    }
}

Also accepts `/schedule/worktime` (case-insensitive path).

Also accepts /schedule/worktime (case-insensitive path).

Returns work time ranges for professionals in given period. Response is object where keys are professional ids and values are arrays of time ranges.

Authorization: Database

Scope: full, clients_module, client_access_token, services_aggregator

GET/schedule/workTime{?from,to,professional,location}
Full URL: https://api.aihelps.com/v1/schedule/workTime{?from,to,professional,location}
Parameters
NameTypeRequiredDescriptionExample
fromdatetimeyesperiod start (date part used)2019-01-01T00:00:00.000Z
todatetimeyesperiod end (date part used)2019-01-08T00:00:00.000Z
professionalidentifierget work time only for given professional0997d37b-49fc-4bd6-8c24-0fbcacb141a7
locationidentifierlocation id (defaults to token location)3635cbcf-54e0-4d23-aeb5-6ecb58abb129
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "dff82ed3-a2a4-46e0-b17f-53c51ed8d4bd": [
        {
            "start": "2019-01-01T09:00:00.000Z",
            "end": "2019-01-01T18:00:00.000Z"
        }
    ]
}

Returns work time ranges for professionals minus time already reserved by appointments.

Returns work time ranges for professionals minus time already reserved by appointments. Response format is same as GET /schedule/workTime.

Authorization: Database

Scope: full, clients_module, client_access_token, services_aggregator

GET/schedule/freeTime{?from,to,professional,location}
Full URL: https://api.aihelps.com/v1/schedule/freeTime{?from,to,professional,location}
Parameters
NameTypeRequiredDescriptionExample
fromdatetimeyesperiod start (date part used)2019-01-01T00:00:00.000Z
todatetimeyesperiod end (date part used)2019-01-08T00:00:00.000Z
professionalidentifierget free time only for given professional0997d37b-49fc-4bd6-8c24-0fbcacb141a7
locationidentifierlocation id (defaults to token location)3635cbcf-54e0-4d23-aeb5-6ecb58abb129
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "dff82ed3-a2a4-46e0-b17f-53c51ed8d4bd": [
        {
            "start": "2019-01-01T10:30:00.000Z",
            "end": "2019-01-01T18:00:00.000Z"
        }
    ]
}

For each appointment for each professional where appointment service item exists, client can leave a feedback.

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

  • Parameter
    • fields: firstName,appointment,date,professional,professionalName,professionalPhotoExists,rating,text (array[string], required) - list of fields to return (separated by comma).
    • appointment: 32b4ac32-da44-465d-a12a-915f50d1f84f (identifier, optional) - get feedback only for given appointments (several appointments can be separated by comma)
    • professional: 80fc1a75-f859-426d-b1b3-c89f478150b3 (identifier, optional) - get feedback only for given professionals (several professionals can be separated by comma)
GET/feedbacks{?fields,appointment,professional}
Full URL: https://api.aihelps.com/v1/feedbacks{?fields,appointment,professional}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "806ab8d6-9c5a-5c3b-ba76-2279bc365dfd",
        "appointment": "32b4ac32-da44-465d-a12a-915f50d1f84f",
        "firstname": "Denis",
        "date": "2018-09-01T10:10:10Z000",
        "professional": "88d606ab-c596-353b-6676-79bc3fd265d2",
        "rating": 5,
        "text": "Good job"
    },
    {
        "id": "6860a8db-c9c5-15bb-6ca1-a3b3a57d6dc1",
        "appointment": "32b4ac32-da44-465d-a12a-915f50d1f84f",
        "firstname": "Denis",
        "date": "2018-09-01T10:10:10Z000",
        "professional": "88d606ab-c596-353b-6676-79bc3fd265d2",
        "rating": 5,
        "text": "Cool!"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

GET/feedbacks/{id}{?fields}
Full URL: https://api.aihelps.com/v1/feedbacks/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesfeedback idd608b86a-59c6-3b5c-623a-7965d2bc3fd2
fieldsarray[string]yeslist of fields to return (separated by comma).appointment,firstName,date,professional,professionalName,professionalPhotoExists,rating,text
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "d608b86a-59c6-3b5c-623a-7965d2bc3fd2",
    "appointment": "32b4ac32-da44-465d-a12a-915f50d1f84f",
    "firstname": "Denis",
    "date": "2018-09-01T10:10:10Z000",
    "professional": "88d606ab-c596-353b-6676-79bc3fd265d2",
    "rating": 100,
    "text": "Good job"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/feedbacks
Full URL: https://api.aihelps.com/v1/feedbacks
POSTRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
Body
{
    "firstname": "Denis",
    "appointment": "32b4ac32-da44-465d-a12a-915f50d1f84f",
    "date": "2018-09-01T10:10:10Z000",
    "professional": "88d606ab-c596-353b-6676-79bc3fd265d2",
    "rating": 5,
    "text": "Nice work"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

PUT/feedbacks/{id}
Full URL: https://api.aihelps.com/v1/feedbacks/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid feedbackdd9114c8-439c-40a9-a784-04885f7fedab
PUTRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
Body
{
    "firstname": "Denis",
    "date": "2018-09-01T10:10:10Z000",
    "professional": "88d606ab-c596-353b-6676-79bc3fd265d2",
    "rating": 5,
    "text": "Nice work"
}
204Response

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, client_access_token (but client field should match client id), reports

DELETE/feedbacks/{id}
Full URL: https://api.aihelps.com/v1/feedbacks/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesfeedback iddd9114c8-439c-40a9-a784-04885f7fedab
DELETERequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
204Response


Halls where services or group lessons are provided.

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/halls{?fields,name,location}
Full URL: https://api.aihelps.com/v1/halls{?fields,name,location}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,color,location,zone,daily_pay,hourly_pay
nameseveral hall can be separated by comma
locationseveral hall can be separated by comma
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
        "name": "massage room",
        "location": "d32bfd16-2d63-4937-acfe-fada1a064fe9",
        "zone": null,
        "daily_pay": 1000,
        "hourly_pay": 100
    },
    {
        "id": "ddc757ab-3656-489b-b414-c8f872c967fe",
        "name": "gym room",
        "location": "d32bfd16-2d63-4937-acfe-fada1a064fe9",
        "zone": null,
        "daily_pay": 1000,
        "hourly_pay": 100
    }
]

Authorization: `Database`

Authorization: Database

Scope: full,clients_module,reports

GET/halls/{id}{?fields}
Full URL: https://api.aihelps.com/v1/halls/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of hallc9edc51c-a95a-4f9c-84fd-67022b957d79
fieldsarray[string]yeslist of fields to return (separated by comma).name,color,location,zone,daily_pay,hourly_pay
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "c9edc51c-a95a-4f9c-84fd-67022b957d79",
    "name": "solarium room",
    "location": "c9edc51c-a95a-4f9c-84fd-67022b957d32"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/halls{?fields}
Full URL: https://api.aihelps.com/v1/halls{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,color,location,zone,daily_pay,hourly_pay
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "solarium room",
    "location": "c9edc51c-a95a-4f9c-84fd-67022b957d32",
    "daily_pay": 500,
    "hourly_pay": 100
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "bd98b869-2e5c-4e0d-be16-ce715a35c742"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/halls/{id}{?fields}
Full URL: https://api.aihelps.com/v1/halls/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of hallbd98b869-2e5c-4e0d-be16-ce715a35c742
fieldsarray[string]list of fields to return (separated by comma)name,color,location,zone,daily_pay,hourly_pay
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "gym room"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/halls/{id}
Full URL: https://api.aihelps.com/v1/halls/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of hallbd98b869-2e5c-4e0d-be16-ce715a35c742
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Sales

This section provides information about sold items and closed tickets


This section provides information about accounts. Account is place where money is kept. Each account has it's name and money sum currently stored. Examples of accounts: cashdesk, bank account, safe (do not includes client deposits or company deposits).

Authorization: `Database`

Authorization: Database

Scope: full, online_store, reports

  • Parameter
    • fields: name,location,type,sum,archive (array[string], required) - list of fields to return (separated by comma).
GET/accounts{?fields}
Full URL: https://api.aihelps.com/v1/accounts{?fields}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d4d8bf-a9f1-8063-7bfe-b80f2d3d9b58",
        "name": "Cash",
        "location": "88d4542a-bb12-03b1-3c0b-41fa26f1aaf1",
        "type": "cashdesk",
        "sum": 1000,
        "archive": false
    },
    {
        "id": "88d4d8bf-a9f4-8da3-7bfe-b80f437c45a6",
        "name": "Account in JPMorgan",
        "location": "88d4542a-bb12-03b1-3c0b-41fa26f1aaf1",
        "type": "bank",
        "sum": 2000,
        "archive": false
    },
    {
        "id": "88d4d8bf-a9f4-8da3-7bfe-b80f437c45a6",
        "name": "Account in Citygroup",
        "location": "88d4542a-bb12-03b1-3c0b-41fa26f1aaf1",
        "type": "bank",
        "sum": 500,
        "archive": false
    }
]

Authorization: `Database`

Authorization: Database

Scope: full, online_store, reports

GET/accounts/{id}{?fields}
Full URL: https://api.aihelps.com/v1/accounts/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesaccount iddd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]yeslist of fields to return (separated by comma).name,location,type,sum,archive
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d4d8bf-a9f4-8da3-7bfe-b80f437c45a6",
    "name": "Account in JPMorgan",
    "location": "88d4542a-bb12-03b1-3c0b-41fa26f1aaf1",
    "type": "bank",
    "sum": 2000,
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/accounts{?fields}
Full URL: https://api.aihelps.com/v1/accounts{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)name,location,type,sum,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "Owner's safe",
    "type": "other",
    "location": "88d4542a-bb12-03b1-3c0b-41fa26f1aaf1"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "3ab52942-da15-4a20-b14c-b8fca7e4bf1a"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/accounts/{id}{?fields}
Full URL: https://api.aihelps.com/v1/accounts/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesaccount id5c05c7a4-74da-42e5-ac5d-dbc489748143
fieldsarray[string]list of fields to return (separated by comma)name,location,type,sum,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "type": "bank"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/accounts/{id}
Full URL: https://api.aihelps.com/v1/accounts/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesaccount id432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Sales are subject to the 2-month data history limit.

Authorization: `Database`

Authorization: Database

Scope: full, reports

  • Parameter
    • fields: sale_date,calendar_date,duration,location,location2,type,name,client,professional,sum,quantity,product_quantity_type,product_id,receptionist,item_id,deposit_sum,deposit_client,discount_sum,discount_reason,client_card,client_card_discount,recommended,appointment,cancel,cancel_reason,cancel_date,products (array[string], required) - list of fields to return (separated by comma).
    • sale_date_from: 2018-09-16T21:02:00.000Z (datetime, optional) - get only sales which was made at sale_date_from or later
    • sale_date_to: 2018-09-16T21:02:00.000Z (datetime, optional) - get only sales which was made before sale_date_from
    • calendar_date_from: 2018-09-16T21:02:00.000Z (datetime, optional) - get only sales which was scheduled to time sale_date_from or later
    • calendar_date_to: 2018-09-16T21:02:00.000Z (datetime, optional) - get only sales which was scheduled to time earlier than sale_date_from
    • client: 88d4b305-e198-f02c-2743-cca9390c6d9b (array[identifier], optional) - get only sales for given client (several clients can be separated by comma)
    • professional: 88d4b305-e198-f02c-2743-cca9390c6d91 (array[identifier], optional) - get only sales for given professional (several professionals can be separated by comma)
    • location: 0be9ab15-2569-47e1-96e3-ae3211a7a7ec (array[identifier], optional) - get only sales from given location (several locations can be separated by comma)
    • type: Service (enum) - get only sales from given type (several types can be separated by comma)
GET/sales{?fields,sale_date_from,sale_date_to,calendar_date_from,calendar_date_to,client,professional,location,type}
Full URL: https://api.aihelps.com/v1/sales{?fields,sale_date_from,sale_date_to,calendar_date_from,calendar_date_to,client,professional,location,type}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d61289-34c6-0b1e-3b5f-838036bfebfd",
    "sale_date": "2018-09-04T20:09:42.000Z",
    "calendar_date": "2018-09-04T21:00:00.000Z",
    "duration": 60,
    "location": "88d60c1b-f953-b89b-0312-ba0502b8bc35",
    "location2": null,
    "name": "Personal training 3 category",
    "type": "service",
    "product_id": "88d60c1b-f953-b89b-0312-ba0502b82c31",
    "client": "88d60d95-adf7-1cb4-5016-ff2d57b87fce",
    "professional": "88d606ab-c596-48d2-6676-79bc63a6e813",
    "professional_name": "John Doe",
    "professional_photo_exists": true,
    "sum": 500,
    "quantity": 2,
    "product_quantity_type": "units",
    "receptionist": null,
    "item_id": null,
    "deposit_sum": 0,
    "deposit_client": "88d60c1b-f953-b89b-0312-ba0502bfcb22",
    "discount_sum": 100,
    "discount_reason": "birthday",
    "client_card": null,
    "client_card_discount": null,
    "recommended": null,
    "appointment": "88d61289-34c6-0b1e-3b5f-a3f0bc1ce321",
    "cancel": false,
    "cancel_reason": "",
    "cancel_date": null,
    "payments": [],
    "products":
    [
        {
            "product": "983eb289-1e66-413c-8052-7cbcc3e806bc",
            "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
            "quantity": 1,
            "sum": 1200
        },
        {
            "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
            "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
            "quantity": 1,
            "sum": 300
        }
    ]
},
{
    "id": "88d61289-70a2-19e0-3b5f-83800e4e4512",
    "sale_date": "2018-09-04T20:11:22.000Z",
    "calendar_date": "2018-09-04T21:00:00.000Z",
    "duration": 120,
    "location": "88d60c1b-f953-b89b-0312-ba0502b8bc35",
    "location2": null,
    "name": "Personal training 2 category",
    "type": "service",
    "product_id": "88d60c1b-f953-b89b-0312-ba0502b82c31",
    "client": "88d60d95-adf0-3eaa-5016-ff2d41c8a8c7",
    "professional": "88d606ab-c596-353b-6676-79bc3fd265d2",
    "professional_name": "John Doe",
    "professional_photo_exists": true,
    "sum": 1000,
    "quantity": 1,
    "product_quantity_type": "portion",
    "receptionist": "88d60c1b-f953-b89b-0312-ba0c02ba2cf2",
    "item_id": null,
    "deposit_sum": 0,
    "deposit_client": "88d60c1b-f953-b89b-0312-ba0502bfcb22",
    "discount_sum": 100,
    "discount_reason": "birthday",
    "client_card": "88d60c1b-f953-b89b-0312-ba1c12bfcbcf",
    "client_card_discount": "88d60c1b-fee3-b8fb-0d12-cab542b2c1cb",
    "recommended": null,
    "appointment": "88d61289-34c6-0b1e-3b5f-a3f0bc1ce322",
    "cancel": true,
    "cancel_reason": "client didn't come",
    "cancel_date": "2018-09-04T20:11:22.000Z",
    "payments": [
        {
            "account": "88d60c1b-fee3-b8fb-0d12-cab54abbcfc1",
            "sum": 200
        }
    ],
    "products":
    [
    ]
}

Authorization: `Database`, `Client`

Authorization: Database, Client

Scope: full, clients_module, client_access_token (but client field should match client id), reports

GET/sales/{id}{?fields}
Full URL: https://api.aihelps.com/v1/sales/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid saledd9114c8-439c-40a9-a784-04885f7fedab
fieldsarray[string]yeslist of fields to return (separated by comma).sale_date,calendar_date,duration,location,location2,type,name,client,professional,sum,quantity,product_quantity_type,product_id,receptionist,item_id,deposit_sum,deposit_client,discount_sum,discount_reason,client_card,client_card_discount,recommended,appointment,cancel,cancel_reason,cancel_date,products
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d61289-34c6-0b1e-3b5f-838036bfebfd",
    "sale_date": "2018-09-04T20:09:42.000Z",
    "calendar_date": "2018-09-04T21:00:00.000Z",
    "duration": 60,
    "location": "88d60c1b-f953-b89b-0312-ba0502b8bc35",
    "location2": null,
    "name": "Personal training 3 category",
    "type": "service",
    "product_id": "88d60c1b-f953-b89b-0312-ba0502b82c31",
    "client": "88d60d95-adf7-1cb4-5016-ff2d57b87fce",
    "professional": "88d606ab-c596-48d2-6676-79bc63a6e813",
    "professional_name": "John Doe",
    "professional_photo_exists": true,
    "sum": 500,
    "quantity": 1,
    "product_quantity_type": "units",
    "receptionist": "88d60c1b-f953-b89b-0312-ba0c02ba2cf2",
    "item_id": null,
    "deposit_sum": 0,
    "deposit_client": "88d60c1b-f953-b89b-0312-ba0502bfcb22",
    "discount_sum": 100,
    "discount_reason": "birthday",
    "client_card": "88d60c1b-f953-b89b-0312-ba1c12bfcbcf",
    "client_card_discount": "88d60c1b-fee3-b8fb-0d12-cab542b2c1cb",
    "recommended": null,
    "appointment": "88d61289-34c6-0b1e-3b5f-a3f0bc1ce322",
    "cancel": false,
    "cancelReason": "",
    "cancelDate": null,
    "payments": [
        {
            "account": "88d60c1b-fee3-b8fb-0d12-cab54abbcfc1",
            "sum": 200
        },
        {
            "account": "88d60c1b-61c3-b8fb-0f12-cfb54abb8fc2",
            "sum": 300
        }
    ],
    "products": [
        {
            "product": "983eb289-1e66-413c-8052-7cbcc3e806bc",
            "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
            "quantity": 1,
            "sum": 1200
        },
        {
            "product": "adfb426a-f467-4f20-8af7-b723c9cb0ed0",
            "storage": "41678090-9109-4750-aa38-6e3444f55fa0",
            "quantity": 1,
            "sum": 300
        }
    ]
}

Program supports sale cancellation. Here they are.

This method verifies if provided sales can be cancelled and returns list of sales that can't be cancelled with localized reason messages.

This method verifies if provided sales can be cancelled and returns list of sales that can't be cancelled with localized reason messages.

Authorization: Database

Scope: full

POST/sales:canCancel
Full URL: https://api.aihelps.com/v1/sales:canCancel
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "sales": [
        "ae9134c8-439c-40a9-a784-04885275caa1",
        "dd439cc8-9114-aa79-8404-04feda885f7b",
        "50e07101-6a5d-458e-af39-0e7b6b204014"
    ]
}
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "sale": "ae9134c8-439c-40a9-a784-04885275caa1",
        "message": "This card can't be canceled, had related sales",
        "relatedSales":
        [
          "ae9134c8-439c-40a9-a784-04885275caa1",
          "dd439cc8-9114-aa79-8404-04feda885f7b",
          "50e07101-6a5d-458e-af39-0e7b6b204014"
        ]
    },
    {
        "sale": "ae9134c8-439c-40a9-a784-04885275caa1",
        "message": "This card can't be canceled",
    }
]

If prepayment was payed via some payment processor, refund for such payment can be done via this endpoint.

If prepayment was payed via some payment processor, refund for such payment can be done via this endpoint. Only full refund is supported (not partial one). New sale object will be created with type 'onlineRefund' and money will be returned to client card via payment processor. Please keep in mind that too many refunds can lower your merchant rating and can be a reason to suspend your merchant account.
Refund can also be initiated from client bank or payment processor side.

On refund, system will try to cancel all prepayments done with original payment. If some prepaid service was paid, prepayment will not be cancelled. In such case and in case prepayment already cancelled, corresponding refunded sum will be subtracted from client deposit.

Method fails if refund already done.

Authorization: Database

Scope: full

POST/sales:refund
Full URL: https://api.aihelps.com/v1/sales:refund
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "order": "dd439cc8-9114-aa79-8404-04feda885f7b",
    "reason": "Service temporary not be provided"
}
204Response

Cancel provided list of sales.

Cancel provided list of sales.
If some sales can't be cancelled, returns 409 Conflict error with same result as /sales:canCancel method

Authorization: Database

Scope: full

POST/sales:cancel
Full URL: https://api.aihelps.com/v1/sales:cancel
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "cancelReason": "office error" 
    "sales":
    [
        "ae9134c8-439c-40a9-a784-04885275caa1",
        "dd439cc8-9114-aa79-8404-04feda885f7b",
        "50e07101-6a5d-458e-af39-0e7b6b204014"
    ]
}
204Response

Promotions allows to give discount to client based on set of rules.

Get information about all promotions.

Get information about all promotions.

Authorization: Database

Scope: full

GET/promotions{?fields,archive}
Full URL: https://api.aihelps.com/v1/promotions{?fields,archive}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,category,discount,sum,unlimitedTime,condition,description,descriptionOnReceipt,discountType,startDate,expireDate,archive
archivebooleanget only archived or non archived promotionsfalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d6248d-e5e8-9c40-5296-bb10043eab27",
        "name": "New Year Promotion",
        "category": "5382f467-a034-440c-bc7f-3dac932f8b99",
        "discount": 10,
        "sum": 50,
        "unlimitedTime": true,
        "condition": "Promotion condition",
        "description": "Description",
        "descriptionOnReceipt": false,
        "discountType": "Percent",
        "startDate": "2017-01-01T13:51:55.000Z",
        "expireDate": "",
        "archive": false
    }
]

Get information about promotion with specified id.

Get information about promotion with specified id.

Authorization: Database

Scope: full

GET/promotions/{id}{?fields}
Full URL: https://api.aihelps.com/v1/promotions/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).name,category,discount,sum,unlimitedTime,condition,description,descriptionOnReceipt,discountType,startDate,expireDate,archive
ididentifieryespromotion id to get information for.9c4068e2-c81f-4d70-ad31-8f627ed9bced
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d6248d-e5e8-9c40-5296-bb10043eab27",
    "name": "New Year Promotion",
    "category": "5382f467-a034-440c-bc7f-3dac932f8b99",
    "discount": 10,
    "sum": 50,
    "unlimitedTime": true,
    "condition": "Promotion condition",
    "description": "Description",
    "descriptionOnReceipt": false,
    "discountType": "Percent",
    "startDate": "2017-01-01T13:51:55.000Z",
    "expireDate": "",
    "archive": false
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/promotions{?fields}
Full URL: https://api.aihelps.com/v1/promotions{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma).name,category,discount,sum,unlimitedTime,condition,description,descriptionOnReceipt,discountType,startDate,expireDate,archive
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "name": "New Year Promotion",
    "category": "5382f467-a034-440c-bc7f-3dac932f8b99",
    "discount": 10,
    "sum": 50,
    "unlimitedTime": false,
    "condition": "Promotion condition",
    "description": "Description",
    "descriptionOnReceipt": false,
    "discountType": "Percent",
    "startDate": "2017-01-01T13:51:55.000Z",
    "expireDate": "2018-01-01T13:51:55.000Z",
    "archive": false
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/promotions/{id}{?fields}
Full URL: https://api.aihelps.com/v1/promotions/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of promotion to update.be0b6712-e680-42a7-8b99-b6b2d9fcb1fe
fieldsarray[string]list of fields to return (separated by comma).name,category,discount,sum,unlimitedTime,condition,description,descriptionOnReceipt,discountType,startDate,expireDate,archive
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "unlimitedTime": true,
    "startDate": "2019-01-01T13:51:55.000Z",
    "expireDate": ""
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/promotions/{id}
Full URL: https://api.aihelps.com/v1/promotions/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of promotion to delete.cc903b03-ecaf-46d4-a030-bbfd1882f490
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Internal methods for recommendation system

Authorization: `Database`

Authorization: Database

Scope: full

POST/sales/crosssale/report_success
Full URL: https://api.aihelps.com/v1/sales/crosssale/report_success
POSTRequest
HeaderValue
AuthorizationBearer 9a068ce2-4dcf-7d30-a811-8f62ced7ed9b
Body
{
    "sex": "Male",
    "selected_product": "9c4068e2-c81f-4d70-ad31-8f627ed9bced",
    "proposed_product": "8f627e91-a23a-dc48-15b3-c40bce68e2d9",
    "success": true
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "79dbd056-7f23-4e87-892f-c45e1976e694"
}

Represents crosssale recommendation details.

Authorization `Database`

Authorization Database

Scope full

  • Parameter
    • current_items: e1f6c0b0-afc3-419e-74e2-43a1c7663654, daf6c0f0-6903-4c9e-a0e2-4381676c3641 (array[identifier], required) - get only this items, (separated by comma)
    • client: eac6c2b0-afc3-ab9e-cbe2-13a1c7663651 (identifier, required) - id client
    • sex: Male (enum[string], optional) - client sex, can be empty
      • Default: Male
      • Members
        • Male
        • Female
    • number: 10 (number) - range from 1 to 100
      • Default 4
    • proposed_product_type: services (enum[string], optional) - get only items with this type
      • Default: all
        • Members
          • services
          • products
          • all
GET/sales/crosssale/recommendations{?current_items,client,sex,number,proposed_product_type}
Full URL: https://api.aihelps.com/v1/sales/crosssale/recommendations{?current_items,client,sex,number,proposed_product_type}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "selected_product": "9c4068e2-c81f-4d70-ad31-8f627ed9bced",
        "proposed_product": "8f627e91-a23a-dc48-15b3-c40bce68e2d9",
        "certainty": 0.1
    },
    {
        "selected_product": "1c3c6be2-c81f-4d70-ad31-8f627ed9bced",
        "proposed_product": "25637ea1-a23a-dc48-15b3-c40bce68e2d9",
        "certainty": 0.2
    }
]

Callbacks

Represents callback details

Authorization: `Database`

Authorization: Database

Scope: full

GET/callbacks{?fields}
Full URL: https://api.aihelps.com/v1/callbacks{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma)date,phone
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "dfb93597-7e01-4d5e-b563-208625ca7f51",
        "date": "2019-01-01T00:00:00.000Z",
        "phone": "+380 (00) 555 55 55"
    },
    {
        "id": "a6c7571a-038e-4d15-a733-29928b0195c1",
        "date": "2019-01-02T00:00:00.000Z",
        "phone": "+380 (00) 556 56 56"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

GET/callbacks/{id}{?fields}
Full URL: https://api.aihelps.com/v1/callbacks/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid callback79fa7afb-c567-4a6a-a4b7-3186190c728d
fieldsarray[string]yeslist of fields to return (separated by comma)date,phone
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "dfb93597-7e01-4d5e-b563-208625ca7f51",
    "date": "2019-01-01T00:00:00.000Z",
    "phone": "+380 (00) 555 55 55"
}

Authorization: `Database`

Authorization: Database

Scope: full, clients_module

POST/callbacks{?fields}
Full URL: https://api.aihelps.com/v1/callbacks{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma)date,phone
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2019-01-01T00:00:00.000Z",
    "phone": "+380 (00) 655 65 65"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "475a20e9-23ef-40ce-b2c4-c7dbcf230ebb"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/callbacks/{id}{?fields}
Full URL: https://api.aihelps.com/v1/callbacks/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid callbacks79fa7afb-c567-4a6a-a4b7-3186190c728d
fieldsarray[string]list of fields to return (separated by comma)date,phone
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "date": "2019-01-01T00:00:00.000Z",
    "phone": "+380 (00) 555 55 55"
}
204Response
HeaderValue
Content-Typeapplication/json

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/callbacks/{id}
Full URL: https://api.aihelps.com/v1/callbacks/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of callback432c41bf-0cd7-4f13-83dd-a0c26ce29143
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Messaging

Describes text (sms) and e-mail single messages and campaigns.

Clients can receive text messages (smses). This section helps to get information about sent messages.

Authorization `Database`

Authorization Database

Scope full, client_access_token (only with filter client and id must match token owner)

  • Parameter
    • fields: date,client,text,appointment_notification (array[string], required) - list of fields to return (separated by comma).
    • client: fc3c5f2c-3dee-4b63-b555-1912482b3b69 (identifier, optional) - get only smses for given client (several clients can be separated by comma)
    • appointment_notification: true (boolean, optional) - get only appointment notification smses (if true) or others (if false)
GET/smses{?fields,client,appointment_notification}
Full URL: https://api.aihelps.com/v1/smses{?fields,client,appointment_notification}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "f6c0daf0-6903-4c9e-a0e2-4381676dc364",
        "date": "2018-03-01T00:00:00.000Z",
        "client": "77a61323-b591-4490-9e88-3b5f30695b25",
        "text": "Hello!",
        "appointment_notification": true
    }
]

Authorization `Database`

Authorization Database

Scope full, client_access_token (only with filter client and id must match token owner)

  • Parameter
    • id: f6c0daf0-6903-4c9e-a0e2-4381676dc364 (identifier, required) - id of sms
    • fields: date,client,text,appointment_notification (array[string], required) - list of fields to return (separated by comma).
GET/smses/{id}{?fields}
Full URL: https://api.aihelps.com/v1/smses/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "f6c0daf0-6903-4c9e-a0e2-4381676dc364",
    "date": "2018-03-01T00:00:00.000Z",
    "client": "77a61323-b591-4490-9e88-3b5f30695b25",
    "text": "Hello!",
    "appointment_notification": true
}

Settings

This section describes common settings for database, location settings, hardware settings and user preferences and some other.
At current stage hardware settings not implemented.

Settings, common for whole database (several locations). Like country, default language, currency, etc.
These settings describes the way program should look and behave. They are usually set up at program first use and rarely changed in future.
All settings are identified by name, they belongs to predefined list shown below. You can't set any setting not in list,
only change settings from predefined list.
All settings are grouped in sections.

Get settings.

Get settings. You must provide all settings you want to receive in fields parameter (not only sections, but all settings you needed).

Authorization: Database

Scope: clients_module (only common section), full

GET/settings{?fields}
Full URL: https://api.aihelps.com/v1/settings{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yessettings to getcommon(type,country,currency,client_feedback_ratings),information(description,web_site,instagram,facebook,viber,telegram),client_module(name,enabled,several_services,can_cancel_in_48_hours,services_gender_filter,nearest_booking_minutes,time_step,calendar,color,theme,language,supported_languages,button_text,button_color,element_id)
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "common":
    {
        "type": "beauty",
        "country": "USA",
        "currency": "USD",
        "licenseType": "Ultimate",
        "isDemo": false,
        "databaseStatus": "Active_Work",
        "client_feedback_ratings":
        {
            "3f69b533-8288-4847-a7f0-ab4d71e598f6": {
                "names": {
                    "en": "Service quality",
                    "fr": "Qualité de service",
                }
            },
            "6c9a8313-72b0-4087-9968-00a293ec6152": {
                "names": {
                    "en": "Interior",
                    "fr": "Intérieur",
                }
            }
        }                    
    },
    "information":
    {
        "description":
        {
            "en": "Some description <span style='color: #FF0000;'>with color</span>",
            "fr": "Quelques description <span style='color: #FF0000;'>avec couleur</span>"
        },
        "web_site": "salon123.com",
        "instagram": "instagram.com/salon123",
        "facebook": "facebook.com/salon123.com",
        "viber": "+1 800 555 0123",
        "telegram": "t.me/salon123.com"
    },
    "client_module":
    {
        "name": "beautysalon",
        "enabled": true,
        "several_services": true,
        "can_cancel_in_48_hours": true,
        "services_gender_filter": "both",
        "nearest_booking_minutes": 0,
        "time_step": "auto",
        "calendar": "week",
        "color": "#000000",
        "theme": "soft",
        "language": null,
        "supported_languages":
        [
            "en",
            "fr"
        ],
        "minimize_gaps_mode": "maximal",
        "minimize_gaps_position":
        [
            "day_start",
            "before_appointment",
            "after_appointment"
        ],
        "confirm_services": false,
        "button_text": "online record",
        "button_color": "#6f3bf5",
        "element_id": "element",
        "services_from_filter": "all"
    }
}

Get settings picture by setting section and name.

Get settings picture by setting section and name.

Authorization: Database

Scope: clients_module (only common section), full

GET/settings/{section}/{setting}{?width,height,resize,access_token}
Full URL: https://api.aihelps.com/v1/settings/{section}/{setting}{?width,height,resize,access_token}
Parameters
NameTypeRequiredDescriptionExample
sectionstringyessection name to get picturecommon
settingstringyessetting name to get picturelogo
widthnumberimage width needed100
heightnumberimage height needed100
resizeenum[string]type of resize for imagefit
access_tokenstringtoken used for API requests9c4068e2-c81f-4d70-ad31-8f627ed9bced
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response

In some cases settings should be updated.

In some cases settings should be updated. This can be done specifing settings new values.
Not all values can be changed. List of values that can be changed will be added later.

Authorization: Database

Scope: full

PUT/settings
Full URL: https://api.aihelps.com/v1/settings
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "common": {
        "country": "USA",
        "currency": "USD"
    }
}
204Response

Set settings picture by setting section and name.

Set settings picture by setting section and name.

If additional header Test is set, input values are validating, but not saved.

Authorization: Database

Scope: full

PUT/settings/{section}/{setting}
Full URL: https://api.aihelps.com/v1/settings/{section}/{setting}
Parameters
NameTypeRequiredDescriptionExample
sectionstringyessection name to set picturecommon
settingstringyessetting name to set pictureLogo
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Testtrue
204Response

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • fields: weekday,start,end (array[string], required) - list of fields to return (separated by comma).
GET/requiredPrepaymentWeekdays{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentWeekdays{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
        "weekday": "sunday",
        "start": "00:00",
        "end": "24:00"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • id: f6c0daf0-6903-4c9e-a0e2-4381676dc364 (identifier, required) - required prepayment day id
    • fields: weekday,start,end (array[string], required) - list of fields to return (separated by comma).
GET/requiredPrepaymentWeekdays/{id}{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentWeekdays/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
    "weekday": "sunday",
    "start": "00:00",
    "end": "24:00"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/requiredPrepaymentWeekdays{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentWeekdays{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).weekday,start,end
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
    "weekday": "sunday",
    "start": "00:00",
    "end": "24:00"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/requiredPrepaymentWeekdays/{id}{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentWeekdays/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentiferyesrequired prepayment day idf6c0daf0-6903-4c9e-a0e2-4381676dc364
fieldsarray[string]yeslist of fields to return (separated by comma).weekday,start,end
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "start": "12:00"
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/requiredPrepaymentWeekdays/{id}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentWeekdays/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentiferyesrequired prepayment day idf6c0daf0-6903-4c9e-a0e2-4381676dc364
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • fields: date,start,end,employee (array[string], required) - list of fields to return (separated by comma).
    • from: 2019-01-01T00:00:00.000Z (datetime, required) - start date to get required prepayment days
    • to: 2019-01-03T00:00:00.000Z (datetime, required) - end date to get required prepayment days
GET/requiredPrepaymentDays{?fields,from,to}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentDays{?fields,from,to}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
        "date": "2019-02-15T00:00:00.000Z",
        "start": "00:00",
        "end": "24:00",
        "employee": "88d61182-23fc-c6c9-03da-4259788d120a"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

  • Parameter
    • id: f6c0daf0-6903-4c9e-a0e2-4381676dc364 (identifier, required) - required prepayment day id
    • fields: date,start,end,employee (array[string], required) - list of fields to return (separated by comma).
GET/requiredPrepaymentDays/{id}{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentDays/{id}{?fields}
GETRequest
HeaderValue
AuthorizationBearer 751392d5-a113-44e4-bb30-0d9e190b2f4c
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
    "date": "2019-02-15T00:00:00.000Z",
    "start": "00:00",
    "end": "24:00",
    "employee": "88d61182-23fc-c6c9-03da-4259788d120a"
}

Authorization: `Database`

Authorization: Database

Scope: full

POST/requiredPrepaymentDays{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentDays{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]yeslist of fields to return (separated by comma).date,start,end,employee
POSTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "id": "88d60d95-aa05-283f-5016-ff2d5d4dc20a",
    "date": "2019-02-15T00:00:00.000Z",
    "start": "00:00",
    "end": "24:00",
    "employee": "88d61182-23fc-c6c9-03da-4259788d120a"
}
201Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "cc903b03-ecaf-46d4-a030-bbfd1882f490"
}

Authorization: `Database`

Authorization: Database

Scope: full

PUT/requiredPrepaymentDays/{id}{?fields}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentDays/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentiferyesrequired prepayment day idf6c0daf0-6903-4c9e-a0e2-4381676dc364
fieldsarray[string]yeslist of fields to return (separated by comma).date,start,end,employee
PUTRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
Body
{
    "employee": null
}
204Response

Authorization: `Database`

Authorization: Database

Scope: full

DELETE/requiredPrepaymentDays/{id}
Full URL: https://api.aihelps.com/v1/requiredPrepaymentDays/{id}
Parameters
NameTypeRequiredDescriptionExample
ididentiferyesrequired prepayment day idf6c0daf0-6903-4c9e-a0e2-4381676dc364
DELETERequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
204Response

Additional materials

AI Helps provides some materials to make clients life easier: e-mail templates, sms templates, default services list etc. Application can access and use these
materials as "predefined".
These materials are common for all databases. API allows to get materials but not to change them.

E-mail templates that can be used by clients to make e-mail campaigns or sending single messages.
Please mention that content field contains big HTML pages, so good strategy will be to load all templates without content field and then
load needed template content by id.

Authorization: `Database`

Authorization: Database

Scope: full

GET/materials/email_templates{?fields,program,language}
Full URL: https://api.aihelps.com/v1/materials/email_templates{?fields,program,language}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma).name,program,language
programarray[enum[string]]Filter only templates for specific program(s).Beauty
languagearray[string]Filter only templates on specific language code(s) (ISO 639-1).en
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "24187db7-05e1-40d2-bd1f-f3ddbb2517b8",
        "name": "Simple template",
        "program": "Beauty",
        "language": "en",
        "content": "This is <b>simple</b> template",
        "category": null,
        "category_name": ""
    },
    {
        "id": "60dc068b-5660-4f1a-bc6a-8fc1be253b85",
        "name": "Modèle simple",
        "program": "Beauty",
        "language": "fr",
        "content": "C'est un modèle <b>simple</b>",
        "category": "f7ddfdfd-51ba-475a-923c-bd615545543d",
        "category_name": "French version"
    }
]

Authorization: `Database`

Authorization: Database

Scope: full

GET/materials/email_templates/{id}{?fields}
Full URL: https://api.aihelps.com/v1/materials/email_templates/{id}{?fields}
Parameters
NameTypeRequiredDescriptionExample
ididentifieryesid of client24187db7-05e1-40d2-bd1f-f3ddbb2517b8
fieldsarray[string]list of fields to return (separated by comma).name,program,language
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "id": "24187db7-05e1-40d2-bd1f-f3ddbb2517b8",
    "name": "Simple template",
    "program": "Beauty",
    "language": "en",
    "content": "This is <b>simple</b> template",
    "category": null,
    "category_name": ""
}

Editing e-mail template requires callback from an editable web-page.

Editing e-mail template requires callback from an editable web-page. Using this request, web-page will send changes to the application, that awaits changes.

Authorization: none

POST/materials/email_templates/save_template/{code}
Full URL: https://api.aihelps.com/v1/materials/email_templates/save_template/{code}
Parameters
NameTypeRequiredDescriptionExample
codeidentifieryesone-time e-mail template identifier, generated by the application24187db7-05e1-40d2-bd1f-f3ddbb2517b8
POSTRequest
Body
`base64 encoded json object with changes`
204Response

Editing e-mail template provides possibility to change images.

Editing e-mail template provides possibility to change images. To make this images available for everyone, we need to save them.
Furthermore, we need to save this images in such a way, so anyone from any part of the world could load them as fast as possible.

Saving image will use AIHelps CDN infrastructure to make images more accessible.

To save the image, use one of the method, described in the Update image section

Response will contain an url, which will substitute existing image inside the template.

Authorization: Database

POST/materials/email_templates/save_image
Full URL: https://api.aihelps.com/v1/materials/email_templates/save_image
POSTRequest
Body
https://image.url.example.com/background.jpg
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "url": "https://cdn.aihelps.com/emails/ZjLG93ZWlq.jpg"
}

Reports

Retrieving structured reports about sales, appointments, etc.

Overall summary for a specific location for certain period of time. Contains general information about new clients, sales, appointments etc.
In most dashboard reports you provide report period and numbers for previous period returned for comparison.
Dashboard report data is subject to the 2-month data history limit.

Returns accounts with non-zero balance, available for provided employee (only accounts provided employee can view balance).

Returns accounts with non-zero balance, available for provided employee (only accounts provided employee can view balance).

Authorization: Database

Scope: full, reports

GET/reports/dashboard/accounts{?location,employee}
Full URL: https://api.aihelps.com/v1/reports/dashboard/accounts{?location,employee}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
employeeidentifieryesemployee, for whom account balances should be shown514441ad-ebb4-4da5-80be-745f3bda7173
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "id": "Cash",
        "sum": 67893.5
    },
    {
        "id": "Bank",
        "sum": 57872,4
    }
]

Returns income and losses for certain period of time and previous period.

Returns income and losses for certain period of time and previous period.

Authorization: Database

Scope: full, reports

GET/reports/dashboard/incomeLosses{?location,start,end,employee}
Full URL: https://api.aihelps.com/v1/reports/dashboard/incomeLosses{?location,start,end,employee}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
employeeidentifieryesid of an employee, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "income": 8240,3,
    "losses": -6112,43,
    "previousIncome": 7925.94,
    "previousLosses": -6278.2
}

Get information about future appointments:

Get information about future appointments:

  1. Number of non-cancelled appointments in certain period
  2. Sum of non-cancelled appointments in certain period
  3. Workload (percent of busy time) for each day in certain period - calculates as total busy time for all professionals divided by total work time for all professionals. Null if no one works in specific day

Authorization: Database

Scope: full, reports

GET/reports/dashboard/futureAppointments{?location,start,end}
Full URL: https://api.aihelps.com/v1/reports/dashboard/futureAppointments{?location,start,end}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "appointments": 57,
    "appointmentsSum": 49,
    "workload": [
        0.57,
        1,
        0.89,
        0.78,
        0.63,
        0.84,
        null
    ]
}

Returns visits (appointments) statistics:

Returns visits (appointments) statistics:

  1. count - number of appointments for certain period
  2. previousCount - number of appointments for previous period
  3. payedCount - number of appointments for certain period where at least one item is payed
  4. payedCountAmount - some of all payed items

Authorization: Database

Scope: full, reports

GET/reports/dashboard/appointments{?location,start,end,onlyOnlineModule}
Full URL: https://api.aihelps.com/v1/reports/dashboard/appointments{?location,start,end,onlyOnlineModule}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
onlyOnlineModulebooleanif true, filter only visits from online modulefalse
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "count": 57,
    "previousCount": 49,
    "payedCount": 23,
    "payedCountAmount": 8765.9
}

Returns products statistics:

Returns products statistics:

  1. Sum of products sold in certain period
  2. Sum of products sold in previous period (for comparison)
  3. Number of visits with products sold in certain period
  4. Total number of visits in certain period

Authorization: Database

Scope: full, reports

GET/reports/dashboard/products{?location,start,end}
Full URL: https://api.aihelps.com/v1/reports/dashboard/products{?location,start,end}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "amount": 32567.8,
    "previousAmount": 27542.5,
    "visitsWithProducts": 41,
    "totalVisits": 261
}

Returns clients statistics:

Returns clients statistics:

  1. Number of clients for certain period (each guest check is separate client, employees are skipped)
  2. Number of new clients between clients in item 1
  3. Number of clients as in item 1 but for previous period (for comparison)
  4. Number of clients in db with "active" status and not archive
  5. Total number of clients in database except archive

Returns how many clients visits location, how many new clients and how many those, who visited location more than one time for certain period of time

Authorization: Database

Scope: full, reports

GET/reports/dashboard/clients{?location,start,end}
Full URL: https://api.aihelps.com/v1/reports/dashboard/clients{?location,start,end}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "clients": 278,
    "newClients": 57,
    "previousClients": 256,
    "activeInDb": 1521,
    "totalInDb": 3624
}

Returns information about how many clients was retentioned comparing certain period of time.

Returns information about how many clients was retentioned comparing certain period of time.

Let's assume 3 periods exists:

  1. current: (start, end)
  2. previous: (prevStart, prevEnd), where prevEnd = start and previous duration equals to current duration
  3. pre-previous: (prevPrevStart, prevPrevEnd), where prevPrevEnd = prevStart and pre-previous duration equals to current (and previous) duration

So, clientsRetention is part of clients from previous period that also come in current period. For example, in previous period was 100 different clients, in current only 85 of that 100 come at least once, so clientsRetention will be 0.85
newClientsRetention is same as clientsRetention but only for client that come in previous period first time (never was in location before).
oldClientsRetention is same as clientsRetention but only for client that already come to location before previous period.
previousRetention is part of clients from pre-previous period that also come in previous period. Can be used to show progress.

Authorization: Database

Scope: full, reports

GET/reports/dashboard/clientsRetention{?location,start,end}
Full URL: https://api.aihelps.com/v1/reports/dashboard/clientsRetention{?location,start,end}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "clientsRetention": 0.61,
    "newClientsRetention": 0.36,
    "oldClientsRetention": 0.84,
    "previousRetention": 0.37
}

Returns how many cards was sold and amount of sold cards for certain period of time

Returns how many cards was sold and amount of sold cards for certain period of time

Authorization: Database

Scope: full, reports

GET/reports/dashboard/cards{?location,start,end}
Full URL: https://api.aihelps.com/v1/reports/dashboard/cards{?location,start,end}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "count": 29,
    "amount": 5799.9
}

Returns services rated by turnover for certain period of time

Returns services rated by turnover for certain period of time

Authorization: Database

Scope: full, reports

GET/reports/dashboard/servicesRating{?location,start,end,maxCount}
Full URL: https://api.aihelps.com/v1/reports/dashboard/servicesRating{?location,start,end,maxCount}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
maxCountintegeryeshow many services will be in a list6
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "service": "1ad4e8bb-08c6-44fe-b1c9-85d91a8d7d75",
        "amount": 27956.7
    },
    {
        "service": "7cd5b0f3-e50d-475c-9e18-486fbbdf9d52",
        "amount": 25958.3
    },
    {
        "service": "8926e418-e85f-4eb4-9dea-47035806746f",
        "amount": 20887.2
    },
    {
        "service": "ca2f3d24-073f-4828-b2c8-aee59c70e3d2",
        "amount": 16656.8
    },
    {
        "service": "fa3850c7-eed1-4cfd-b71b-fd30f0d1d9d1",
        "amount": 13966.6
    },
    {
        "service": "7bdfb8bf-fb06-4fba-be93-1d6d175ac05e",
        "amount": 7956.1
    }
]

Returns professionals rated by turnover for certain period of time

Returns professionals rated by turnover for certain period of time

Authorization: Database

Scope: full, reports

GET/reports/dashboard/professionalsRating{?location,start,end,maxCount}
Full URL: https://api.aihelps.com/v1/reports/dashboard/professionalsRating{?location,start,end,maxCount}
Parameters
NameTypeRequiredDescriptionExample
locationidentifieryesid of a location, for which dashboard information will be generated3ec0a275-2276-4178-a0fc-002ff46b81fe
startdatetimeyesstart of a period, for which dashboard information will be generated2019-08-27T00:00:00.000Z
enddatetimeyesend of a period, for which dashboard information will be generated2019-08-28T00:00:00.000Z
maxCountintegeryeshow many professionals will be in a list5
GETRequest
HeaderValue
AuthorizationBearer 9c4068e2-c81f-4d70-ad31-8f627ed9bced
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "professional": "1ad4e8bb-08c6-44fe-b1c9-85d91a8d7d75",
        "amount": 27956.7
    },
    {
        "professional": "7cd5b0f3-e50d-475c-9e18-486fbbdf9d52",
        "amount": 25958.3
    },
    {
        "professional": "8926e418-e85f-4eb4-9dea-47035806746f",
        "amount": 20887.2
    },
    {
        "professional": "ca2f3d24-073f-4828-b2c8-aee59c70e3d2",
        "amount": 16656.8
    },
    {
        "professional": "fa3850c7-eed1-4cfd-b71b-fd30f0d1d9d1",
        "amount": 13966.6
    }
]

Helper methods

This section contains helper methods that can be helpful.
All methods in this section works without authorization.

These methods helps processing person names.
Person names (in most common case) can contain next parts:

  1. Title - "Mr.", "Ms." etc. Not used in most cases, still used for backward compability
  2. Firstname - person name
  3. Middlename - optional field for some countries
  4. Lastname - person surname
    Order of these parts differs in different cultures. For example, in USA format is "Firstname Lastname" (we try to ignore Title),
    in eastern Europe common format is "Lastname Firstname Middlename" and so on.

Generate full name from name parts.

Generate full name from name parts. Additionally, method tries to predict person sex (find name in list of male/female names, works for different countries, not only US).

Content language header should be set for this method (because format of full name and sex prediction depend from language).

Authorization: none

GET/helpers/names/format{?title,firstname,lastname,middlename}
Full URL: https://api.aihelps.com/v1/helpers/names/format{?title,firstname,lastname,middlename}
Parameters
NameTypeRequiredDescriptionExample
titlestringPerson titleMr.
firstnamestringPerson firstnameJohn
middlenamestringPerson middlename
lastnamestringPerson lastnameDoe
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "fullname": "John Doe",
    "sex": "Male"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "fullname": {
            "type": "string"
        },
        "sex": {
            "type": "string"
        }
    }
}

Try to parse full person name.

Try to parse full person name. Method tries to find firstnames, titles or middlenames in string using big database for different cultures, separating lastname.
If failed, try to predict parts using default order for language. So, both "John Doe", "Mr. Doe John" ("John" found in firstnames, Mr. in titles, list, another
part is surname) and "JohnA Doe" (JohnA not in names list but parts order is default).

Additionally, if firstname is recognized, method tries to predict person sex (find name in list of male/female names, works for different countries, not only US).

Content language header should be set for this method (because format of full name and sex prediction depend from language).

Authorization: none

GET/helpers/names/parse{?fullname}
Full URL: https://api.aihelps.com/v1/helpers/names/parse{?fullname}
Parameters
NameTypeRequiredDescriptionExample
fullnamestringyesPerson full nameJohn Doe
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "fullname": "John Doe",
    "sex": "Male"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "title": {
            "type": "string"
        },
        "firstname": {
            "type": "string"
        },
        "middlename": {
            "type": "string"
        },
        "lastname": {
            "type": "string"
        },
        "sex": {
            "type": "string"
        }
    }
}

In different cultures name parts in full name is shown in different order (separated by spaces).

In different cultures name parts in full name is shown in different order (separated by spaces). This function just returns order of these parts.

Content language header should be set for this method (because format of full name depends from language).

Elements that can be returned: title, firstname, middlename, lastname.

Authorization: none

GET/helpers/names/order
Full URL: https://api.aihelps.com/v1/helpers/names/order
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    "title",
    "firstname",
    "lastname"
]

For some cultures lists of firstnames or middlenames is available.

For some cultures lists of firstnames or middlenames is available. These lists exists separately for males, females or combined versions.
You can get these lists using current method.

Content language header should be set for this method (because format of full name and sex prediction depend from language).

Authorization: none

GET/helpers/names/list{?sex,type}
Full URL: https://api.aihelps.com/v1/helpers/names/list{?sex,type}
Parameters
NameTypeRequiredDescriptionExample
sexenum[string]yesmale, female firstnames (middlenames) in list or combinedmale
typeenum[string]yestype of items in list: either firstnames or middlenamesfirstname
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    "Aaron",
    "Abbott",
    "Abel",
    "Abner",
    "Abraham",
    "...",
    "Zebediah"
]

These methods represents actual information about countries.

This method returns detailed information about all countries.

This method returns detailed information about all countries. You can specify fields needed to return using fields parameter.

Content language header should be set for this method - countries names will be returned in specified language. This header should be set even if you do not
need name field - list of countries are sorted by localized name, so language is needed anyway.

Authorization: none

GET/helpers/countries{?fields}
Full URL: https://api.aihelps.com/v1/helpers/countries{?fields}
Parameters
NameTypeRequiredDescriptionExample
fieldsarray[string]list of fields to return (separated by comma).code3,name,flag
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    {
        "code2": "US",
        "code3": "USA",
        "name": "United States",
        "currency": "USD",
        "domain": "us",
        "languages": [
            "en",
            "es",
            "zh-CHT",
            "fr",
            "de",
            "fil",
            "it",
            "vi",
            "ko",
            "ru",
            "nv",
            "yi",
            "haw",
            "chr",
            "lkt",
            "ik"
        ],
        "phone": "+1",
        "flag": ""
    }
]
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "code2": {
            "type": "string"
        },
        "code3": {
            "type": "string"
        },
        "name": {
            "type": "string"
        },
        "currency": {
            "type": "string"
        },
        "domain": {
            "type": "string"
        },
        "languages": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "phone": {
            "type": "string"
        },
        "flag": {
            "type": "string"
        }
    }
}

Get country (two- and three-letter country code, ISO 3166-1 alpha-2/3) and city for provided IP address.

Get country (two- and three-letter country code, ISO 3166-1 alpha-2/3) and city for provided IP address.
If not detected, country and city can be empty string.

Authorization: none

GET/helpers/countries/by_ip{?ip}
Full URL: https://api.aihelps.com/v1/helpers/countries/by_ip{?ip}
Parameters
NameTypeRequiredDescriptionExample
ipstringip to get country and city. If parameter not set, client IP address is used.8.8.8.8
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "country2": "US",
    "country3": "USA",
    "city": "New York"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "country2": {
            "type": "string"
        },
        "country3": {
            "type": "string"
        },
        "city": {
            "type": "string"
        }
    }
}

These methods represents detailed information about phone numbers.

This method returns detailed information about phone number.

This method returns detailed information about phone number.

Phone should contain only digits in international or national format (in second case country needed).

If phone is invalid (wrong number of digits or such country/region code not exists), all response fields will be empty.

Authorization: none

GET/helpers/phones/{phone}{?country}
Full URL: https://api.aihelps.com/v1/helpers/phones/{phone}{?country}
Parameters
NameTypeRequiredDescriptionExample
phonestringyesphone number in international or national format (in second case country needed), only digits07312345678
countrystringtwo-letter or three-letter country code (ISO 3166-1)GB
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "phone": "+44 (7312) 345678",
    "country": "GBR",
    "country_phone_code": "+44",
    "is_mobile": true
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "phone": {
            "type": "string"
        },
        "country": {
            "type": "string"
        },
        "country_phone_code": {
            "type": "string"
        },
        "is_mobile": {
            "type": "string"
        }
    }
}

These methods represents detailed information about email address and address validation.

Validate if email adress is correct (in correct format).

Validate if email adress is correct (in correct format).

Authorization: none

GET/helpers/emails/{email}
Full URL: https://api.aihelps.com/v1/helpers/emails/{email}
Parameters
NameTypeRequiredDescriptionExample
emailstringyesemail address to validateinfo@aihelps.com
GETRequest
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "email": "info@aihelps.com",
    "valid": true
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "email": {
            "type": "string"
        },
        "valid": {
            "type": "string"
        }
    }
}

These methods helps estimate password quality.

Estimate password and returns information about password quality and suggestions to improve it.

Estimate password and returns information about password quality and suggestions to improve it.

Authorization: none

POST/helpers/passwords
Full URL: https://api.aihelps.com/v1/helpers/passwords
POSTRequest
Body
{
    "password": "qwerty"
}
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "score": 0,
    "warning": "This is a top-10 common password",
    "suggestions": [
        "Add another word or two. Uncommon words are better."
    ]
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "score": {
            "type": "number"
        },
        "warning": {
            "type": "string"
        },
        "suggestions": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}

These methods represents detailed information about dates.

This method returns date in text representation.

This method returns date in text representation.

Content language header should be set for this method - text representation will be returned in specified language.

Authorization: none

GET/helpers/dates/{date}
Full URL: https://api.aihelps.com/v1/helpers/dates/{date}
Parameters
NameTypeRequiredDescriptionExample
datedatetimeyesdate in ISO format2017-01-01T13:51:55.000Z
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
{
    "date": "2017-01-01T13:51:55.000Z",
    "description": "two days ago"
}
Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "date": {
            "type": "string"
        },
        "description": {
            "type": "string"
        }
    }
}

This method returns day periods names and their start/end for different languages.

This method returns day periods names and their start/end for different languages. For example, for english language:

[
    ["night", "00:00/06:00"],
    ["morning", "06:00/12:00"],
    ["afternoon", "12:00/18:00"],
    ["evening", "18:00/21:00"],
    ["night", "21:00/24:00"]
]

Day periods do not overlap and fill all 24-hour period. List of periods is sorted by period start. First period always starts at "00:00" and last one always end at "24:00" (thus name of first and last period sometimes can be same).

Content language header should be set for this method - text representation will be returned in specified language.

Authorization: none

GET/helpers/dates/day_periods
Full URL: https://api.aihelps.com/v1/helpers/dates/day_periods
GETRequest
HeaderValue
Content-Languageen
200Response
HeaderValue
Content-Typeapplication/json
Body
[
    [
        "night",
        "00:00/06:00"
    ],
    [
        "morning",
        "06:00/12:00"
    ],
    [
        "afternoon",
        "12:00/18:00"
    ],
    [
        "evening",
        "18:00/21:00"
    ],
    [
        "night",
        "21:00/24:00"
    ]
]

Data structures

identifier

Base

string

url

Base

string

phone

Base

string

country

Base

string

currency

Base

string

language

Base

string

datetime

Base

string

color

Base

string

section

Base

string

rangedate

Base

string

image

Base

object

address

FieldTypeExampleDescription
citystringcity
streetstringstreet
buildingstringbuilding number
apartmentstringapartment number
postal_codestringpostal code (ZIP)

item

information about one sale item in ticket to be purchased

FieldTypeExampleDescription
SUM FIELDS:section
original_pricenumberoriginal price for sale item according to location price (read only)
pricenumberif receptionist can raise price for client, `price` can be bigger than `original_price`
quantitynumberitem quantity (default 1), can be changed if `can_change_quantity=true` and new value greater than zero and not bigger then `max_quantity`
can_change_quantitybooleanif `quantity` can be changed (read only)
max_quantitynumberif `quantity` can be changed, defines what max value can be set (read only)
sumnumberfinal sum for item which is calculated as `price`*`quantity` minus discount, if appliable (read only)
DISCOUNT FIELDS:section
card_discountidentifieridentifier of client card, if discount is appliable
one_time_discountone_time_discountinformation about one-time discount, as input parameter can be just number with discount sum
promotionidentifierpromotion id (if match promotion with condition, will be set automatically, otherwise id of any promotion can be provided)
free_of_chargebooleanthis sale item will be sold free of charge (discount 100%)
DESCRIPTIVE FIELDS:section
namestringsale item name, callculated automatically depending on sale item type (read only)
commentsstringadditional comments about sale item
clients_modulebooleanif client booked via clients module/app by himself (true) or was booked by receptionist (false)
receptionistidentifierid of receptionist, who processing the ticket
appointment_receptionistidentifierid of receptionist, who booked client
appointment_create_datedatetimebooking date/time
SERVICE FIELDS:section
serviceidentifierservice to purchase (required field for purchasing service)
professinalidentifierprofessinal which will provide service (can be null if service can be provided without professional)
assistantidentifierif service can be provided with assistant; otherwise field ignored
recommended_professionalidentifierin case one professional recommends visit another professional; this fields represents who recommended, not to whom
calendar_datedatetimedate/time when service will be provided
durationnumbertime in minutes will be spent to provide service
hallidentifierhall where service will be provided
materialsmaterialmaterials will be used; if not provided, default materials will be used
appointmentidentifierappointment id [Appointments](#appointments)
by_certificateidentifiercertificate id, if service will be paid by certificate
PRODUCT FIELDS:section
productidentifierproduct to purchase (required field for purchasing product)
storageidentifierstorage where product will be taken (required field for purchasing product)
quantity_typequantitytypein which units `quantity` field is calculated (please mention product should have possibility to be sold in such units)
GROUP FIELDS:section
lessonidentifierlesson client is going to (required field for purchasing group)
trialbooleanif client visit to lesson is trial one (possibility depends on program options but can be done only once)
CARD FIELDS:section
cardidentifiercard to purchase (required field for purchasing card)
activationdatetimedate of card activation (card period start) or null if card should be not activated
delayed_paymentsarray[delayed_payment]if not full card sum should be payed at once, contains list of dates and sums to pay; sum of all payments should match `sum` field; otherwise null
professionalidentifierif card requires selecting professional on card sale, one should be provided
groupidentifierif card requires selecting group on card sale, one should be provided
card_numbernumberif card stock activated, for each card type there is a list of available cards and on purchase operation card number that will be sold should be provided; this number should be available and not sold yet
CERTIFICATE FIELDS:section
certificateidentifiercertificate to purchase (required field for purchasing certificate)
TIPS FIELDS:section
tipsnumbertips to leave for professional (required field for tips sale item type)
professionalprofessional who will receive tips (required field for tips sale item type)
ROUNDING FIELDS:section
roundingnumberticket rounding sum, calculated automatically if rounding is on, provided value ignored (required field for rounding sale item type)
SALE FIELDS:section
ididentifierid of created sale on succesfull sale operation (read only)

delayed_payment

information about card delayed payment

FieldTypeExampleDescription
datedatetime2017-01-01T00:00:00.000Zdate of delayed payment
sumnumber1000.00payment sum

quantitytype

how product is sold (what means `quantity` field)

FieldTypeExampleDescription
package`quantity` means number of packages (default value)
portion`quantity` means number of portions
units`quantity` means number of units (ml, g, etc.)

one_time_discount

information about one time discount

FieldTypeExampleDescription
sumnumberdiscount sum
max_percentnumberdiscount max percent
reasonstringdiscount reason

material

FieldTypeExampleDescription
productidentifierproduct id
storageidentifierid of storage where product should be taken
quantitynumberproduct quantity

payment

information about payment type and sum; only one of fields `account`, `deposit`, `bonus`, `company`, `certificate` should be declared, if `account`, `company` or `certificate` field is set, field `sum` represents amount to be payed

FieldTypeExampleDescription
accountidentifierclient will pay money to specified account (bank, cashdesk etc.), field contains account id, amount should be in `sum` field
depositnumberclient will withdraw money from his deposit, field contains money to be withdrawn
bonusnumberclient will use accumulated bonus money, field contains money to be used
companyidentifierclient will pay money from company account (company deposit), field contains company id, amount should be in `sum` field
certificateidentifierclient will use certificate, field contains certificate id, amount should be in `sum` field
sumnumbersum to be paid (for `account`, `company` or `certificate` types)

text_in_different_languages

FieldTypeExampleDescription
enstringtext in English
frstringtext in French

geoposition

FieldTypeExampleDescription
latitudestringlatitude of specific position
longitudestringlongitude of specific position

filter

FieldTypeExampleDescription
allbooleanif filter applied for all items (default is `true`)
*87d63709-c3dd-4469-991a-0e8d7994e07e (identifier)* (boolean) - if filter applied for item or category, represented by item or category id

filter_info

FieldTypeExampleDescription
nonestringfilter applied for all items
allstringfilter applied for none items
(filter) - filter applied to part of items, described in this field

filtered_list

FieldTypeExampleDescription
falsestringfilter applied for none items
truestringfilter applied for all items
`4da9ccd9-5a6b-49b5-97c6-ddad1ba03d57`, `894de0a7-dff1-43c9-b2d0-cd4590fd69dc` (array[identifier]) - filter applied to specific enumerated items

number_or_unlimited

FieldTypeExampleDescription
unlimitedstringrepresents unlimited number
*100* (number) - specific limited number

discount_quantity

FieldTypeExampleDescription
unlimitedstringnumber of discounted visits is unlimited
visitsstringnumber of discounted visits is limited by client card `visits` field
*100* (number) - number of discounted visits left

discount_details

FieldTypeExampleDescription
total_quantitydiscount_quantityvisitstotal number of discounted visits
left_quantitydiscount_quantityvisitsnumber of discounted visits left
discountnumber100discount percent, from 0 to 100 (100 means totally free)

discount_details_info

FieldTypeExampleDescription
(discount_details) - discount details, long form
*100* (number) - discount percent, from 0 to 100 (100 means totally free), short form, in case quantity is unlimited

discount_details_list

FieldTypeExampleDescription
alldiscount_details_infodiscount details for all items of specified type
*87d63709-c3dd-4469-991a-0e8d7994e07e (identifier)* (discount_details_info) - discount details for specific item or category, represented by item or category id

card_discounts_info

FieldTypeExampleDescription
servicesdiscount_details_listdiscounts for services proposed by card
productsdiscount_details_listdiscounts for products proposed by card
groupsdiscount_details_listdiscounts for groups proposed by card
cardsdiscount_details_listdiscounts for other cards proposed by card

bonus_details

FieldTypeExampleDescription
percentnumber5bonus percent, from 0 to 100
filterfilterfilter on items which are applied for bonus

bonus_details_info

FieldTypeExampleDescription
(bonus_details) - bonus details, long form
*5* (number) - bonus percent, from 0 to 100, short form, in case all items are applied for bonus

card_bonus_info

FieldTypeExampleDescription
servicesbonus_details_infobonus for services proposed by card
productsbonus_details_infobonus for products proposed by card
groupsbonus_details_infobonus for groups proposed by card
cardsbonus_details_infobonus for other cards proposed by card
certificatesbonus_details_infobonus for other cards proposed by card

accumulated_level

FieldTypeExampleDescription
sumnumber1000.00level end sum (if no `sum` field - no next level)
percentnumber5percent at current level, from 0 to 100

accumulate_items

FieldTypeExampleDescription
servicesfilter_infofilter applied for services
productsfilter_infofilter applied for products
groupsfilter_infofilter applied for groups
cardsfilter_infofilter applied for cards
certificatesfilter_infofilter applied for certificates

locationprice

FieldTypeExampleDescription
locationidentifierdd9114c8-439c-40a9-a784-04885f7fedablocation id
positionidentifierdd9114c8-439c-40a9-a784-04885f7fedabposition id
pricenumber100price on this location
staff_pricenumber100staff price

accumulate_schema

FieldTypeExampleDescription
schemaarray[accumulated_level]list of accumulation levels
accumulate_fromaccumulate_itemsitems from which sum is accumulated
accumulate_from_detailedstringlocalized description of filter accumulate_from
apply_toaccumulate_itemsitems to which discount/bonus can be applied
apply_to_detailedstringlocalized description of filter apply_to

accumulated_percent

FieldTypeExampleDescription
accumulated_sumnumber1567.20sum already accumulated
percentnumber4current discount/bonus percent (according to `accumulated_sum`)
next_levelnumber2000.00accumulated sum for reaching next level
next_percentnumber5discount/bonus percent on next level

user_contact_type

FieldTypeExampleDescription
phonestringphone number contact
emailstringe-mail contact

location_info

FieldTypeExampleDescription
ididentifier96e7b6c7-1813-4719-8676-544b1488637elocation id
namestringABC Salon NY Brooklynlocation name
citystringNew Yorklocation city
addressstring2818 Foster Avelocation address

database_info

FieldTypeExampleDescription
idnumber123456database code
namestringABC Salon NYdatabase name
locationsarray[location_info]list of locations in database

user_contact

FieldTypeExampleDescription
typeuser_contact_typephonecontact type
contactstring18005550123contact number/e-mail
verifiedbooleantrueif contact is verified

schedule

information about time ranges (from, to) grouped by weekday

Base

object