---
title: Visits and their statuses
summary: A visit is one booking of a client for one or several services, taking a master, a place and a device. It is booked, confirmed, took place or canceled; a visit without booking is recorded after the fact.
tools: [talemo_book_visit, talemo_record_walk_in, talemo_get_visit, talemo_list_visits, talemo_get_calendar, talemo_execute_pick]
related: [finding-times, moving-and-cancelling-visits, visit-notices, resources, services-and-prices, ../clients/contact-card]
search: [appointment, booking, status, walk-in]
---

# Visits

A visit ties together a client's card (see [Contact card](../clients/contact-card.md)),
a branch, one or several services, the resources they take and the time. All
services of a visit are booked, moved and canceled together. A visit has one master, and a place and a device
are chosen for each service: a manicure on a table and a pedicure on a couch are one visit. Two services at
different masters one after the other are two back-to-back visits: the assistant books them together in one action (see [Finding times](finding-times.md)). Visits live in the
**Calendar** of the web app.

## Statuses

- **booked** — the visit exists and is waiting;
- **confirmed** — a person pressed **Confirm** on a booked visit;
- **took place** — the visit was closed with how it really went;
- **canceled** — with a reason (see
  [Moving and canceling visits](moving-and-cancelling-visits.md)).

**Not closed** is a mark on a visit and lies outside the four statuses. A booked or confirmed visit whose time has
passed carries it until a person marks it as took place or cancels it. The Calendar
shows how many visits are not closed, and **Visits not closed** lists them with
**Sort out**. Until they are sorted, the takings of those days are incomplete.

## Booking

A visit is booked through the finder (see [Finding times](finding-times.md)) with
`talemo_book_visit`: the client's card, the services, the start and, if wanted, the
resources. The start must be on the booking step, in the future, inside open time and
free. A card in **Not sorted** becomes a client when a visit is booked for it.

If the person is not in the contacts yet, a **new client** is named instead of a card: a name and a
phone number (in the booking window, **For whom → New client**; in the tools, `new_party` instead of
`party_id`, exactly one of the two). Talemo looks for the number among the phones and WhatsApp numbers of
your contacts. Found — the visit goes to that card under the name it already has, the typed name is not
saved, and the person sees whose card it was booked for. Not found — Talemo adds a client card and books
it; the history of the contact keeps a line, "Created the card when booking a visit". It needs the right
to add contacts and an open Phone field; without the right the answer is "You don't have the right to add
clients. Pick one from your contacts or ask the owner for this right." The preview (`dry_run`) does not
look the number up: it always shows a new card with the name typed.

The online admin books, moves and cancels visits too, but only for the client it is
talking to in that chat.

When the online admin offers times in a chat, the time the client picked is run by Talemo itself
(`talemo_execute_pick`), not by the online admin. One offer is one visit: the first pick books the
visit (an offer of booking) or moves the visit that the offer is about (an offer of a move); another time
of the same offer moves that visit; the same time again changes nothing; and a visit that was cancelled
after the first pick is booked again by an offer of booking and refused by an offer of a move. Two picks
of one offer at the same moment make one visit.

## Prices

Each service of a visit takes its price and currency from the price list when the
visit is booked (see [Services, prices and currency](services-and-prices.md)).
Changing the price list does not change booked visits. **Change the price** edits the
prices of one visit only, and the history of the visit keeps who changed them and
when. A role denied the field Price does not see the prices of visits at all.

When a service has its own price for a level of masters (see
[Levels of masters](master-levels.md)), the visit takes the price of the master it is
booked with: the price of his level, or the usual one for a master with no level and for a
level with no price of its own. The price the client was shown — on the booking page, or told by
the online admin or a connected tool — is checked at booking: if the price of the master has
changed since, nothing is booked, the new price is shown and the visit is booked again with
it. A visit that is already booked keeps its price when the master moves to another level.

## A visit that took place

**Close the visit** writes down how it really was: the time, who did it, which
services and how much was paid. It goes into the same visit, and the plan stays in
its history. Closing a closed visit again corrects it, and every correction is kept.
The master's real time is the time of the visit. The place and the device stay as they were
booked: a service that was in the booking keeps its booked stretch with the cleanup, and
closing does not move it after the real time. A service added at closing gets a share of
the real time, split between the services by their lengths in the price list. Its place is
the same as the neighboring service's if it fits; if several places fit, you can choose it in the
dialog. A service left out frees its place. In the card of the visit every place and device names
the services it is taken for: the booking remembers this link, and closing with a shifted time,
closing again and a price correction do not change it, so the table stays with the manicure and
the couch with the pedicure. For visits booked before the link was remembered, a service is put
on the place of its role that its real time overlaps the longest.

## Visit without booking

