Auto-Fill Customer Address API
Introduction
Loads a Customer by id for the current tenant, serialises it to JSON with Gson using SpecificClassExclusionStrategy (to omit configured types), then augments the object with mailId and attnName from the primary finance contact (TmsConstants.CUSTOMER_FINANCE_TYPECODE_PRIMARY) when available. Used to pre-fill invoice / customer panels in the UI.
Source: InvoiceHomePageAPI.autoFillCustomerAddress (@Path("invoicehome")).
See also: Invoice Home — all endpoints.
Security note
No checkIfAuthKeyIsValid call. officeBranch and authKey are path placeholders only.
HTTP Endpoint
| Property | Value |
|---|---|
| URL | /rest/invoicehome/autoFillCustomerAddress/{customerId}/{officeBranch}/{authKey} |
| Method | GET |
| Produces | text/plain (entity is a JSON string wrapping customer data) |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
customerId | String | Yes | Customer identifier passed to CustomerService.getCustomerDetails. |
officeBranch | String | Yes | URL convention (e.g. default); unused in handler. |
authKey | String | Yes | URL convention; unused in handler. |
Behaviour
customerService.getCustomerDetails(customerId, tenantId).GsonBuilder+SpecificClassExclusionStrategy→ JSON object.- Iterates
customer.getCustomerFinance(); for primary type code, sets:mailIdfromfinanceTeam.getMail()if non-nullattnNamefromfinanceTeam.getFullName()if non-null
- Wraps result:
{"data": { ... }}.
Success Response
Code: 200 OK
Body (JSON string):
{
"data": {
"id": "...",
"customerName": "...",
"mailId": "billing@example.com",
"attnName": "Accounts Payable",
"...": "other Customer fields per Gson exclusion rules"
}
}
Headers: Access-Control-Allow-Origin: *
Errors
ParseException / IllegalAccessException / InvocationTargetException are declared on the method; framework or wrapper behaviour determines HTTP mapping if they propagate.
Example Request
GET /rest/invoicehome/autoFillCustomerAddress/CUST01/default/98237942 HTTP/1.1
Host: {base}