Skip to main content

Change Customer from Invoicing API

Introduction​

Updates the customer name and id on an invoicing row for a given booking id via InvoiceService.changeCustomerNameFromInvoicing(customerName, customerId, bookingId, tenantId). The JSON property name is customerId. On success, logs activity for the booking.

Source: InvoiceHomePageAPI.changeCustomerNameFromInvoicing (@Path("changeCustomerFromInvoicing")).

See also: Invoice Home — all endpoints.


HTTP Endpoint​

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

Request Body (JSON)​

FieldTypeRequiredDescription
userIdStringYesActing user for activity log.
customerNameStringYesNew display name.
customerIdStringYesNew customer id.
bookingIdStringYesBooking row to update.
userNameStringYesAuth username.
authKeyStringYesAuth key.

Authentication​

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

Behaviour​

deleted = invoiceService.changeCustomerNameFromInvoicing(...) — the response field is named deleted but semantically indicates whether the update succeeded, not a delete operation.


Response​

Code: 200 OK

Body (JSON string):

{"deleted":true}

or

{"deleted":false}

Headers: Access-Control-Allow-Origin: *


Example Request​

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

{
"userId": "42",
"customerName": "Acme Logistics Sdn Bhd",
"customerId": "CUST-NEW",
"bookingId": "BK-500",
"userName": "alice",
"authKey": "secretKey"
}