---
title: "Update reservation by id"
method: PATCH
path: "/v1/reservations/{reservationId}"
tags: ["reservations"]
---

# Update reservation by id

`PATCH /v1/reservations/{reservationId}`

This endpoint allows an agent to update a reservation by id. The id is agent-specific. The agent needs to be authenticated.
####Request:
* **reservationId**: Agent-specific ID of the requested reservation. Taken as a path parameter.
* **reservation.status**: New status for the reservation. When is present then all parameters below should be omitted!
* **reservation.capacity**: The capacity (people count) of the reservation.
* **reservation.areaId**: The ID of the area this reservation should be in.
* **reservation.dateTime**: The date and time when the reservation will take place. Format: yyyy-MM-ddTHH:mm:ssZ.
* **reservation.reservationTags** list of reservation tag IDs. Null value is treated as no value.
* **reservation.extraInfo** additional text information about the reservation.

  The next JSON will be treated as follows:
  - { } - **extraInfo** will not be updated
  - { “extraInfo”:null } - **extraInfo** will not be updated
  - { “extraInfo”:“some text”} - **extraInfo** will be updated with provided text
  - { “extraInfo”:“”} - **extraInfo** will be assigned an empty string

For updating status request body should contain  only reservation.status.
Valid status values depend on the current status of reservation and can be `CUSTOMER_CANCELED` or `RECONFIRMED`.
* `CUSTOMER_CANCELED` is valid if current status is one of the below:
    * CREATED
    * CONFIRMED
    * AUTOMATIC_CONFIRMED
    * NOTIFICATION_REQUESTED
    * NOTIFIED
    * RECONFIRMED
* `MERCHANT_CANCELED` is valid if current status is one of the below:
    * CONFIRMED
    * AUTOMATIC_CONFIRMED
    * NOTIFICATION_REQUESTED
    * NOTIFIED
    * RECONFIRMED
* `RECONFIRMED` is valid if current status is one of the below:
    * CONFIRMED
    * AUTOMATIC_CONFIRMED
    * NOTIFICATION_REQUESTED
    * NOTIFIED

If reservation.status field is not present then reservation data will be updated and reservation's status will be reset.
Depending on `Automatic confirmation for online reservations` setting, reservation's status will be set to CREATED or AUTOMATIC_CONFIRMED.

####Response:
The endpoint will return `HTTP 200 - OK` if update was successful.
It will return `HTTP 404 - Not Found` error if the reservation with the specified id could not be found.
It will return `HTTP 403 - Forbidden` error if the agent is not authenticated, if the agent doesn't have permissions or the reservation doesn't belong to the 
authenticated agent.
It will return `HTTP 409 - Conflict` error if reservation has menu, made by IOVOX, has conflict in status, time or other conflicts.

Example curl:
```
curl -H "Content-Type: application/json" -X PATCH -d '
{
  "reservation": {
    "status": "CUSTOMER_CANCELED"
  }
}
' https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f
```

## Path parameters

- `reservationId` string, required

## Request body

- UpdateReservationData
  - `reservation` ReservationDetails, required
    - `status` string, required — The status of the reservation.
    - `capacity` integer, required — The capacity (people count) of the reservation.
    - `areaId` integer — The id of the area this reservation should be in. Optional.
    - `dateTime` string, date-time — The date the review created on. Format: yyyy-MM-ddTHH:mm:ssZ
    - `reservationTags` integer[] — Reservation tag IDs.
    - `extraInfo` string — Additional text information about the reservation. Pass empty string to remove it.

## Response `200`

OK

## Other responses

- `400` — Bad request
- `403` — Access denied
- `404` — Reservation not found
- `409` — No matching table(s) found
- `500` — Internal server error

---

[API](https://skmtc.net/quandoo/apis/quandooapidocumentation.md) · [All operations](https://skmtc.net/quandoo/apis/quandooapidocumentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/quandoo/quandooapidocumentation/revisions/6863a5956792/schema)
