0

Cancel a visit

by
Published Oct 17, 2025

Cancel an on-my-way or a waitlist visit by the given encrypted visit identifier. **Curl example with OAuth authentication:** ```sh root@test:~# curl -X POST "https://api.yelp.com/v3/visits/{VISIT_ID}/cancel" --header 'accept: application/json' --header "Authorization: Bearer ${API_TOKEN}" ``` If the visit is canceled successfully, the client will receive an empty 204 response. **Note:** In order to use this endpoint, the caller should be an onboarded Yelp Waitlist partner

Script yelp Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Yelp = {
3
  apiKey: string;
4
};
5
/**
6
 * Cancel a visit
7
 * Cancel an on-my-way or a waitlist visit by the given encrypted visit identifier.
8

9
**Curl example with OAuth authentication:**
10
```sh
11
    root@test:~# curl -X POST "https://api.yelp.com/v3/visits/{VISIT_ID}/cancel" --header 'accept: application/json' --header "Authorization: Bearer ${API_TOKEN}"
12
```
13

14
If the visit is canceled successfully, the client will receive an empty 204 response.
15

16
**Note:** In order to use this endpoint, the caller should be an onboarded Yelp Waitlist partner
17

18
 */
19
export async function main(auth: Yelp, visit_id: string) {
20
  const url = new URL(`https://api.yelp.com/v3/visits/${visit_id}/cancel`);
21

22
  const response = await fetch(url, {
23
    method: "POST",
24
    headers: {
25
      Authorization: "Bearer " + auth.apiKey,
26
    },
27
    body: undefined,
28
  });
29
  if (!response.ok) {
30
    const text = await response.text();
31
    throw new Error(`${response.status} ${text}`);
32
  }
33
  return await response.json();
34
}
35