# Change Appointment attendance status

Change the attendance status of one Appointment without resending the full
Appointment. The body field is `attendance` (not `visit_attendance`). The
supported statuses are `-1` (did not come), `0` (waiting), `1` (came), and
`2` (confirmed). Read the current status from the Appointment first.
The Business User needs `record_form_access` and `edit_records_access` for
this Location. The Appointment must fall within the Location's
`records_edit_last_days_count` editing window (`-1` means no history limit).
A request can also be rejected while online payment is pending, by payment
policy, or when a printed sale receipt would be invalidated. With a printed
receipt, only `1` and `2` remain eligible statuses. Submitting the current
status leaves it unchanged.
Appointments linked into one visit share an attendance group. Changing one
Appointment can update the status of other Appointments in that visit and
trigger related payment, loyalty, and notification processing. The `records`
response field contains timetable change data; it is not a per-ID bulk result.
For a bounded bulk workflow, select a finite set of Appointment IDs, read
each Appointment and confirm its Location, current status, and visit link,
then send one request per distinct attendance group. Re-read affected
Appointments after each change, record successes and failures per group, and
stop or report on a failed request. This endpoint offers no atomic bulk
operation or all-or-nothing rollback.

Endpoint: POST /locations/{location_id}/appointments/{record_id}/attendance
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (integer, required)
    Location ID

  - `record_id` (integer, required)
    Appointment ID

## Header parameters:

  - `Accept` (string, required)
    Required B2B v2 response media type. Use `application/vnd.api.v2+json`. A charset parameter is also accepted.

  - `Content-Type` (string, required)
    Should be equal to `application/json`

## Request fields (application/json):

  - `attendance` (integer, required)
    Desired attendance status
    Enum: "-1", "0", "1", "2"

## Response 200:

  - `200` (unknown)
    Attendance status processed

## Response 200 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: true

  - `data` (object)

  - `data.attendance` (integer)
    Enum: "-1", "0", "1", "2"

  - `data.records` (any)
    Timetable changes keyed by Appointment ID, or an empty array when there are none

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

## Response 400:

  - `400` (unknown)
    Appointment is waiting for online payment or the request is invalid

## Response 400 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: An error has occurred.

  - `meta.errors` (array)
    Set of a validation error messages.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Missing edit permission, outside the editing window, or wrong Location

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Appointment or Location not found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

