Clarification on Individual verses Company Customer

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
tonyo
Posts: 30
Joined: Sat Jul 29, 2023 9:29 pm

Clarification on Individual verses Company Customer

Post by tonyo » Mon Jan 22, 2024 11:59 pm

In the API Documentation for "Retrieve details for a specific job" it mentions Company Customers as those having a value for Company Name.

When I create an individual customer, Simpro populates the Company Name for the Individual Customer with the family name, a comma and then the given name.

And this derived Company Name is returned when I lookup a job using: /api/v1.0/companies/{companyID}/jobs/{jobID}

The api documentation shows me two ways to lookup a customer, one for individual and another for company. Do these lookups work interchangeably ?

/api/v1.0/companies/{companyID}/customers/companies/{customerID}

/api/v1.0/companies/{companyID}/customers/individuals/{customerID}

If not, is there an api call that will work for either type of customer?
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Clarification on Individual verses Company Customer

Post by Sindre » Wed Jan 24, 2024 3:46 am

Hi tonyo,
When you create an individual customer the fields change to Title, First Name and Last Name. If you select to create a company customer the first fields to fill in are Company Name and ABN.

If you want to retrieve all customers you can use the endpoint:

Code: Select all

/api/v1.0/companies/{companyID}/customers/
The other endpoints /customers/individuals/ and /customers/companies/ will only return individual or company profiles.

Regards
Sindre
API Developer | Simpro Software Group
tonyo
Posts: 30
Joined: Sat Jul 29, 2023 9:29 pm

Re: Clarification on Individual verses Company Customer

Post by tonyo » Wed Jan 24, 2024 6:02 pm

Thanks.

I mainly lookup, in this case, the customer to get access to a custom field, if I look up an individual customer using

/api/v1.0/companies/{companyID}/customers/companies/{customerID}

Will I get a successful response (albeit with the company profile data) or will I get a 404?
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Clarification on Individual verses Company Customer

Post by Sindre » Wed Jan 24, 2024 11:13 pm

Hi,
This can easily be tested on the /customers/companies/ endpoint. It will give you a 404 as the ID is not found as a company customer.

Regards
Sindre
API Developer | Simpro Software Group
tonyo
Posts: 30
Joined: Sat Jul 29, 2023 9:29 pm

Re: Clarification on Individual verses Company Customer

Post by tonyo » Thu Jan 25, 2024 6:26 pm

Thanks, is there any way to get a customer regardless of whether it's individual or company?

an expansion on your answer below?

If you want to retrieve all customers you can use the endpoint:

/api/v1.0/companies/{companyID}/customers/
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Clarification on Individual verses Company Customer

Post by Sindre » Sun Jan 28, 2024 11:40 pm

Hi,
The common endpoint for company and individual customers is only list view and does not have details.

You can provide an customer ID if you have this and it will return the href pointing to the right endpoint looking like this:

Code: Select all

/api/v1.0/companies/{companyID}/customers/companies/{id}
which you can use to get more info.

If you have the company or individual name you can add this as a parameter to find the right customer ID. For this to work you must know if you are looking for a company or individual name. For example

Code: Select all

/customers/?CompanyName={companyName}
This will provide the same href as adding the customer id.

To get detailed information on a customer you must know if it's a company or individual and use the respective endpoints.

I hope this is helpful.

Regards
Sindre
API Developer | Simpro Software Group
Post Reply