# Move or edit an appointment

`PATCH /businesses/{bid}/appointments/{id}`

Requires the `businesses` scope.

Day, time, place, customer, service, price, notes. Never the status: moving an appointment does not change whether it happened.

## Path parameters

| Name | Type | | Description |
|---|---|---|---|
| `bid` | string | **required** | Business id, from `POST /businesses`. |
| `id` | string | **required** | Appointment id. |

## Body

| Field | Type | | Description |
|---|---|---|---|
| `partyId` | string |  | A saved party (find or create it first). Optional: a block of time needs no customer. |
| `serviceId` | string |  |  |
| `title` | string |  | ≤120 chars. Default: the service, else the customer, else "פגישה". |
| `date` | string |  | YYYY-MM-DD, the Israel calendar day. |
| `start` | string |  | HH:MM, local Israel time. |
| `minutes` | integer |  | 5..1440. Default: the service, else the calendar's defaultMinutes. |
| `priceAgorot` | integer |  |  Integer agorot (₪1 = 100). |
| `priceMode` | string |  |  One of: `gross`, `net`. Default `gross`. |
| `location` | string |  | Default: the calendar's first location. One of: `business`, `customer`, `remote`. |
| `address` | string |  | ≤300 chars. |
| `meetingUrl` | string |  | An http(s) address. |
| `notes` | string |  | ≤2000 chars. |

## Response

`200`: `{ "ok": true, … }`

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `appointment` | Appointment | **required** | An appointment on the business's calendar. Not a document: freely edited and deleted, in no export. |

Errors: `400`, `401`, `403`, `404`, `429`. Every failure answers `{ "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }`: branch on `reason`, and read `hint` for what to change (https://docs.billos.co.il/errors.md).

## Examples

### cURL

```bash
curl -X PATCH "$BASE/businesses/$BID/appointments/$DOC_ID" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "priceMode": "gross"
  }'
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/appointments/${DOC_ID}`, {
  method: 'PATCH',
  headers: {
    'X-Api-Key': KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "priceMode": "gross"
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.patch(
    f"{BASE}/businesses/{BID}/appointments/{DOC_ID}",
    headers={"X-Api-Key": KEY},
    json={
      "priceMode": "gross"
    },
)
data = res.json()
```