> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.recurrente.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.recurrente.com/_mcp/server.

# Rechazar una cita

POST https://app.recurrente.com/api/bookings/{booking_id}/declination

Rechaza una cita pendiente: la hora queda libre y, si el cliente ya
había pagado, se le devuelve el pago.


Reference: https://docs.recurrente.com/referencia-api/api-reference/bookings/decline-booking

## Authentication

- `X-SECRET-KEY` header (required) — Tu clave secreta de API. Una llave de cuenta (`sk_live_...`, `sk_test_...`) opera sobre su propia cuenta y, con `X-ACCOUNT-ID`, sobre sus cuentas conectadas. La llave también fija el ambiente: una `sk_test_` solo lista y resuelve objetos de prueba (`live_mode: false`) y una `sk_live_` solo objetos reales. Un ID del otro ambiente responde `404` (`401` en `/customers`). Una llave de organización (`sk_org_live_...`, `sk_org_test_...`) alcanza todas las cuentas de una organización y solo sirve para leer: saldos, movimientos y reportes. Para operar sobre una cuenta debe nombrarla con `X-ACCOUNT-ID`; omitirlo en una lectura devuelve todas las cuentas de la organización. Cualquier otro endpoint responde `403` con `code: organization_key_unsupported`.

## Request

### Path parameters

- `booking_id` (string, required)

## Response

### 201

Cita rechazada

- `id` (string, optional)
- `account_id` (string, optional) — Cuenta (sucursal) de la cita.
- `status` (enum, optional) — `pending` mientras el cliente paga o el negocio decide; `confirmed` cuando la hora es del cliente.
  - Allowed values: `pending`, `confirmed`, `checked_in`, `completed`, `cancelled`, `no_show`
- `source` (enum, optional) — Por dónde entró la reserva.
  - Allowed values: `storefront`, `dashboard`, `api`, `mcp`, `cliq`, `whatsapp`, `waitlist`, `ical`
- `starts_at` (datetime, optional)
- `ends_at` (datetime, optional)
- `customer` (BookingCustomer, optional)
- `segments` (list of BookingSegment, optional) — Los tramos de la cita, uno por servicio (dos si el servicio tiene tiempo de proceso). Vacío en un lugar de una clase.
- `staff_member_id` (string, optional, nullable)
- `resource_id` (string, optional, nullable)
- `class_session_id` (string, optional, nullable) — La sesión, si la cita es un lugar en una clase.
- `stay` (BookingStay, optional, nullable) — Las noches en una habitación, si la reserva es una estadía de alojamiento.
- `payment_policy` (enum, optional)
  - Allowed values: `none`, `card_on_file`, `deposit`, `full`
- `currency` (string, optional)
- `total_in_cents` (integer, optional) — Lo que cuesta la cita.
- `paid_in_cents` (integer, optional) — Lo que el cliente ya pagó (anticipo, total o protección).
- `balance_in_cents` (integer, optional) — Lo que falta cobrar el día de la cita. 0 en una sesión de paquete o un saldo cobrado afuera.
- `balance_paid_outside_at` (datetime, optional, nullable) — Cuándo el negocio marcó el saldo como cobrado fuera de Recurrente.
- `checkout_id` (string, optional, nullable)
- `checkout_url` (string, optional, nullable) — Donde el cliente paga lo que la política pide, o deja su tarjeta.
- `balance_checkout_id` (string, optional, nullable)
- `balance_checkout_url` (string, optional, nullable) — El link del saldo, después de `POST /bookings/{booking_id}/balance_charge`.
- `no_show_fee_checkout_id` (string, optional, nullable) — El checkout del cargo por inasistencia, cobrado o rechazado.
- `booking_series_id` (string, optional, nullable) — La serie que la reservó, si se repite.
- `access_url` (string, optional) — La página del cliente para ver, pagar o cancelar su cita (link firmado).
- `customer_note` (string, optional, nullable)
- `merchant_note` (string, optional, nullable)
- `accepted_at` (datetime, optional, nullable)
- `hold_expires_at` (datetime, optional, nullable) — Hasta cuándo se aparta la hora si nadie paga.
- `cancelled_by` (enum, optional, nullable)
  - Allowed values: `customer`, `merchant`, `system`
- `cancellation_reason` (string, optional, nullable)
- `rescheduled_from_id` (string, optional, nullable) — La cita que esta reemplazó al moverse de hora.
- `metadata` (BookingMetadata, optional)
- `created_at` (datetime, optional)

## Errors

### 422 Unprocessable Entity Error

La cita no está pendiente (`not_pending`)

- `message` (string, optional) — Mensaje de error
- `code` (string, optional) — Código estable legible por máquinas, cuando aplica
- `refund_id` (string, optional) — ID del reembolso relacionado cuando aplica
- `endpoint` (string, optional) — Acción de API rechazada, cuando aplica
- `errors` (ErrorErrors, optional) — Detalles de errores por campo

## Types

### BookingCustomer

