Retrieving customer via API

Hi, I am interfacing ServiceM8 to Microsoft Dynamics business central.

I am about to create a new customer in BC and am retrieving the info for a client.

My client record looks like….

However, when I retrieve the info via Power automate the returned data looks like…

The address does not appear to be split into street, city etc.

When I created the customer (Well actually updated the customer after creating a quote job, I started entering the address and the system (correctly) validated the address (I presume using the addressfinder end point - the address however is all stored into the address street.

Can you advise - is this a Bug or feature?

Stan

Hi Stan,

In our REST API, a client record is retrieved from the Company endpoint: GET https://api.servicem8.com/api_1.0/company/{uuid}.json.

The Company record includes both a single “address” string (and “billing_address”) and separate fields for address_street, address_city, address_state, address_postcode, and address_country (these address fields are optional on the record).

If your response is only showing a value in address_street, it’s worth checking whether the other address_* fields have been populated for that client, because the API supports setting those fields when you create (POST /company.json) or update (POST /company/{uuid}.json) a client.

If what you’re syncing into Business Central is the job’s service address instead, the Job record stores the entered address in job_address (single string) and also provides geocoded components as read-only geo_* fields such as geo_city, geo_state, geo_postcode, geo_country, geo_street, and geo_number.

Reply here with whether you’re calling /company/{uuid}.json or /job/{uuid}.json in Power Automate and we’ll confirm the best fields to use.

Thanks,
Cody

Hi Cody,

The process I use has minimal information supplied by a web lead.

I get the customer name, the suburb, email address and phone number.

first I create a Client record - the address is the suburb passed in for web lead

Then client contact with phone numbers and email

Then the quote - again with the address being the passed in suburb.

finally a quote contact (fundimentally identical to client contact).

It appears that when the client is created via API, because I have populated the address, once a personal manually updates the client address, the back end logic does not split the address.

Stan

Hi Stan,

In the REST API, a Client (Company) record supports both a single free-form address string and separate address component fields, so it’s normal to see the address come back “unsplit” if those component fields aren’t populated.

A couple of practical options for your Business Central sync:

  1. Populate the split Company address fields yourself (recommended if BC needs separate fields)
  • When you create or update the client via the API, send address_street, address_city, address_state, address_postcode, and address_country (and optionally the single address string as well).
  1. If you’re basing the address off the Job address, use the job’s geocoded components
  • The Job record stores the entered address in job_address, and then returns geocoded components like geo_city, geo_state, geo_postcode, geo_country, geo_street, and geo_number (with geo_is_valid indicating whether the geocoding was successful).

If you email support@servicem8.com with one example Company UUID and the JSON you used to create/update it (no customer names needed), we can confirm whether anything unusual is happening with how the app is saving the address fields in your scenario.

Thanks,
Cody

Hi Cody,

Our business process creates a lead via a web site. The only information available is the name, the suburb, the email and contact number.

From this I have to create a quote job.

This is the data retrieved from a job (#146)

I added the job with the address just being the suburb (Lake Haven) – Then I updated the job address to a full address.

Note that the address has been split up now;

[

{

“uuid”: “15ea6e46-88f9-4de8-9195-23e26df603dd”,

“active”: 1,

“date”: “2026-02-26 00:00:00”,

“job_address”: “151 Lake Haven Drive\nLake Haven NSW 2263”,

“billing_address”: “Lake haven”,

“status”: “Quote”,

“quote_date”: “2026-02-26 10:10:51”,

“work_order_date”: “0000-00-00 00:00:00”,

“work_done_description”: “”,

“generated_job_id”: “146”,

“completion_date”: “0000-00-00 00:00:00”,

“completion_actioned_by_uuid”: “”,

“unsuccessful_date”: “0000-00-00 00:00:00”,

“payment_date”: “0000-00-00 00:00:00”,

“payment_method”: “”,

“payment_amount”: 0,

“payment_actioned_by_uuid”: “”,

“edit_date”: “2026-02-26 10:14:17”,

“payment_note”: “”,

“ready_to_invoice”: “0”,

“ready_to_invoice_stamp”: “0000-00-00 00:00:00”,

“company_uuid”: “8fe3fa42-c5b7-4a6c-8aba-23e2688fc44b”,

“geo_is_valid”: 1,

“lng”: 151.5023225,

“lat”: -33.2419042,

“geo_country”: “Australia”,

“geo_postcode”: “2263”,

“geo_state”: “NSW”,

“geo_city”: “Lake Haven”,

“geo_street”: “Lake Haven Drive”,

“geo_number”: “151”,

“payment_processed”: 0,

“payment_processed_stamp”: “0000-00-00 00:00:00”,

“payment_received”: 0,

“payment_received_stamp”: “0000-00-00 00:00:00”,

“total_invoice_amount”: “0.0000”,

“job_is_scheduled_until_stamp”: “0000-00-00 00:00:00”,

“category_uuid”: “”,

“queue_uuid”: “”,

“queue_expiry_date”: “0000-00-00 00:00:00”,

“badges”: “”,

“quote_sent”: false,

“invoice_sent”: false,

“purchase_order_number”: “”,

“invoice_sent_stamp”: “0000-00-00 00:00:00”,

“queue_assigned_staff_uuid”: “”,

“quote_sent_stamp”: “0000-00-00 00:00:00”,

“customfield_buzguid”: “”,

“customfield_senttowiise”: “”,

“customfield_wiiseorderno”: “”,

“customfield_buzordername”: “”,

“customfield_sendtowiise”: “”,

“customfield_duedate”: “0000-00-00”,

“job_description”: “”,

“created_by_staff_uuid”: “52348825-373a-4b81-bc09-23af699e4f0b”

}

]

The next step is to update the company/Client address

Here it is after entering the job and auto creating the client

{

“uuid”: “8fe3fa42-c5b7-4a6c-8aba-23e2688fc44b”,

“edit_date”: “2026-02-26 10:12:32”,

“name”: “Neal Stephenson”,

“website”: “”,

“abn_number”: “”,

“address”: “Lake haven”,

“address_street”: “Lake haven”,

“address_city”: “”,

“address_state”: “”,

“address_postcode”: “”,

“address_country”: “”,

“billing_address”: “Lake haven”,

“active”: 1,

“is_individual”: 1,

“badges”: “”,

“fax_number”: “”,

“tax_rate_uuid”: “”,

“billing_attention”: “0”,

“payment_terms”: “”,

“customfield_wiisecustomerno”: “”

}

SO now I go into the client (After copying the address from the job), pasting the address (has light blue popup from I assume address finder) asking if address is correct – I click yes, then hit save.

Now if I retrieve the data it looks like….

{

“uuid”: “8fe3fa42-c5b7-4a6c-8aba-23e2688fc44b”,

“edit_date”: “2026-02-26 10:23:48”,

“name”: “Neal Stephenson”,

“website”: “”,

“abn_number”: “”,

“address”: “151 Lake Haven Dr,\nLake Haven NSW 2263”,

“address_street”: “Lake haven”,

“address_city”: “”,

“address_state”: “”,

“address_postcode”: “”,

“address_country”: “”,

“billing_address”: “Lake haven”,

“active”: 1,

“is_individual”: 1,

“badges”: “”,

“fax_number”: “”,

“tax_rate_uuid”: “”,

“billing_attention”: “0”,

“payment_terms”: “”,

“customfield_wiisecustomerno”: “”

}

The field address is populated however it has not been split up into components.

SO the behaviour is inconsistent – on the job if you update the address it is split into components however if you update the address in a client, it does not get split up.

Note – there was not API used to create the above test job/client – it was all done thru the ServiceM8 web site, The only API used was to retrieve the data (Power automate flow)

Stan

Hi Stan,

What you’re seeing on the Job is expected, because Jobs expose geocoded address component fields (geo_city/geo_state/geo_postcode/geo_country/geo_street/geo_number) that are automatically populated when an address is geocoded.

Those geo_* fields are read-only on the Job record, and geo_is_valid indicates whether the geocoding result is valid (if it’s false, the lat, lng, and other geo_ fields should not be used).

Client (Company) records are different: the Client endpoint returns a free-form address string (address) and separate address component fields (address_street/address_city/address_state/address_postcode/address_country), but there’s no equivalent set of auto-geocoded geo_* component fields on the Client record.

If Business Central needs split address fields, the API-supported approach is to explicitly write the component values into the Client record using the Update a Client endpoint (POST /company/{uuid}.json), which accepts address_street/address_city/address_state/address_postcode/address_country in the payload.

Email support@servicem8.com with one example Job UUID and Company UUID (no customer names needed) and we’ll confirm whether anything unexpected is happening in your specific workflow.

Thanks,
Cody