{"info":{"_postman_id":"70cb71dd-7171-4f8e-8ebc-ba60f5395813","name":"GBooking API for Online Appointment Scheduling","description":"<html><head></head><body><p>GBooking API is a standard json-rpc2 API supporting multiple transactions for managing business, clients, providing stats, booking time, and many more. It checks user acl roles for each request using the following parameters: <code>\"cred\": {\"user\": \"...\", \"token\": \"...\"}</code>. </p>\n<p>The present documentation offers examples of requests for a test environment. You can run them for development purposes.</p>\n<p>Example of request:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"method\":\"business.get_top_services\",\n   \"params\":{\n      \"business\":{\n         \"id\":\"4000000001992\"\n      }\n   },\n   \"cred\":{\n      \"token\":\"...\",\n      \"user\":\"...\"\n   }\n}\n</code></pre><ul>\n<li><strong>jsonrpc</strong> — protocol version (2.0)</li>\n<li><strong>id</strong> — numeric value identifying the request at the server</li>\n<li><strong>method</strong> — name of requested method</li>\n<li><strong>params</strong> — array of parameters for requested method</li>\n<li><strong>cred</strong> — set of data for identification and authorization</li>\n</ul>\n<p>Example of successful response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"jsonrpc\": \"2.0\",\n    \"id\": 1,\n    \"result\": {\n        \"status\": true,\n        \"services\": []\n    }\n}\n</code></pre><p>Example of error response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"error\":{\n      \"code\":-10200,\n      \"message\":\"Failed to retrieve business\",\n      \"data\":\"\"\n   }\n}\n</code></pre><p>By access level, all the requests are classified into several basic roles:</p>\n<ul>\n<li><strong>guest</strong> — public request without specifying access parameters</li>\n<li><strong>client</strong> — request providing and managing the data of a specific client</li>\n<li><strong>admin</strong> — request with access to the data pertaining to a business or a set of businesses</li>\n</ul>\n<p>For each request, there is a description including its access role. There can be multiple access roles. In such a case, the request can return different results.</p>\n<p>For online booking, public methods* with the <em>guest</em> role are used.</p>\n<hr>\n<p><em>* except for the method of showcase booking. The easiest way to get authorized in this case is to obtain a long live token in the showcase's back office.</em></p>\n<h2 id=\"glossary\">Glossary</h2>\n<p>Below are the basic concepts of the <em>GBooking API for Online Appointment Scheduling</em>:</p>\n<ul>\n<li><p>A <strong>Business</strong> contains complete data about a business:</p>\n<ul>\n<li>list of employees</li>\n<li>list of services</li>\n<li>settings of GBooking Widget's display</li>\n<li>settings of GBooking BackOffice display</li>\n<li>business information (name, address, phone number, working schedule)</li>\n<li>list of other branches in the network</li>\n</ul>\n</li>\n<li><p><strong>Business Branch</strong> or <strong>Branch</strong> stand for one branch, subsidiary, shop, salon, etc. </p>\n</li>\n<li><p><strong>Business Showcase</strong> or <strong>Showcase</strong> provides access to the data of a random group of branch businesses</p>\n</li>\n<li><p><strong>Branch Network</strong> means a set of branches united into one. The GBooking Widget allows the user to switch between branches or to obtain data for all the branches. In the BackOffice, an administrator with sufficient access rights can switch between branches. The client data is shared throughout the branch network.</p>\n</li>\n<li><p>An <strong>Employee</strong> contains information about the employee:</p>\n<ul>\n<li>full name</li>\n<li>list of services provided by them</li>\n<li>per-service performance speed</li>\n<li>branch</li>\n<li>phone number and email</li>\n<li>additional textual information, including profession and further information about the employee</li>\n</ul>\n</li>\n<li><p><strong>Service</strong>, <strong>Taxonomy</strong> — service or class of services that can be signed up for. Contains name, description, duration (optional for every employee), price, and discounts.</p>\n</li>\n<li><p><strong>Timetable slot</strong> — a period available for making appointments</p>\n</li>\n<li><p><strong>Appointment</strong> — an element of the timetable containing the following information: <em>client</em>, <em>employee</em>, <em>starting date</em>, <em>total duration</em>, <em>list of services</em>, <em>whether the client has paid</em>, and so on. </p>\n</li>\n<li><p><strong>Reserve</strong>, <strong>Reserve appointment</strong> — provisionary appointment that reserves the required time for a short period</p>\n</li>\n<li><p><strong>Client</strong> contains data about a client of one business or a branch network</p>\n</li>\n</ul>\n<p>For detailed information about the data schema, please refer to repository: <a href=\"https://github.com/GbookingLTD/corev2-schemata/tree/master/docs\">https://github.com/GbookingLTD/corev2-schemata/tree/master/docs</a>.</p>\n<p>Data schemata in the json-schema format are contained here: <a href=\"https://github.com/GbookingLTD/corev2-schemata/tree/master/schemas\">https://github.com/GbookingLTD/corev2-schemata/tree/master/schemas</a>.</p>\n<p>Error codes:</p>\n<ul>\n<li><a href=\"https://github.com/GbookingLTD/corev2-schemata/blob/master/schemas/errors.md\">full list of errors</a></li>\n<li><a href=\"https://github.com/GbookingLTD/corev2-schemata/blob/master/schemas/common/partials/authErrorCodes.yaml\">authorization errors</a></li>\n<li><a href=\"https://github.com/GbookingLTD/corev2-schemata/blob/master/schemas/misErrors.md\">errors from external systems</a></li>\n<li>There are lists of possible errors for every method to be used.</li>\n</ul>\n<p>As of 02.10.2018, the request-response format has been described for the following methods:</p>\n<ul>\n<li>Getting Business Data (business.get_profile_by_id)</li>\n<li>Adding a Client (client.add_client)</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"608267","collectionId":"70cb71dd-7171-4f8e-8ebc-ba60f5395813","publishedId":"SVSGPWCZ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-07-11T14:18:02.000Z"},"item":[{"name":"Getting Business Data","item":[{"name":"Getting static business data","id":"37971948-23d3-4cef-884b-5793e909a83e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"business.get_profile_by_id\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"with_networks\":true,\r\n   \t  \"worker_sorting_type\": \"workload\"\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access roles: <strong>guest</strong>, <strong>admin</strong>.</p>\n<p>A business schema contains a large amount of data. For the Widget to be displayed, the most important elements are as follows:</p>\n<ul>\n<li>List of services — taxonomies array</li>\n<li>List of resources — resources array</li>\n</ul>\n<p>Pseudocode for displaying list of specialists:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>function renderWorkers(business) {\n  for (worker in business.resources) {\n    if (worker.status === \"ACTIVE\" &amp;&amp; worker.displayInWidget) {\n      render(worker);\n    }\n  }\n}\n</code></pre><p>Here, business means the data obtained from the request.</p>\n<p>Every employee can have a <strong>scheduleIsEmpty</strong> field. If it equals to <strong>true</strong>, it means that the employee does not have free timetable. In this case, there is no need to display such an employee or display a message stating that no appointments for this employees can be made.</p>\n<p>Another possible situation is when an employee does not have free timetable for a specific service that he/she provides. In this case, the <strong>scheduleIsEmpty</strong> field will not equal to <strong>true</strong> (since there is actually timetable but for other services). You can use the request for <em>getting next appointment date</em> to specify if this employee has free timetable available for a specific service.</p>\n<p>The <strong>worker_sorting_type</strong> parameter in the body of the request refers to the employee sorting type. It can take one of the following values: </p>\n<ul>\n<li>\"none\" (as is)</li>\n<li>\"workload\" (by workload, starting with the least loaded)</li>\n<li>\"most_free\" (by closest appointment date)</li>\n</ul>\n<p>The sorting shall be performed by increase of the <strong>order</strong> index in the <strong>resources</strong> array (in other words, resources[i].order).</p>\n<p>The <strong>only_active_workers</strong> parameter in the body of the request means that only active employees available for appointments will be returned. </p>\n<p>The <strong>show_inactive_workers</strong> parameter in the body of the request means that all the employees will be returned, not only the active ones. </p>\n<p>By default, a <strong>guest</strong> access type request only returns active employees, while a request with <strong>admin</strong> access type covers all of them.</p>\n<p>A request provides information on all the businesses/network branches in the <strong>networks</strong> field if the <strong>with_networks</strong> parameter is used. This data should be used together with the business.get_network_data request.</p>\n<p>Pricing information is contained in the <strong>taxonomies</strong> array.</p>\n<p>See data descriptions <a href=\"http://git.dev.gbooking.ru/gbooking/corev2-schemata/blob/master/schemas/models/business.yaml\">json-schema</a> (including field descriptions)</p>\n<ul>\n<li>BusinessTaxonomyPrice — for <strong>price</strong> field</li>\n<li>AdditionalBusinessTaxonomyPrice — for <strong>additionalPrice</strong> field</li>\n</ul>\n<p>The <strong>price</strong> field contains the default price (unless a price has been found for the employee in <strong>additionalPrices</strong>). A price range (\"A to B\") can be calculated based on <strong>additionalPrices</strong> and <strong>price</strong>, meaning the minimum and maximum prices for a service (considering the <strong>price</strong> field).</p>\n<p>If the <strong>price.amount</strong> field equals to \"0\", then no price is defined for the corresponding service.</p>\n<h3 id=\"business-showcase\">Business Showcase</h3>\n<p>The following changes apply to the business data schema (data returned in response):</p>\n<ul>\n<li><strong>business.general_info.isShowcase</strong> should be \"true\" for the showcase</li>\n<li><strong>business.resources[i].origin_general_info</strong> stores information about the business branch where the employee works (see Screenshot 1: branch-wise data in the list of employees was obtained from this field)</li>\n<li><strong>business.resources[i].originBusinessID</strong> — branch business ID</li>\n<li><strong>business.resources[i].originTaxonomyIDs</strong> — array of IDs of the services that brought the employee to the showcase (since only one service from one branch can be attached to a showcase service, there can be only one element like this, and it will at the same time be guaranteed)</li>\n<li><strong>business.taxonomies[i].showcases</strong> — IDs of showcase connections</li>\n</ul>\n<p>Please note that the <strong>business.resources[i].taxonomies</strong> array includes showcase service IDs for each employee. Therefore, you can use the data as if it were local (within one business branch).</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"37971948-23d3-4cef-884b-5793e909a83e"},{"name":"Getting branch network","id":"49330a06-6498-43b4-a0cd-f66408b4a109","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{},\n   \"method\":\"business.get_network_data\",\n   \"params\":{\n      \"networkID\":{{NetworkID}}\n   }\n}\n"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>This method allows you to get a list of <em>IDs</em> for the branches available for making appointments under a pre-arranged source or the <em>GENERAL</em> source.</p>\n<p>The list of business branch data shall be provided using the rpc method <strong>business.get_profile_by_id</strong> performed with the <strong>with_networks</strong> parameters for one of the branches in the network. The data for the branches shall be returned in the  <strong>networks</strong> field, containing the minimum data required for displaying a list of branches.</p>\n<p>To get a list of network branches IDs, take the data from <strong>networkWidgetConfiguration</strong> by the source you have been assigned or by the <em>GENERAL</em> source.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"49330a06-6498-43b4-a0cd-f66408b4a109"}],"id":"bc164d9b-690f-4c65-9ea5-8c69b8a0180f","description":"<p>The first step consists in getting data about employees and services, as well as detailed information about the business, including its name, address, coordinates, phone number, working hours, etc.</p>\n","event":[{"listen":"prerequest","script":{"id":"d7bf0c6f-c423-4b69-9e86-985c36e887d7","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"6f5ad6e5-c3f2-4272-a432-9eb3223a4f31","type":"text/javascript","exec":[""]}}],"_postman_id":"bc164d9b-690f-4c65-9ea5-8c69b8a0180f"},{"name":"Getting a Timetable","item":[{"name":"Getting a timetable from CRAC (deprecated)","id":"89812594-ff09-4675-8a48-a6a68f4ec784","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"jsonrpc\": \"2.0\",\n    \"id\": 1,\n    \"cred\": {},\n    \"method\": \"Crac.GetCRACResourcesAndRooms\",\n    \"params\": [{\n        \"business\": {\n            \"id\": \"{{BusinessID}}\"\n        },\n        \"filters\": {\n            \"resources\": [\"59f05563854202eb6f86569c\"],\n            \"date\": {\n                \"from\": \"2017-11-01T00:00:00.000Z\",\n                \"to\": \"2017-11-30T00:00:00.000Z\"\n            }\n        }\n    }]\n}\n"},"url":"{{CRAC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>Use requests: \"<em>Getting timetable slots ...</em>\"</p>\n","urlObject":{"host":["{{CRAC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"89812594-ff09-4675-8a48-a6a68f4ec784"},{"name":"Getting showcase timetable slots","id":"a977eb8f-2564-4fc5-a0ba-9cb99ee7906a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n\n   },\n   \"method\":\"CracSlots.GetCRACDistributedResourcesAndRooms\",\n   \"params\":\n      {\n         \"business\":{\n            \"id\":\"4000000006304\",\n            \"widget_configuration\": {\n            \t\"cracServer\": \"CRAC_PROD3\"\n            },\n            \"general_info\": {\n            \t\"timezone\": \"Europe/Moscow\"\n            }\n         },\n         \"filters\":{\n            \"resources\":[\n               {\n                  \"resource\":\"5afafb9fc28333643ea29636\",\n                  \"business\":{\n                     \"id\":\"4000000006291\"\n                  }\n               },\n               {\n                  \"resource\":\"5afafb9fc28333643ea2963a\",\n                  \"business\":{\n                     \"id\":\"4000000006291\"\n                  }\n               },\n               {\n                  \"resource\":\"5afafb9fc28333643ea2963c\",\n                  \"business\":{\n                     \"id\":\"4000000006291\"\n                  }\n               }\n            ],\n            \"taxonomies\":[\n               \"9175610\"\n            ],\n            \"rooms\":[\n\n            ],\n            \"date\":{\n               \"from\":\"2018-09-06T00:00:00.000Z\",\n               \"to\":\"2018-09-10T00:00:00.000Z\"\n            }\n         }\n      }\n}"},"url":"{{CRAC_SLOTS_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>This request sends a set of slots that are ready for rendering in the timetable and also for making appointments.</p>\n<p>In this request, the <strong>business</strong> field contains an object with the following fields:</p>\n<ul>\n<li><strong>business.id</strong> — showcase business ID</li>\n<li><strong>business.widget_configuration.cracServer</strong> — alias of a CRAC server</li>\n<li><strong>business.widget_configuration.mostFreeEnable</strong> — returns the closest appointment date for each employee</li>\n<li><strong>business.general_info.timezone</strong> — time zone of business</li>\n</ul>\n<p>All these fields should be previously obtained from the  <strong>business.get_profile_by_id</strong> request (see above) and sent as is. Further on, as the data schema for this request might be extended, the format of the <strong>business</strong> field shall still be compatible with the format of the data from the <strong>business.get_profile_by_id</strong> request.</p>\n","urlObject":{"host":["{{CRAC_SLOTS_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a977eb8f-2564-4fc5-a0ba-9cb99ee7906a"},{"name":"Getting branch timetable slots","id":"0994e1bc-5512-4423-9bee-08bc6e3460df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n\n   },\n   \"method\":\"CracSlots.GetCRACResourcesAndRooms\",\n   \"params\":\n      {\n         \n         \"business\":{\n            \"id\":\"4000000006289\",\n            \"widget_configuration\": {\n            \t\"cracServer\": \"CRAC_PROD3\",\n            \t\"mostFreeEnable\": true\n            },\n            \"general_info\": {\n            \t\"timezone\": \"Europe/Moscow\"\n            }\n         },\n         \"filters\":{\n            \"resources\":[\n               {\"id\": \"5afafbc373b6066443311f24\", \"duration\": 30},\n               {\"id\": \"5afafbc373b6066443311f26\", \"duration\": 30}\n            ],\n            \"taxonomies\":[\n               \"9175163\"\n            ],\n            \"rooms\":[\n\n            ],\n            \"date\":{\n               \"from\":\"2018-07-13T00:00:00.000Z\",\n               \"to\":\"2018-07-17T00:00:00.000Z\"\n            }\n         }\n      }\n   \n}"},"url":"{{CRAC_SLOTS_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>This request returns a set of slots ready for rendering in the timetable and also for making appointments.</p>\n<p>For obtaining the duration of a service, see <strong>getServiceDuration</strong> (<em>Getting closest appointment date from CRAC for a branch</em>).</p>\n","urlObject":{"host":["{{CRAC_SLOTS_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0994e1bc-5512-4423-9bee-08bc6e3460df"},{"name":"Getting date of closest appointment for showcase","id":"7be82016-86a2-43ac-a01e-606e0c482c67","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"jsonrpc\":\"2.0\",\n    \"id\":9,\n    \"cred\":{\n\n    },\n    \"method\":\"Crac.CRACDistributedResourcesFreeByDate\",\n    \"params\":[\n        {\n            \"business\":{\n                \"id\":\"4000000006304\"\n            },\n            \"taxonomy\":{\n                \"id\":\"9175167\"\n            },\n            \"resources\":[\n                \"5afafbc373b6066443311f24\",\n                \"5afafbdaff64a76438ecde86\",\n                \"5afafb9fc28333643ea29636\",\n                \"5afafb9fc28333643ea2963c\",\n                \"5afafb9fc28333643ea29638\",\n                \"5afafbc373b6066443311f26\"\n            ]\n        }\n    ]\n}"},"url":"{{CRAC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>Returns dates of closest appointment regarding a service in a list of employees. Request for business showcase.</p>\n<p>Input parameters (<strong>params</strong>):</p>\n<ul>\n<li><strong>business.id</strong> — ID of showcase business</li>\n<li><strong>taxonomy.id</strong> — ID of showcase taxonomy (service)</li>\n<li><strong>resources</strong> — list of employee IDs</li>\n</ul>\n<p>All the IDs refer to showcase data only.</p>\n<p>The response returns an array of objects in the <code>result.Free</code> field. Each element has the following properties:</p>\n<ul>\n<li><strong>resource</strong> — ID of resource</li>\n<li><strong>taxonomy</strong> — ID of taxonomy</li>\n<li><strong>date</strong> — date of closest appointment, in ISO format (hours, minutes and seconds are filled with zeros)</li>\n<li><strong>maxFreeMinutes</strong> — duration of the longest free interval in the employee's timetable for the specified day, in minutes</li>\n</ul>\n<p>The closest appointment date shall be calculated based on how long it takes each employee to provide a service. This value is then compared with <strong>maxFreeMinutes</strong>. After that, the closest day is found where the duration of the service is less than the <strong>maxFreeMinutes</strong> parameter. This finding will be now considered the date of the closest appointment (<strong>date</strong> parameter).</p>\n<p>If the response contains an element with the following fields: <em>\"date\": \"0001-01-01T00:00:00Z\", \"maxFreeMinutes\": 0</em>, then the corresponding employee does not have free timetable for the service in question.</p>\n<p>Please note that if you need to sort by the closest appointment date, it can be done more conveniently using the  <strong>worker_sorting_type</strong> parameter in the request for getting business static data, <strong>business.get_profile_by_id</strong>. Sorting of the employees shall be performed by increase of the <strong>order</strong> index in the <strong>resources</strong> array (that is to say,  resources[i].order).</p>\n","urlObject":{"host":["{{CRAC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7be82016-86a2-43ac-a01e-606e0c482c67"},{"name":"Getting date of closest appointment for a branch","id":"564a62b4-ca4f-4406-b68d-4177ae995974","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"jsonrpc\":\"2.0\",\n    \"id\":1,\n    \"cred\":{\n\n    },\n    \"method\":\"Crac.CRACResourcesFreeByDate\",\n    \"params\":[\n        {\n            \"taxonomy\":{\n                \"id\":\"9175163\"\n            },\n            \"resources\":[\n                \"5afafbc373b6066443311f24\",\n                \"5afafbc373b6066443311f26\"\n            ],\n            \"duration\":60\n        }\n    ]\n}"},"url":"{{CRAC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>Returns dates of closest appointment regarding a service for a list of employees. Request for branch business.</p>\n<p>Input parameters (<strong>params</strong>):</p>\n<ul>\n<li><strong>duration</strong> — duration of the service provided by the employee </li>\n<li><strong>taxonomy.id</strong> — ID of showcase taxonomy (service) </li>\n<li><strong>resources</strong> — list of employees' IDs</li>\n</ul>\n<p>For the format of response data, see Request for Showcase.</p>\n<p>As the duration of the service, you can take the longest duration for each one of the employees in question. </p>\n<p>The following Javascript code shows how to calculate the duration of a service performed by each employee:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">export function getServiceDuration(taxonomy, resource) {\n  if (resource) {\n    var taxLevel = (_.find(resource.taxonomyLevels, {id: taxonomy.id}) || {}).level;\n    if (typeof taxLevel !== 'undefined') {\n      var level = _.find(taxonomy.additionalDurations, {level: taxLevel});\n      if (level) {\n        return level.duration ? level.duration : taxonomy.duration;\n      }\n    }\n  }\n  return taxonomy.duration;\n}\n</code></pre>\n<p>This code is also valid for a request for slots.</p>\n","urlObject":{"host":["{{CRAC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"564a62b4-ca4f-4406-b68d-4177ae995974"},{"name":"Getting date of closest appointment for a branch, v.2","id":"e00b2edc-75ac-4b2d-8a79-088df28c403a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"jsonrpc\":\"2.0\",\n    \"id\":1,\n    \"cred\":{},\n    \"method\":\"Crac.CRACResourcesFreeByDateV2\",\n    \"params\":[\n        {\n            \"business\": {\n                \"id\": \"4000000006289\"\n            },\n            \"taxonomy\":{\n                \"id\":\"9175163\"\n            },\n            \"resources\":[\n                \"5afafbc373b6066443311f24\",\n                \"5afafbc373b6066443311f26\"\n            ],\n            \"duration\":60,\n            \"durations\": [60, 30],\n            \"location\": \"Europe/Moscow\"\n        }\n    ]\n}"},"url":"{{CRAC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>Returns a list of closest appointment dates for a list of employees.</p>\n<p>If a service ID is specified, the response contains the date of closest appointment for each employee regarding the service in question.</p>\n<p>If no service ID is specified (empty string), the response contains the date of closest appointment for each employee regarding all the services he/she provides.</p>\n<p>The previous version of this request shows how to get the duration of the service provided by a specific employee.</p>\n<p>What's new in version 2:</p>\n<ul>\n<li><p>Option to send duration of service provided by each employee.</p>\n</li>\n<li><p>Correct calculation of the closest appointment date, provided that a timetable for the corresponding day is available.</p>\n</li>\n<li><p><strong>duration</strong> — duration of the service provided by the employee </p>\n</li>\n<li><p><strong>taxonomy.id</strong> — ID of showcase taxonomy (service)</p>\n</li>\n<li><p><strong>resources</strong> — list of employees' IDs </p>\n</li>\n<li><p><strong>taxonomy.id</strong> — service ID</p>\n</li>\n<li><p><strong>duration</strong> — default duration of service</p>\n</li>\n</ul>\n<p>If it is known that it takes all employees the same time to perform a service, this duration can be sent instead of a list.</p>\n<ul>\n<li><strong>durations</strong> — list of durations of services' performance by employees<br />The i-th position represents the duration of service performance by the employee whose ID stands in the i-th position in the <strong>resources</strong> array.</li>\n<li><strong>location</strong> &amp;mdash time zone of business, \"Europe/Moscow\" format<br />Can be obtained from the <strong>general_info.timezone</strong> of the business data schema.</li>\n</ul>\n<p>For data format, see Request for Showcase.</p>\n","urlObject":{"host":["{{CRAC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e00b2edc-75ac-4b2d-8a79-088df28c403a"}],"id":"eb171101-7287-4ed4-8fc7-39c927ccef56","description":"<p>Getting a timetable is made possible using the CRAC (The Collection of Results for Appointments Calculations) subsystem.</p>\n<p>CRAC handles binary vectors of the timetables (0 for busy, 1 for free). A CRAC vector encodes information about an employee's free time.</p>\n<p>All the requests for CRAC described herein share one special nuance regarding the dates. The time value is not taken into consideration when indicating a date. The space can be filled with zeros.</p>\n<p>In other words, if you want to specify a period between 2018-09-06 and 2018-09-10, you can write down the following two dates:\n2018-09-06T00:00:00.000Z<br />2018-09-10T00:00:00.000Z  </p>\n<p>This feature concerning the dates is because the CRAC subsystem saves a vector for an entire day.</p>\n<p>To obtain timetable slots, you should first obtain business data using the <strong>business.get_profile_by_id</strong> request.</p>\n","event":[{"listen":"prerequest","script":{"id":"a594650f-8bae-46cb-bdc5-16532ffab7ff","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"d1d3cc1c-d6d6-4070-a109-e7d0537261f1","type":"text/javascript","exec":[""]}}],"_postman_id":"eb171101-7287-4ed4-8fc7-39c927ccef56"},{"name":"Appointment Scheduling","item":[{"name":"Booking an appointment","id":"ebac7b07-02a2-4e4c-83f6-da585fe2a6ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":19,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"appointment.reserve_appointment\",\r\n   \"params\":{\r\n      \"appointment\":{\r\n         \"start\":\"2016-08-19T15:00:00\",\r\n         \"duration\":30,\r\n         \"price\":{\r\n            \"amount\":0,\r\n            \"currency\":\"RUB\"\r\n         }\r\n      },\r\n      \"source\":\"{{Source}}\",\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"taxonomy\":{\r\n         \"id\":\"9073638\"\r\n      },\r\n      \"client_appear\":\"NONE\",\r\n      \"resource\":{\r\n         \"id\":\"57b463de610c56383014c344\"\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>, <strong>admin</strong> (for showcase).</p>\n<p>Request for booking an appointment. Creates an appointment marked as <strong>TENTATIVE</strong> for a short time (about 5 minutes). \nThis time is given to the user to confirm the reserve. Otherwise, the booking is deleted.</p>\n<ul>\n<li><strong>appointment.start</strong> — starting time of appointment (UTC for business time zone). Time zone cannot be changed (see example).</li>\n<li><em>appointment.duration</em> — duration of appointment (if not submitted, is calculated as the aggregate duration of service performed by the employee in question)</li>\n<li><em>appointment.price.amount</em> — appointment price value </li>\n<li><em>appointment.price.currency</em> — appointment payment currency</li>\n<li><strong>appointment.source</strong> — source of appointment<br />You can indicate your own source of the appointments or one selected from a list, depending on where the appointment was made from. This will be included into the data regarding the appointment, the reports and the analytics.</li>\n<li><strong>business.id</strong> — business ID</li>\n<li><strong>taxonomy.id</strong> — service ID</li>\n<li><strong>resource.id</strong> — employee ID</li>\n<li><strong>client_appear</strong> — client appearance status<br />Can take one of ths possible values — \"YES_APPEAR\" (appeared), \"NO_APPEAR\", (did not appear), \"NONE\" (not defined)</li>\n<li><em>order.id</em> — order ID (if the appointment is added to an existing order)</li>\n</ul>\n<p>Mandatory fields are marked in <strong>bold</strong>, optional fields are <em>italic</em>.</p>\n<p>The full data schema for a request/response corresponds to the appointment data schema.\nYou can make a test request, see what comes and set up the fields you need.</p>\n<p>Possible error types:</p>\n<ul>\n<li>-10200 (BUSINESS_RETRIEVE_FAILED) — no business found by ID </li>\n<li>-13200 (TAXONOMY_RETRIEVE_FAILED) — taxonomy not found by ID</li>\n<li>-14100 (APPOINTMENT_CREATE_FAILED) — data specified incorrectly; validation error</li>\n<li>-14302 (APPOINTMENT_CLIENT_OVERLAPPED) — this client has already booked this time (there is an overlap between an existing appointment and the one in question)<br />This error can appear when a corresponding option has been installed at BackOffice.</li>\n<li>-14500 (APPOINTMENT_DATA_MISSING) — a mandatory field skipped </li>\n<li>-14600 (APPOINTMENT_RESOURCE_TAXONOMY_MISMATCH) — employee does not provide the specified service</li>\n<li>-14650 (APPOINTMENT_RESOURCE_BUSY) — for group appointments: group not found; for single appointments: employee not found or does not have free time</li>\n<li>-14700 (APPOINTMENT_CAPACITY_REACHED) — available space for service exceeded (time occupied)</li>\n<li>-14900 (APPOINTMENT_TIME_BEFORE_NOW) — starting time stated in the request is already less than the current time at the business time zone</li>\n<li>-15200 (ORDER_RETRIEVE_FAILED) — order not found by <em>order.id</em></li>\n<li>-15300 (ORDER_UPDATE_FAILED) — error while changing the specified order</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ebac7b07-02a2-4e4c-83f6-da585fe2a6ba"},{"name":"Booking an appointment with service from showcase","id":"a9ba3990-9e91-44b5-9503-cae9f2c6714a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":19,\r\n   \"cred\":{\r\n   },\r\n   \"method\":\"appointment.reserve_appointment\",\r\n   \"params\":{\r\n   \t  \"originBusinessID\": \"{{OriginBusinessID}}\",\r\n      \"appointment\":{\r\n         \"start\":\"2018-02-01T13:00:00\",\r\n         \"duration\":60,\r\n         \"price\":{\r\n            \"amount\":0,\r\n            \"currency\":\"RUB\"\r\n         }\r\n      },\r\n      \"source\":\"GBOOKING_DESKTOP_WIDGET\",\r\n      \"business\":{\r\n         \"id\":\"4000000006304\"\r\n      },\r\n      \"taxonomy\":{\r\n         \"id\": \"9175160\"\r\n      },\r\n      \"client_appear\":\"NONE\",\r\n      \"resource\":{\r\n         \"id\":\"5afafbdaff64a76438ecde88\"\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>, <strong>admin</strong> (for showcase).</p>\n<p>This request should be used when working with a showcase business.</p>\n<p>A request for booking an appointment should additionally include the branch business ID <strong>originBusinessID</strong>.</p>\n<p>The branch business ID can be obtained from the employee's field in the showcase business schema (also called  <strong>originBusinessID</strong>).</p>\n<p>A mandatory condition is that the starting time of the slot during booking coincides with the starting time obtained from the request <strong>CracSlots.GetCRACDistributedResourcesAndRooms</strong>.</p>\n<p>Requests for cancelling or modification of appointments should also include the branch business ID.</p>\n<p>Possible error types are the same as for the <em>Booking an Appointment</em> request.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a9ba3990-9e91-44b5-9503-cae9f2c6714a"},{"name":"Adding a new client","id":"e1c405ea-ce01-4b4c-8079-3d689151f64c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":18,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"client.add_client\",\n   \"params\":{\n      \"business\":{\n         \"id\":\"{{BusinessID}}\"\n      },\n      \"client\":{\n         \"name\":\"new\",\n         \"surname\":\"client\",\n         \"phone\":[\n            {\n               \"country_code\":\"7\",\n               \"area_code\":\"123\",\n               \"number\":\"1231231\"\n            }\n         ],\n         \"email\": [\"new_client@mail.com\"]\n      }\n   }\n}\n"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>Adding a new client or obtaining an existing one.</p>\n<p>This method starts with searching for an existing client. The search is made throughout the network covering the branch. If the business is a standalone one, the search is only performed within it.</p>\n<p>The client's phone number is a mandatory search criterium.\nAdditional criteria are the client's full name and email address.</p>\n<p>If the client has not been found, it will be created for the specified branch business according to the data sent in the request.</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><strong>client.name</strong> — client's first name</li>\n<li><strong>client.surname</strong> — client's last name</li>\n<li><strong>client.phone[0].country_code</strong> — part of client's phone number — country code</li>\n<li><strong>client.phone[0].area_code</strong> — part of client's phone number — area/provider code</li>\n<li><strong>client.phone[0].number</strong> — part of client's phone number — rest of number</li>\n<li><em>client.email</em> — client's email address</li>\n</ul>\n<p>Mandatory fields are marked in <strong>bold</strong>, optional fields are <em>italic</em>.</p>\n<p>The full data schema of request/response corresponds to the client's data schema.\nYou can make a test request, see what comes and set up the fields you need.</p>\n<p>Possible error types:</p>\n<ul>\n<li>-11100 (CLIENT_CREATE_FAILED) — data specified incorrectly; validation error</li>\n<li>-11500 (CLIENT_DATA_MISSING) — mandatory information missing in the request</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e1c405ea-ce01-4b4c-8079-3d689151f64c"},{"name":"Modifying an existing client","id":"a12982ee-dd87-407c-a5c1-fc1b8368c036","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":18,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"client.update_client\",\n   \"params\":{\n      \"business\":{\n         \"id\":\"{{BusinessID}}\"\n      },\n      \"client\":{\n         \"name\":\"test\",\n         \"surname\":\"client\",\n         \"phone\":[\n            {\n               \"country_code\":\"7\",\n               \"area_code\":\"123\",\n               \"number\":\"1231231\"\n            }\n         ],\n         \"email\": [\"test_client@mail.com\"]\n      }\n   }\n}\n"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>client</strong>.</p>\n<p>Modifying an existing client's data. Search for the client is performed by the ID submitted.</p>\n<p>If a client has not been found, the CLIENT_DATA_MISSING error is returned.</p>\n<ul>\n<li><strong>client.id</strong> — client ID</li>\n<li><strong>business.id</strong> — business ID</li>\n<li><strong>client.name</strong> — client's first name</li>\n<li><strong>client.surname</strong> — client's last name</li>\n<li><strong>client.phone[0].country_code</strong> — part of client's phone number — country code</li>\n<li><strong>client.phone[0].area_code</strong> — part of client's phone number — area/provider code</li>\n<li><strong>client.phone[0].number</strong> — part of client's phone number — rest of number</li>\n<li><em>client.email</em> — client's email address</li>\n</ul>\n<p>Mandatory fields are marked in <strong>bold</strong>, optional fields are <em>italic</em>.</p>\n<p>The full request/response data schema corresponds to the client data schema.\nYou can make a test request, see what comes and set up the fields you need.</p>\n<p>Possible error types:</p>\n<ul>\n<li>-11300 (CLIENT_UPDATE_FAILED) — data specified incorrectly; validation error</li>\n<li>-11500 (CLIENT_DATA_MISSING) — mandatory information missing in request</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a12982ee-dd87-407c-a5c1-fc1b8368c036"},{"name":"Confirming an appointment","id":"11ee29ea-e8a8-48b7-85ac-b3247b11d400","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":19,\n   \"cred\":{},\n   \"method\":\"appointment.client_confirm_appointment\",\n   \"params\": {  \n     \"appointment\": {\n       \"id\": \"58ff7a6fde30f0b622c24926\"\n     },\n     \"client\": {\n       \"id\": \"57b467de3c27f82e221dade1\"\n     }\n   }\n}\n"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>A request for confirmation of an appointment changes the status of a reserved appointment from <strong>TENTATIVE</strong> to <strong>CONFIRMED_BY_CLIENT</strong>.</p>\n<ul>\n<li><strong>appointment.id</strong> — ID of a reserved appointment (marked as <strong>TENTATIVE</strong>)</li>\n<li><strong>client.id</strong> — client's ID</li>\n</ul>\n<p>At the moment when the request is performed, the reserved appointment can have been deleted since the lifetime of a reserve is about 5 minutes only. In this case, the APPOINTMENT_RETRIEVE_FAILED error shall be returned. </p>\n<p>Every service has its \"capacity\", equalling to 1 by default. If you try to book or confirm an appointment for a service for the time that has been \"filled\", you will receive the APPOINTMENT_CAPACITY_REACHED error. If the \"capacity\" equals to 1, this error will mean that the time is already busy.</p>\n<p>Possible error types:</p>\n<ul>\n<li>-10200 (BUSINESS_RETRIEVE_FAILED) — business not found by ID</li>\n<li>-11200 (CLIENT_RETRIEVE_FAILED) — client not found by ID</li>\n<li>-11800 (CLIENT_IN_BLACKLIST) — client is in blacklist</li>\n<li>-14200 (APPOINTMENT_RETRIEVE_FAILED) — appointment not found by ID</li>\n<li>-14300 (APPOINTMENT_UPDATE_FAILED) — data specified incorrectly; validation error</li>\n<li>-14302 (APPOINTMENT_CLIENT_OVERLAPPED) — this client has already made an appointment for this time (there is an overlap between an existing appointment and the one being confirmed)<br />This error can appear when the corresponding option has been installed at BackOffice.</li>\n<li>-14500 (APPOINTMENT_DATA_MISSING) — a mandatory field is missing</li>\n<li>-14610 (APPOINTMENT_RESOURCE_TAXONOMY_UNAVAILABLE) — employee does not provide the requested service</li>\n<li>-14700 (APPOINTMENT_CAPACITY_REACHED) — available space exceeded for service (time already busy)</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"11ee29ea-e8a8-48b7-85ac-b3247b11d400"},{"name":"Cancelling of an appointment by client","id":"9285da72-b1f0-44fe-a119-5636384c1007","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":19,\r\n   \"cred\":{},\r\n   \"method\":\"appointment.cancel_appointment_by_client\",\r\n   \"params\":{\r\n     \"appointment\": {\"id\":\"{{AppointmentID}}\"},\r\n     \"client\": {\"clientID\": \"{{ClientID}}\"}\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>A request for a client's cancelling of an appointment changes its status for <strong>CANCELLED_BY_CLIENT</strong>.</p>\n<ul>\n<li><strong>appointment.id</strong> — appointment ID</li>\n<li><strong>client.id</strong> — client ID</li>\n</ul>\n<p>Before requesting the method, make sure that the appointment has one of the following statuses: CONFIRMED_BY_CLIENT, TENTATIVE, CONFIRMED_BY_BUSINESS.\nIf the appointment's status is CANCELLED_BY_CLIENT or CANCELLED_BY_BUSINESS (was cancelled before), the method will return the APPOINTMENT_CANCEL_FAILED error.</p>\n<p>Possible error types:</p>\n<ul>\n<li>-10200 (BUSINESS_RETRIEVE_FAILED) — business not found by ID (in appointment)</li>\n<li>-11200 (CLIENT_RETRIEVE_FAILED) — client not found by ID</li>\n<li>-14200 (APPOINTMENT_RETRIEVE_FAILED) — appointment not found by ID</li>\n<li>-14300 (APPOINTMENT_UPDATE_FAILED) — data specified incorrectly; validation error \nThis error can appear when the corresponding option has been set at BackOffice.</li>\n<li>-14303 (APPOINTMENT_CANCEL_FAILED) — incorrect initial status of appointment; appointment cancelled before</li>\n<li>-14305 (APPOINTMENT_PRE_CANCEL_FAILED) — appointment cancelled in an external system (e.g. in MIS)</li>\n<li>-14500 (APPOINTMENT_DATA_MISSING) — a mandatory field is missing</li>\n<li>-14700 (APPOINTMENT_CAPACITY_REACHED) — available space for service exceeded (time already busy)</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9285da72-b1f0-44fe-a119-5636384c1007"},{"name":"Cancelling of an appointment by business","id":"9f4302cd-817f-4810-b483-f11795aef4b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":19,\r\n   \"cred\":{\r\n   \t \"user\": \"{{UserID}}\",\r\n   \t \"token\": \"{{Token}}\"\r\n   },\r\n   \"method\":\"appointment.cancel_appointment_by_business\",\r\n   \"params\":{\r\n     \"appointment\": {\"id\":\"{{AppointmentID}}\"},\r\n     \"client\": {\"clientID\": \"{{ClientID}}\"}\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n<p>A request for cancelling an appointment by a business changes its status for <strong>CANCELLED_BY_BUSINESS</strong>.</p>\n<p>The input parameters, response parameters and possible error codes are the same as for the request for cancelling an appointment by client, except for the fact that authorization is also required in this case.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9f4302cd-817f-4810-b483-f11795aef4b7"},{"name":"Un-reserving a reserved timetable slot","id":"0f5dfe0b-05ac-4f60-9445-54d985544d84","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":19,\r\n   \"cred\":{},\r\n   \"method\":\"appointment.client_remove_empty_appointment\",\r\n   \"params\": {\r\n        \"appointment\": {\r\n          \"id\": \"58ff7a6fde30f0b622c24926\"\r\n        },\r\n        \"business\": {\r\n          \"id\": \"{{BusinessID}}\"\r\n        }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>guest</strong>.</p>\n<p>Request for removing a reserve appointment. The reserve appointment should have the <strong>TENTATIVE</strong> status before this method is requested.</p>\n<ul>\n<li><strong>appointment.id</strong> — appoinment ID</li>\n<li><strong>business.id</strong> — business ID</li>\n</ul>\n<p>Possible error types:</p>\n<ul>\n<li>-14306 (APPOINTMENT_GUEST_CANCEL_FAILED) — no appointment found by ID</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f5dfe0b-05ac-4f60-9445-54d985544d84"},{"name":"Getting a list of appointments for showcase","id":"32775168-ba34-4a13-b3ae-1d1d39bf5bcd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n   \t \"user\": \"{{UserID}}\",\r\n   \t \"token\": \"{{Token}}\"\r\n   },\r\n   \"method\":\"appointment.get_appointment_by_showcase\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"pageSize\": 100500,\r\n      \"page\": 1,\r\n      \"source\": \"{{Source}}\",\r\n      \"created\": {\r\n      \t\"from\": \"2018-10-01T00:00:00\",\r\n      \t\"to\": \"2018-11-01T00:00:00\"\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n<p>This request returns a list of appointments created for the showcase, applying the specified filter parameters.</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><strong>created.start</strong>, <strong>created.end</strong> — select appointments by creation date. The difference in dates should not exceed 90 days</li>\n<li><strong>source</strong> — source of appointment; the returned appointments should have this source</li>\n<li><strong>page</strong> — page number, starting with 1</li>\n<li><strong>pageSize</strong> — size of numbered page</li>\n</ul>\n<p>Mandatory fields are marked in <strong>bold</strong>, optional fields are <em>italic</em>.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"32775168-ba34-4a13-b3ae-1d1d39bf5bcd"},{"name":"Getting a list of appointments by business","id":"57fd5972-0f33-48ca-ac64-e95487d4b5d4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n   \t \"user\": \"{{UserID}}\",\r\n   \t \"token\": \"{{Token}}\"\r\n   },\r\n   \"method\":\"appointment.get_appointment_by_filter\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"network\": {\r\n      \t\"id\": \"{{NetworkID}}\"\r\n      },\r\n      \"extraFilters\": {\r\n      \t\"sort\": [{\r\n      \t\t\"dir\":\"desc\",\r\n      \t\t\"field\":\"created\"\r\n      \t}]\r\n      },\r\n      \"pageSize\": 100500,\r\n      \"page\": 1,\r\n      \"skipBusinessCancelled\": true,\r\n      \"filter\": {\r\n      \t\"start\": \"2018-11-01T00:00:00\",\r\n      \t\"end\": \"2018-11-07T23:59:59\",\r\n      \t\"created\": {\r\n      \t\t\"start\": \"2018-11-01T00:00:00\",\r\n\t      \t\"end\": \"2018-11-07T23:59:59\"\r\n      \t},\r\n      \t\"skipUpdated\": false,\r\n      \t\"services\": [],\r\n      \t\"workers\": []\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n<p>This request returns a list of appointments by business, applying the specified parameters</p>\n<p>This request allows for the following filter options:</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><strong>network.id*</strong> — network ID</li>\n<li><strong>filter.start</strong>, <strong>filter.end</strong> — choose appointments by starting time. The date difference should not exceed 90 days</li>\n<li><em>filter.created.start</em>, <em>filter.created.end</em> — filter appointments by creation date. These filter parameters are of higher priority than <strong>filter.start</strong>, <strong>filter.end</strong>. The appointments shall be filtered by creation date if  <strong>filter.created.start</strong> and <strong>filter.created.end</strong> have been submitted. The date difference should not exceed 90 days</li>\n<li><em>filter.updated.start</em>, <em>filter.updated.end</em> — filter appointments by modification date. The date difference should not exceed 90 days.</li>\n<li><em>filter.skipUpdated</em> — not to display modified appointments (<strong>false</strong> by default — modified appointments are displayed)</li>\n<li><em>skipBusinessCancelled</em> — not to display cancelled appointments (<strong>false</strong> by default — cancelled appointments are displayed)</li>\n<li><strong>filter.services</strong> — list of IDs for services for which appointments are to be received</li>\n<li><strong>filter.workers</strong> — list of IDs for employees for which appointments are to be received</li>\n<li><strong>page</strong> — page number starting with 1</li>\n<li><strong>pageSize</strong> — size of numbered page</li>\n</ul>\n<p>Mandatory fields are marked in <strong>bold</strong>, optional fields are <em>italic</em>.  </p>\n<p><strong>*</strong> one of these two parameters is mandatory:  <strong>business.id</strong> or <strong>network.id</strong>.</p>\n<p>Possible error types:</p>\n<ul>\n<li>-10001 (BUSINESS_DATA_MISSING) — no business or network ID specified in the request</li>\n<li>-14500 (APPOINTMENT_DATA_MISSING) — <strong>page</strong> and <strong>pageSize</strong> parameters not specified</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"57fd5972-0f33-48ca-ac64-e95487d4b5d4"}],"id":"25da1c18-e7e1-4019-9844-01f74e01bb51","description":"<p>The process of scheduling an appointment for a service comprises two stages: booking and confirmation of the appointment. Booking means that a time slot is reserved for a short time (about 5 minutes). This time is given to the user to complete the appointment or repeat the booking if the time has elapsed. At the 2nd stage (confirmation of the appointment), the user enters his/her data into the field and clicks the confirmation button. Upon a successful response, the appointment becomes permanent.</p>\n<p><em>The sequence of requests for reserving an appointment is shown on the following schema:</em></p>\n<p><img src=\"https://lh3.googleusercontent.com/Sp72irX0p-HW-_xusxuqOQUmztc6EhR9X0qXr9i4lGzhFl42NzwaJ8DnenfYChGZgMrRd7FGX9ZnCc8Q9Q2uOUgkRLd8-6yTENrRuKQEz7tILrXTuaYYqVU4pgUUFouX-jymlBrG\" alt=\"Appointment reservation schema\" /></p>\n","event":[{"listen":"prerequest","script":{"id":"31ce5495-fa7f-4a66-ac2a-0069f835cdc9","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"05084d11-b191-435e-ad9c-d70823254980","type":"text/javascript","exec":[""]}}],"_postman_id":"25da1c18-e7e1-4019-9844-01f74e01bb51"},{"name":"Showcase (Vitrina)","item":[{"name":"Building a showcase for a network of businesses","id":"14644048-f7a2-471b-b6cc-faab7cbb1d4a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"business.build_showcase\",\n   \"params\":{\n   \t  \"taxonomyMatching\": \"name_parent\",\n      \"network\":{\n         \"id\":\"{{NetworkID}}\"\n      },\n   \t  \"business\": {\n   \t  \t\"id\":\"{{BusinessID}}\"\n   \t  }\n   }\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n<p>Building with importing taxonomies \"as is\" from network branches.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"14644048-f7a2-471b-b6cc-faab7cbb1d4a"},{"name":"Building a showcase for random set of branches","id":"c1db1981-97e7-4d41-b2b0-0df4d112ad57","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"business.build_showcase\",\n   \"params\":{\n   \t  \"taxonomyMatching\": \"name_parent\",\n      \"originBusiness\": {\n   \t  \t\"id\": [\"4000000006290\", \"4000000006291\", \"4000000006289\"]\n   \t  },\n   \t  \"business\": {\n   \t  \t\"id\":\"{{BusinessID}}\"\n   \t  }\n   }\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n<p>Building with importing taxonomies \"as is\" from a random set of businesses.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c1db1981-97e7-4d41-b2b0-0df4d112ad57"},{"name":"Building a showcase from an Excel file","id":"2e20677e-b995-4d93-8c9b-4a861a75486a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"business.build_showcase\",\n   \"params\":{\n   \t  \"taxonomyMatching\": \"excel\",\n   \t  \"fileToken\": \"43373ed5e874a93202731b7678d3079fae5ef4c6\",\n   \t  \"originBusiness\": {\n   \t  \t\"id\": [\"4000000006290\", \"4000000006291\", \"4000000006289\"]\n   \t  },\n   \t  \"business\": {\n   \t  \t\"id\":\"{{BusinessID}}\"\n   \t  }\n   }\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n<p>Building a showcase and remapping services via an XLSX file.</p>\n<p>A <strong>fileToken</strong> can be obtained by loading a file through the \ncurl <a href=\"http://apiv2.gbooking.ru/upload_temp_file\">http://apiv2.gbooking.ru/upload_temp_file</a> -X POST -F filename=@file.xlsx request.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[{"id":"ee80ea44-090f-4639-af92-65fc238b7e1d","name":"Пострение демо витрины из exsel файла (4000000006304)","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"business.build_showcase\",\n   \"params\":{\n   \t  \"taxonomyMatching\": \"excel\",\n   \t  \"fileToken\": \"5369bcb0bd840592e9afee282b301c652f743bfa\",\n   \t  \"originBusiness\": {\n   \t  \t\"id\": [\"4000000006290\", \"4000000006291\", \"4000000006289\"]\n   \t  },\n   \t  \"business\": {\n   \t  \t\"id\":\"4000000006304\"\n   \t  },\n      \"baseBusinessID\":\"4000000006304\"\n   }\n}"},"url":"{{RPC_URL}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Headers","value":"Content-Type, Authorization, Content-Length, X-Requested-With","name":"Access-Control-Allow-Headers","description":"Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request."},{"key":"Connection","value":"keep-alive","name":"Connection","description":"Options that are desired for the connection"},{"key":"Content-Encoding","value":"gzip","name":"Content-Encoding","description":"The type of encoding used on the data."},{"key":"Content-Type","value":"application/json","name":"Content-Type","description":"The mime type of this content"},{"key":"Date","value":"Fri, 15 Jun 2018 12:39:43 GMT","name":"Date","description":"The date and time that the message was sent"},{"key":"Keep-Alive","value":"timeout=15","name":"Keep-Alive","description":"Custom header"},{"key":"Server","value":"nginx","name":"Server","description":"A name for the server"},{"key":"Set-Cookie","value":"connect.sid=s%3AEawCN5aPCk8dZrmgRSlg7zaR.XIHKkONQwpqabMdgytLnWeyPaB9R6uwt819DbNqoRao; Path=/; HttpOnly","name":"Set-Cookie","description":"an HTTP cookie"},{"key":"Transfer-Encoding","value":"chunked","name":"Transfer-Encoding","description":"The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity."},{"key":"Vary","value":"Accept-Encoding","name":"Vary","description":"Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server."},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":"Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"},{"key":"X-VARITI-CCR","value":"229716938:1","name":"X-VARITI-CCR","description":"Custom header"}],"cookie":[{"expires":"Tue Jan 19 2038 03:14:07 GMT+0000 (Coordinated Universal Time)","httpOnly":true,"domain":"api2.stage.dev.gbooking.ru","path":"/","secure":false,"value":"s%3AEawCN5aPCk8dZrmgRSlg7zaR.XIHKkONQwpqabMdgytLnWeyPaB9R6uwt819DbNqoRao","key":"connect.sid"},{"expires":"Thu Jun 21 2018 15:38:20 GMT+0000 (Coordinated Universal Time)","httpOnly":false,"domain":"api2.stage.dev.gbooking.ru","path":"/","secure":false,"value":"AAAAAFsEOWwqQzJ2A0e9Ag==","key":"rerf"}],"responseTime":null,"body":"{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"queued\":true,\"jobID\":\"5b23b38f6f3aac47700ced6d\"}}"}],"_postman_id":"2e20677e-b995-4d93-8c9b-4a861a75486a"},{"name":"Page-by-page loading of employees","event":[{"listen":"test","script":{"id":"a7088b18-e29c-4a6f-9010-ce088a5056d1","type":"text/javascript","exec":["pm.test(\"Successful POST request\", function () {","    console.error('processing');","    pm.expect(pm.response.code).to.be.oneOf([200,201,202]);","    var data = pm.response.json();","   _.sortBy(data.result, (r) => r.order).forEach((r) => {","     console.log(r.id + '|' + r.name + ' ' + r.surname);","   });","});","",""]}}],"id":"2cc11325-5e12-454f-9cdd-92e64f8a9e97","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"resource.get_showcase_resources\",\n   \"params\":{\n   \t  \"page\": 0,\n   \t  \"pageSize\": 100500,\n   \t  \"worker_sorting_type\": \"workload\",\n   \t  \"business\": {\n   \t  \t\"id\":\"{{BusinessID}}\"\n   \t  },\n   \t  \"taxonomy\": {\n   \t  \t\"id\": \"9165602\"\n   \t  }\n   }\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2cc11325-5e12-454f-9cdd-92e64f8a9e97"},{"name":"Verifying showcase integrity","id":"be930cf6-34ca-45b5-876f-e2fb2d50c172","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n   \"jsonrpc\":\"2.0\",\n   \"id\":1,\n   \"cred\":{\n      \"token\":\"{{Token}}\",\n      \"user\":\"{{UserID}}\"\n   },\n   \"method\":\"business.check_showcase\",\n   \"params\":{\n   \t  \"business\": {\n   \t  \t\"id\":\"{{BusinessID}}\"\n   \t  }\n   }\n}"},"url":"{{RPC_URL}}","description":"<p>Access role: <strong>admin</strong>.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"be930cf6-34ca-45b5-876f-e2fb2d50c172"}],"id":"51e20805-914e-4164-8948-69506fb1fa03","description":"<p>A showcase is a tool providing unified access to the data and appointments belonging to a set of branch businesses. Access to showcase businesses is similar to getting data about one branch (<strong>business.get_profile_by_id</strong> request), except for some differences that are described below.</p>\n<p>A showcase provides access to the data of real branch businesses but does not store the data in itself. Upon reservation, the data is transferred to the business. The showcase's users have no access to business data (only to public information).</p>\n<p>To initialize showcase data, you should run a request for building a showcase (<strong>business.build_showcase</strong>). \nThere are two ways of retrieving it: specifying an Excel file for remapping the services or without doing so (importing taxonomies as is). After this method is retrieved, the consistency of the showcase data is maintained automatically, eliminating the need to retrieve it again. Also, this method is idempotent, meaning that it can be retrieved again to restore showcase data.</p>\n","event":[{"listen":"prerequest","script":{"id":"c184e65d-400a-4115-a709-1d244e9c359c","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"56d1cc76-6fd8-419d-93cf-ef9bdf14c4dd","type":"text/javascript","exec":[""]}}],"_postman_id":"51e20805-914e-4164-8948-69506fb1fa03"},{"name":"Discounts","item":[{"name":"Getting regular discounts","id":"ac7b8b7b-c5d7-4c66-9fa4-952e69560946","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"business.get_business_taxonomy_discount\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"taxonomy\": {\r\n      \t\"id\": \"{{TaxonomyID}}\"\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Obtaining the regular discounts for a specific branch business and a specific service.</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><em>taxonomy.id</em> — service ID (optional)</li>\n</ul>\n<p>Format of discount data schema, both for obtaining and for saving request:</p>\n<ul>\n<li><strong>active</strong> — whether discount is applied</li>\n<li><strong>start</strong> — starting time of discount</li>\n<li><strong>weeklyRepeat</strong> — over 1 — duration of repeated instances of discounts, in weeks</li>\n<li><strong>unlimWeeklyRepeat</strong> — if 1 — repeated without time limitation (ignoring the <strong>weeklyRepeat</strong> parameter)</li>\n<li><strong>week</strong> — weekly schedule for discount. Has the following format:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>\"week\": {\n    \"sun\": [discountTimeFrameSchema],\n    \"mon\": [discountTimeFrameSchema],\n    \"tue\": [discountTimeFrameSchema],\n    \"wed\": [discountTimeFrameSchema],\n    \"thu\": [discountTimeFrameSchema],\n    \"fri\": [discountTimeFrameSchema],\n    \"sat\": [discountTimeFrameSchema]\n},\n</code></pre><p>See description of <strong>discountTimeFrameSchema</strong> above.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ac7b8b7b-c5d7-4c66-9fa4-952e69560946"},{"name":"Saving regular discounts","id":"e60d68b1-1ced-4212-ba20-8a64f33a19af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"business.set_business_taxonomy_discount\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"taxonomy\":{\r\n      \t\"id\": \"{{TaxonomyID}}\"\r\n      },\r\n      \"discount\":{\r\n      \t\"id\": \"52f3a6500eb2b3f21c000058\",\r\n      \t\"active\": true,\r\n      \t\"start\": \"2018-12-14T09:00:00.764Z\",\r\n      \t\"weeklyRepeat\": 3,\r\n      \t\"unlimWeeklyRepeat\": false,\r\n      \t\"week\": {\r\n      \t\t\"sun\": [],\r\n      \t\t\"mon\": [],\r\n      \t\t\"tue\": [{\r\n\t      \t\t\"start\": 540,\r\n\t      \t\t\"end\": 600,\r\n\t      \t\t\"discount\": 100,\r\n\t      \t\t\"provider\": \"LOCAL\"\r\n      \t\t}],\r\n      \t\t\"wed\": [],\r\n      \t\t\"thu\": [],\r\n      \t\t\"fri\": [],\r\n      \t\t\"sat\": []\r\n      \t}\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Saving the regular discounts for a specific branch business and a specific service.</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><em>taxonomy.id</em> — service ID (optional)</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e60d68b1-1ced-4212-ba20-8a64f33a19af"},{"name":"Getting day-specific discounts","id":"73229d8e-f74d-47d7-8a42-d2eee63c3e2f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"business.get_business_taxonomy_discount_exception\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"taxonomy\": {\r\n      \t\"id\": \"{{TaxonomyID}}\"\r\n      },\r\n      \"start\": \"2018-12-14T09:00:00.764Z\",\r\n      \"end\": \"2018-12-20T12:00:00.764Z\"\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Obtaining the discounts for a specific branch business, a specific service, and also for a specific date.</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><em>taxonomy.id</em> — service ID (optional)</li>\n<li><strong>start</strong> — starting date of discounted slots</li>\n<li><strong>end</strong> — ending date of discounted slots</li>\n</ul>\n<p>The response will include a <strong>slots</strong> array. Its elements have the following fields:</p>\n<ul>\n<li><strong>id</strong> — ID of day-specific discount</li>\n<li><strong>active</strong> — whether the discount is activated</li>\n<li><strong>date</strong> — day to which the discount applies</li>\n<li><strong>businessID</strong> — branch business ID</li>\n<li><strong>taxonomyID</strong> — service ID</li>\n<li><strong>slots</strong> — discount slots array (see  <strong>discountTimeFrameSchema</strong> data schema above)</li>\n</ul>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"73229d8e-f74d-47d7-8a42-d2eee63c3e2f"},{"name":"Saving a single day-specific discount","id":"f835c50c-3ba6-4362-a991-d8621dddb324","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"business.set_business_taxonomy_discount_exception\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"taxonomy\":{\r\n      \t\"id\": \"{{TaxonomyID}}\"\r\n      },\r\n      \"discount\":{\r\n      \t\"id\": \"52f3a6500eb2b3f21c000058\",\r\n      \t\"active\": true,\r\n      \t\"date\": \"2018-12-14T09:00:00.764Z\",\r\n      \t\"slots\": [{\r\n      \t\t\"start\": 540,\r\n      \t\t\"end\": 600,\r\n      \t\t\"discount\": 100,\r\n      \t\t\"provider\": \"LOCAL\"\r\n  \t\t}]\r\n      }\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Saving a single day-specific discount.</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><em>taxonomy.id</em> — service ID</li>\n<li><strong>discount</strong> — discount data</li>\n</ul>\n<p>If no slot ID is specified during saving, this slot will be added to the existing ones. If a slot ID is specified, the slot will be updated.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f835c50c-3ba6-4362-a991-d8621dddb324"},{"name":"Saving day-specific discounts","id":"8eac9eb7-ae38-4b58-a35d-2f03486ac1a2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n   \"jsonrpc\":\"2.0\",\r\n   \"id\":1,\r\n   \"cred\":{\r\n      \"token\":\"{{Token}}\",\r\n      \"user\":\"{{UserID}}\"\r\n   },\r\n   \"method\":\"business.set_business_taxonomy_discount_exceptions\",\r\n   \"params\":{\r\n      \"business\":{\r\n         \"id\":\"{{BusinessID}}\"\r\n      },\r\n      \"taxonomy\":{\r\n      \t\"id\": \"{{TaxonomyID}}\"\r\n      },\r\n      \"discounts\":[{\r\n      \t\"id\": \"52f3a6500eb2b3f21c000058\",\r\n      \t\"active\": true,\r\n      \t\"date\": \"2018-12-14T09:00:00.764Z\",\r\n      \t\"slots\": [{\r\n      \t\t\"start\": 540,\r\n      \t\t\"end\": 600,\r\n      \t\t\"discount\": 100,\r\n      \t\t\"provider\": \"LOCAL\"\r\n  \t\t}]\r\n      }]\r\n   }\r\n}"},"url":"{{RPC_URL}}","description":"<p>Saving day-specific discounts</p>\n<ul>\n<li><strong>business.id</strong> — business ID</li>\n<li><em>taxonomy.id</em> — service ID</li>\n<li><strong>discounts</strong> — discount data</li>\n</ul>\n<p>The request is similar to the single discount saving request, except that an array of slots is transmitted in the  <strong>discounts</strong> field.</p>\n","urlObject":{"host":["{{RPC_URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8eac9eb7-ae38-4b58-a35d-2f03486ac1a2"}],"id":"d54af49c-ade3-415f-91fd-c42c5f604037","description":"<p>The discounts are applied to services (taxonomies). They can be classified into two types:</p>\n<ul>\n<li><strong>regular discounts</strong> — act for several weeks and are repeated on specific days of the week</li>\n<li><strong>day-specific discounts</strong> — act for specific dates</li>\n</ul>\n<p>Each one of these discount types has specific timeframes during the day when they are applied.</p>\n<p>Example of <strong>discountTimeFrameSchema</strong> timeframe:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"start\": 540,\n    \"end\": 600,\n    \"discount\": 100,\n    \"provider\": \"LOCAL\"\n}\n    \n</code></pre><p>In this timeframe, the starting and ending times (the <strong>start</strong> and <strong>end</strong> fields, respectively) are specified in minutes elapsed from start of the day (for time zone of the business), while the <strong>discount</strong> field is the amount in the currency specified for the price of the service.</p>\n<p>The client business logic for handling discounts has been implemented in Javascript in the following module: <a href=\"http://git.dev.gbooking.ru/gbooking/widget-utils/blob/master/src/discounts.js\">widget-utils</a></p>\n","event":[{"listen":"prerequest","script":{"id":"1f56f50c-c49b-4421-beda-74018e5560b6","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"3ff3452a-4fd1-45f1-bd3c-0dbe5142ecf7","type":"text/javascript","exec":[""]}}],"_postman_id":"d54af49c-ade3-415f-91fd-c42c5f604037"}],"event":[{"listen":"prerequest","script":{"id":"3a4869d0-c262-4a2b-ac46-d4fda901648a","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"ed6ea016-a7aa-4b2c-81cd-10990711a0ec","type":"text/javascript","exec":[""]}}]}