Cancel a booking
curl --request POST \
--url https://api.simplepay.mx/v1/bookable-payments/bookings/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"metadata": {},
"reason": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({metadata: {}, reason: '<string>'})
};
fetch('https://api.simplepay.mx/v1/bookable-payments/bookings/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.simplepay.mx/v1/bookable-payments/bookings/{id}/cancel"
payload = {
"metadata": {},
"reason": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"amountMinor": 1,
"currency": "<string>",
"endsAt": "2023-11-07T05:31:56Z",
"eventTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"holdId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"object": "<unknown>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 2,
"refundedAmountMinor": 1,
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"simplepayCheckoutSessionId": "<string>",
"startsAt": "2023-11-07T05:31:56Z",
"tenantCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z"
}Cancel a booking
Referencia detallada para POST /v1/bookable-payments/bookings//cancel.
POST
https://api.simplepay.mx
/
v1
/
bookable-payments
/
bookings
/
{id}
/
cancel
Cancel a booking
curl --request POST \
--url https://api.simplepay.mx/v1/bookable-payments/bookings/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"metadata": {},
"reason": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({metadata: {}, reason: '<string>'})
};
fetch('https://api.simplepay.mx/v1/bookable-payments/bookings/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.simplepay.mx/v1/bookable-payments/bookings/{id}/cancel"
payload = {
"metadata": {},
"reason": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"amountMinor": 1,
"currency": "<string>",
"endsAt": "2023-11-07T05:31:56Z",
"eventTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"holdId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"object": "<unknown>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 2,
"refundedAmountMinor": 1,
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"simplepayCheckoutSessionId": "<string>",
"startsAt": "2023-11-07T05:31:56Z",
"tenantCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z"
}Uso
Usalo dentro de Bookable Payments para modelar inventario reservado, calcular disponibilidad, crear holds, convertirlos en checkout y confirmar bookings.Antes de llamar
| Tema | Detalle |
|---|---|
| Metodo | POST |
| Ruta | /v1/bookable-payments/bookings/{id}/cancel |
| Auth | Bearer API key del ambiente correcto. |
| Scope | bookings:write |
| Idempotencia | Recomendada para cualquier retry. Usa una key deterministica por operacion de negocio. |
| Guia relacionada | Bookable Payments |
Patron recomendado
- Ejecuta este endpoint desde backend o job seguro, nunca desde frontend con API keys.
- Manda
Idempotency-Keycuando el endpoint cree, convierta, reprograme, cancele, capture o reembolse estado. - Confirma inventario final con
booking.confirmedo una lectura de booking, no solo con una URL de retorno. - Consulta el bloque OpenAPI de esta pagina para el shape exacto de parametros, body y respuestas.
Ejemplo minimo
terminal
curl -sS -X POST "https://api.simplepay.mx/v1/bookable-payments/bookings/id_123/cancel" \
-H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: cancel-booking_v1" \
-d '{ ... }'
Errores a manejar
400indica payload, parametros o estado invalido.401o403indican API key, ambiente o scopes incorrectos.409suele indicar conflicto de estado, duplicado o idempotencia incompatible.404significa que el recurso no existe para ese tenant o ambiente.429y5xxse pueden reintentar con backoff; en writes conserva la misma idempotency key.
Contrato OpenAPI
El playground, parametros, body y respuestas de abajo salen de/openapi.json. Si el contrato cambia, actualiza la spec y regenera esta pagina.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
8 - 255Path Parameters
Response
200 - application/json
Booking cancelled
Required range:
x >= 0Pattern:
^[a-z]{3}$Available options:
failed, paid, partially_refunded, refunded, unpaid Required range:
x >= 1Required range:
x >= 0Available options:
cancelled, confirmed, expired, no_show, pending, rescheduled Last modified on June 21, 2026
⌘I