Skip to main content

Delete Booking from Draft API

Introduction​

Removes a booking from an invoice draft via InvoiceService.removeBookingFromDraft(bookingId, tenantId), and records an activity log describing the booking id and parent invoice number.

Source: InvoiceHomePageAPI.deleteBookingFromDraft (@Path("invoicehome")).

See also: Invoice Home — all endpoints.


HTTP Endpoint​

PropertyValue
URL/rest/invoicehome/deleteBookingFromDraft
MethodPOST
ConsumesRaw JSON body
Producestext/plain (JSON string entity)

Request Body (JSON)​

FieldTypeRequiredDescription
userNameStringYesAuth username.
authKeyStringYesAuth key.
branchStringYesParsed; unused after auth in current code.
userIdStringYesActing user for activity log.
bookingIdStringYesBooking to remove from the draft.
invoiceNoStringYesInvoice number included in the activity message.

Authentication​

ConditionHTTP status
Invalid credentials401 Unauthorized (Access-Control-Allow-Origin: *)
Success200 OK

Behaviour​

  1. Validates auth.
  2. removeBookingFromDraft(bookingId, tenantId).
  3. saveLatestActivity with message: removed booking from invoice.

Response​

Code: 200 OK

Body (JSON string):

{"deleted":true}

or

{"deleted":false}

Headers: Access-Control-Allow-Origin: *


Example Request​

POST /rest/invoicehome/deleteBookingFromDraft HTTP/1.1
Host: {base}
Content-Type: application/json

{
"userName": "alice",
"authKey": "secretKey",
"branch": "default",
"userId": "42",
"bookingId": "BK-100",
"invoiceNo": "DRAFT-INV-1"
}