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?
Clarification on Individual verses Company Customer
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.
Re: Clarification on Individual verses Company Customer
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:
The other endpoints /customers/individuals/ and /customers/companies/ will only return individual or company profiles.
Regards
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/
Regards
Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
Re: Clarification on Individual verses Company Customer
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?
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?
Re: Clarification on Individual verses Company Customer
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
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
API Developer | Simpro Software Group
Re: Clarification on Individual verses Company Customer
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/
an expansion on your answer below?
If you want to retrieve all customers you can use the endpoint:
/api/v1.0/companies/{companyID}/customers/
Re: Clarification on Individual verses Company Customer
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: 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
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
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}
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}
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
API Developer | Simpro Software Group