04 Replace quote

View as Markdown
Replaces an existing quote and reprices it. Same validation shape as **03 Create quote**. **This is a full replace, not a partial update.** Everything you omit is dropped, not preserved. Send the complete booking every time. ### What a replace resets | Field | Effect | | --- | --- | | `ref_no` | **Regenerated unless you send the existing one back.** The example echoes `{{booking_ref}}`, which `03 Create quote` captures for you. | | `status` | Forced back to `quote`, even for a booking you already confirmed. | | `billing.status` | Reset to `0` (unpaid), even if it was invoiced. | | `expires_on` | Reset to one week from now. | | journeys, stops, services, passengers | Rewritten from the payload. | | price | Recalculated from current rates, not carried over. | Because a confirmed booking silently drops back to `quote` with its billing cleared, do not replace one after checkout unless you intend exactly that. Nothing is refunded and no email is sent. `confirm` is still `required|boolean` here, and is ignored outright on this endpoint. ### Responses | Status | `error_code` | When | | --- | --- | --- | | `200` | — | Replaced. `message` is `Booking Updated successfully!` | | `422` | `validation_failed` | Payload problems, including an unknown booking id or one belonging to another company, which reports as `errors.id`. | | `409` | `booking_cancelled` | The booking is cancelled. Terminal, do not retry. | | `401` | `unauthenticated` | Bearer token missing, invalid or expired. | | `500` | `server_error` | Our fault. Nothing was changed. | Another company's booking is deliberately indistinguishable from one that does not exist. Ids you send for `journeys[].id` and `stops[].id` are honoured only when they already belong to this booking. Anything else is treated as a new row rather than being adopted.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects a string.

Response

OK
messagestring
statusinteger
responseTimestring
tracelist of any
dataobject

Errors

422
Unprocessable Entity Error