**Visit without booking** records a client who came without booking. It is written
at once as took place and is always in the past: its end cannot be later than now. The
finder and the step are not used, only the real time. If that time lies outside the
open time of a resource, **Extend the day and record** opens it in that resource's
day, and the day becomes "changed by hand". The tool is `talemo_record_walk_in`. No
confirmation or reminder is made for it. The client is named as in booking: by a card, or as
a new client by name and number. A manicure on a table and a pedicure on a couch are one
visit of one master, as in booking; when a service fits several places, name the one that
was used for each service.

## Who can do it

Finding, viewing, booking, changing, moving, canceling, recording and deleting are
separate rights at branch level; the Administrator role has them. A right can be limited
to own: the person then sees and books only visits on the resource they work as.

## Tools and refusals

- `talemo_execute_pick` is the step of the turn that follows a pick of the client, and the online admin does not call it: `conversation_id`, `offer_id` (the `offer` of the buttons of the offer) and `n`, the number of the picked time from 1. The answer names the `outcome` — `booked`, `moved` or `already` — and the `visit`, and for a time of several visits one after another also `visits` with all of them in order (`visit` is the first); the online admin tells the client from that answer only. A time that is taken or past is status 409, code `reply.slot_unavailable`, with `params.option` and `params.reason` (`taken` or `past`; for a time of several visits one after another none was booked, and the refusal of a leg carries `params.leg`, its number from 1); a visit of an offer of a move that was cancelled is `visit.cancelled`, one that took place is `visit.done`; a number outside the offer is `request.body_invalid` with `params.field` `n`; an offer that is not in this conversation is `not_found`; anyone but the online admin of the conversation, a role without the right of the action (`visit.create` to book, `visit.move` to move), and a visit to move that is not its own under the reach “own” or is outside the branches of the role are `role.forbidden` with `params.capability`; a booking into a branch of the offer outside the branches of the role is `record.reference_missing` with `params.field` `branch_id`.
- A visit is booked only through the finder: `talemo_find_times` first, then `talemo_book_visit` with `party_id` (the card of the client) or `new_party` (a new client: `name` and `phone` with `address` and, for a number without `+`, `country`; exactly one of the two, or `request.body_invalid`), `service_ids`, the `start` of a variant and its `resource_ids`. A variant goes as it is. Booking checks the start again, so the time can be gone by then: status 409, code `slot.overlap`; time outside the open time of a resource is `visit.outside_schedule` with `params.resource_id`, unless `extend_schedule` opens it (below); a start in the past is `visit.past`; a start off the step is `request.body_invalid` with `params.field` `start`; a resource that does not do the services is status 422, code `visit.resource_unfit`. A contact from the unsorted category becomes a client. With `new_party` the answer of a real booking carries `party_match`: `found` — a card with that number existed and the visit went to it under its own name, `created` — the card was added; the preview carries no `party_match`. Without the right to add contacts the refusal is status 403, code `role.forbidden`, `params.capability` `party.create`: tell the person they have no right to add clients and offer to pick one from the contacts or to ask the owner for the right; a role that closes the Phone field gets `role.field_forbidden`.
- `talemo_book_visit` with `legs` instead of `service_ids` and `resource_ids` books visits one after another — the legs of a variant of `talemo_find_times` with `in_turn`: from two to four legs, each with its `service_ids` and `resource_ids`, the services of all the legs together are one basket; `start` is the start of the first leg, and the others follow right at the end of the work of the one before. All the visits are booked together or none: when a leg does not fit, the refusal has the same code as for one visit (`slot.overlap`, `visit.outside_schedule` and others) with `params.leg`, the number of the leg from 1. The answer is the first visit and `visits` with all of them in order (for a booking of one visit `visits` has one). `legs` together with `service_ids`, `resource_ids` or `price` is `request.body_invalid`.
- Statuses: booked, confirmed, done (it took place) and canceled. `talemo_get_visit` shows one visit with the services in order, who is taken when and, if the role may see them, the prices. `talemo_list_visits` lists, in `visits`, the visits of a branch for a period, of one contact (`party_id`), or with `unclosed` those of the past that are still booked or confirmed and need to be recorded as done or canceled. `from` and `to` of its answer are the window the visits were read in; a `from` or `to` that is absent means no bound on that side, not a week. A list with no `to` reads a week from `from`, and then `beyond` says what lies after that week: `count`, how many live visits of the same filters start later, and `nearest`, the nearest of them with its `visit_id`, `start` and `time_zone`. An empty `visits` with `beyond.count` above 0 is not “no visits”: they are later, and the nearest one may be another contact’s, so look for a contact’s visits with `party_id`. The online admin reads a contact’s visits on with no end, and its answer has no `beyond`. `talemo_get_calendar` shows the grid of one to seven days and counts the unclosed ones in `unclosed_count`.
- `party_live_visits` is in every visit of the answers of `talemo_list_visits`, `talemo_get_visit` and `talemo_get_calendar`: how many live visits — booked or confirmed, not yet ended — its contact has, this one included. When it is above 1 and the person named the contact but did not say which visit — its day, time or service, or the nearest or the last one — read the contact's visits with `party_id` and `live`, name each with its date and time and ask which one; do not pick one for them. `live` is by status, not by time: a visit that has ended and is still booked or confirmed comes with `live` too, has `unclosed` true and is not a visit ahead; the next or upcoming visit of a contact is one that has not ended. When `party_live_visits` is 0, nothing is ahead: say so, name the unclosed visit apart with its date and ask what to do with it — it took place, the client did not come, or it is to be moved.
- `own_resource_ids` is in the answers of `talemo_list_visits` (next to `visits`) and `talemo_get_calendar` only when the person sees just the visits of the resources linked to them: the IDs of those resources. Empty — no resource in the calendar is linked to them yet, so their own visits cannot show; absent — they see all the visits of the branch.
- If booking is turned off for a master who still has visits, their column stays in the calendar marked ‘not taking bookings’: the visits are there, but no new time can be booked. Booking is turned back on in their card. The column of a switched-off resource comes without visits too when `talemo_get_calendar` names it in `resource_id` (a question about one master, place or device), and always for the person’s own switched-off resource when the person sees just their own visits. A resource from `resource_id` that does not exist, is not visible to the role or lies in another branch is status 404, code `not_found`, `params.field` `resource_id` and `params.reason` `not_found` or `not_in_branch`; a value that is not a uuid is `request.body_invalid` with the same field. Tell the person that there is no such master in the calendar of this branch, and do not put another one in its place.
- Every visit has a `source`: `page` when the client booked it herself on the booking page of the branch (see [Branch booking page](branch-booking-page.md)), `salon` for every other one, whether a person, the online admin or a connected tool booked it. `talemo_get_visit`, `talemo_list_visits` and `talemo_get_calendar` show it.
- A visit of the past is recorded with `talemo_record_walk_in`, done at once, with `party_id` or `new_party`, `service_ids`, `start`, `end`, optionally `resource_ids`, `service_resources` (which place or device did which service, as pairs of `service_id` and `resource_id`; the master stays in `resource_ids`, and a resource that does not fit its service is refused with `visit.resource_unfit`) and `price`. It ends no later than now, or it is refused with status 409, code `visit.future`. A time outside the open time of a resource is refused with `visit.outside_schedule` unless `extend_schedule` opens it in the day of the resource: say so to the person first.
- When the person asks to book at a time that is not open, say what would open and ask: a day off, hours beyond the shift or a resource with no schedule. When they say yes, `talemo_book_visit` with `extend_schedule` true and the master, place or device in `resource_ids` opens exactly the time of the visit in the day of each named resource and books in the same step; without the flag the refusal stays `visit.outside_schedule`. It needs the right to edit the schedule: without it status 403, code `role.forbidden`, `params.capability` `schedule.edit`. The answer lists what was opened in `opened` — `resource_id`, `name`, `kind` (`day_off`, `outside_shift` or `no_schedule`), `start`, `end` and, for `outside_shift`, the `shift` it stood in — and `asks` lists what the person is to hear first: `opens_time`, and `client_message` when Talemo writes to the client at once that the visit is booked; `dry_run` shows both and books nothing. `client_hears` of the answer says the same for the messages of the booking by entry: whether each goes to the client now and, when not, why. Say the client gets the confirmation only for an entry that goes; otherwise name the reason and say that the person tells the client themselves (see [Visit notices](visit-notices.md)). Busy time such as a lunch stays closed even with the flag, and the time of a resource that is not named is never opened. The assistant of a person in the mode **Ask what matters** books on its own while `asks` is empty and otherwise shows a card and waits for **Allow**; in **Approve every action** it always waits. The online admin does not open time: it offers another start. The finder never offers busy or closed time (see [Schedule of a resource](resource-schedule.md)).
- The services of a visit take their price from the price list when it is booked, in the currency of the branch; when a service has a price for a level of masters, the price of the master of the visit.
- `talemo_book_visit` takes `price`: the prices the client was told, in the order of `service_ids` — the `price` of each entry of `services` in the variant you book, decimals in the currency of the branch like "35.00", `null` for a service with no price. Pass it whenever the variant has prices; left out, the visit is booked at the price of its master with no check. If the price of the master has changed since the variant was found, nothing is booked: status 409, code `visit.price_changed`, `params.service_id` of the first service that differs and `params.price`, its price now. Tell the client the new price, find the times again and book only if they agree. `level_id` books with the masters of one level when no master is in `resource_ids` (the `level_id` of a master in `fits` of `talemo_list_services`, or `none` for the masters with no level); the rule of the branch picks the master inside the level.
