Developers
translateEspañolOpen an account

Get started

  • Reseller API
  • Quickstart

Concepts

  • Authentication and modes
  • Errors
  • Idempotency
  • Rate limits
  • Pagination

Reference

  • Endpoints
  • Objects

Guides

  • Booking lifecycle
  • Payment link and hold
  • Cancellations
  • Webhooks
  • Sandbox

More

  • Changelog
data_objectOpenAPI 3.1
menu_bookIdempotencyexpand_more

Get started

  • Reseller API
  • Quickstart

Concepts

  • Authentication and modes
  • Errors
  • Idempotency
  • Rate limits
  • Pagination

Reference

  • Endpoints
  • Objects

Guides

  • Booking lifecycle
  • Payment link and hold
  • Cancellations
  • Webhooks
  • Sandbox

More

  • Changelog
data_objectOpenAPI 3.1

Concepts

Idempotency

How to retry bookings without duplicates using the Idempotency-Key header.

POST /bookings requires the Idempotency-Key header: a unique value for each booking you try to make (a UUID v4 works). If the network fails and you don't know whether the booking was created, retry with the same key and body.

RetryResult
Same key, same bodyThe stored response from the first time (same HTTP status and body). No second booking.
Same key, different body409 with idempotency_conflict. Use a new key for a different booking.
No key400 with idempotency_key_required.

Idempotency keys are scoped to the API key. Save yours with your order before calling Muvon:

js
// One key per booking attempt, saved with your order before calling Muvon
const idempotencyKey = order.muvonIdempotencyKey ?? (order.muvonIdempotencyKey = crypto.randomUUID());
await saveOrder(order);

const res = await fetch("https://api.muvon.mx/api/v1/bookings", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MUVON_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": idempotencyKey,
  },
  body: JSON.stringify(bookingRequest),
});
// On a timeout or a 5xx, send exactly the same request with the same key:
// you get the booking that was already made instead of a second one.
info

Quoting, retrieving and listing change nothing, so they can be retried freely.

arrow_backPreviousErrorsNextarrow_forwardRate limits