- `id` (string, optional)
- `name` (string, optional, nullable)
- `email` (string, optional, nullable)
- `phone` (string, optional, nullable)

### BookingSegment

- `service_id` (string, optional)
- `product_id` (string, optional)
- `product_variant_id` (string, optional, nullable)
- `staff_member_id` (string, optional, nullable)
- `resource_id` (string, optional, nullable)
- `kind` (enum, optional)
  - Allowed values: `service`, `processing_final`, `stay`, `class_session`
- `starts_at` (datetime, optional)
- `ends_at` (datetime, optional)

### BookingStay

Las noches de una estadía en una habitación.

- `room_type_id` (string, optional) — El tipo de habitación (servicio `kind: lodging`).
- `unit_id` (string, optional, nullable) — La habitación.
- `unit_name` (string, optional, nullable)
- `check_in_on` (date, optional)
- `check_out_on` (date, optional)
- `nights` (integer, optional)
- `guests` (integer, optional)
- `service_tab_id` (string, optional, nullable) — La cuenta abierta que el check-in abrió para los consumos.
- `registered_guests` (list of RegisteredGuest, optional) — El registro de huéspedes (INGUAT).
- `guests_registered_at` (datetime, optional, nullable)

### BookingMetadata

### ErrorErrors

Detalles de errores por campo

### RegisteredGuest

- `name` (string, optional)
- `document` (string, optional)
- `nationality` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "bk_9f8e7d6c",
  "account_id": "ac_4b3a2c1d",
  "status": "cancelled",
  "source": "storefront",
  "starts_at": "2024-04-20T14:00:00Z",
  "ends_at": "2024-04-20T15:00:00Z",
  "customer": {
    "id": "cus_7a6b5c4d",
    "name": "María González",
    "email": "maria.gonzalez@example.com",
    "phone": "+502 5555 1234"
  },
  "segments": [
    {
      "service_id": "svc_1234abcd",
      "product_id": "prd_5678efgh",
      "product_variant_id": "var_9abcde01",
      "staff_member_id": "stf_2345bcde",
      "resource_id": "res_6789fabc",
      "kind": "service",
      "starts_at": "2024-04-20T14:00:00Z",
      "ends_at": "2024-04-20T15:00:00Z"
    }
  ],
  "staff_member_id": "stf_2345bcde",
  "resource_id": "res_6789fabc",
  "class_session_id": null,
  "stay": {
    "room_type_id": "svc_ab12cd34",
    "unit_id": "res_ab12cd34",
    "unit_name": "Cabaña 1",
    "check_in_on": "2026-10-09",
    "check_out_on": "2026-10-11",
    "nights": 2,
    "guests": 2,
    "service_tab_id": "tab_3456defg",
    "registered_guests": [
      {
        "name": "Lucía Pérez",
        "document": "DPI 1234 56789 0101",
        "nationality": "Guatemalteca"
      }
    ],
    "guests_registered_at": "2024-04-20T14:00:00Z"
  },
  "payment_policy": "deposit",
  "currency": "GTQ",
  "total_in_cents": 20000,
  "paid_in_cents": 10000,
  "balance_in_cents": 10000,
  "balance_paid_outside_at": null,
  "checkout_id": "chk_7890abcd",
  "checkout_url": "https://app.recurrente.com/payments/checkout/chk_7890abcd",
  "balance_checkout_id": "chk_7890efgh",
  "balance_checkout_url": "https://app.recurrente.com/payments/checkout/chk_7890efgh",
  "no_show_fee_checkout_id": null,
  "booking_series_id": null,
  "access_url": "https://app.recurrente.com/bookings/access/bk_9f8e7d6c?token=abc123xyz",
  "customer_note": "Prefiere atención por la tarde",
  "merchant_note": "Cliente frecuente, aplicar descuento en próxima cita",
  "accepted_at": "2024-04-15T10:00:00Z",
  "hold_expires_at": "2024-04-18T14:00:00Z",
  "cancelled_by": "merchant",
  "cancellation_reason": "Cliente no confirmó asistencia",
  "rescheduled_from_id": null,
  "metadata": {
    "source_system": "web_app",
    "priority": "high"
  },
  "created_at": "2024-04-10T09:00:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://app.recurrente.com/api/bookings/booking_id/declination"

payload = {}
headers = {
    "X-SECRET-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.recurrente.com/api/bookings/booking_id/declination';
const options = {
  method: 'POST',
  headers: {'X-SECRET-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.recurrente.com/api/bookings/booking_id/declination"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-SECRET-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.recurrente.com/api/bookings/booking_id/declination")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-SECRET-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.recurrente.com/api/bookings/booking_id/declination")
  .header("X-SECRET-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.recurrente.com/api/bookings/booking_id/declination', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-SECRET-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.recurrente.com/api/bookings/booking_id/declination");
var request = new RestRequest(Method.POST);
request.AddHeader("X-SECRET-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-SECRET-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.recurrente.com/api/bookings/booking_id/declination")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```