Searching for accounts
Sometimes, a caller application may need to access a specific account, but it does not know
the account's ID or enough information about the account to retrieve it using the GET
/accounts
endpoint directly. In these cases, the caller application can use
the following endpoints to search for the account.
- POST
/account/v1/search/accounts
- POST
/account/v1/search/accounts-freetext
Searching for accounts
When using the /account/v1/search/accounts
endpoint, the request object
must include a body. The body must specify at least one of the following search parameters
using the following syntax:
Note the following requirements and restrictions:
- The request object must include at least one of the required parameters.
- There are also optional search parameters that can be added. For a complete list, refer to the API definition of the endpoint.
- When searching by
companyName
:- The request object cannot include
firstName
orlastName
. - The search returns only accounts where the account holder is an exact match of the named company.
- The request object cannot include
- When searching by first and last name:
- The request object must include both
firstName
andlastName
. - The request object must omit
companyName
. - The search returns only accounts where the account holder is an exact match of the named person.
- The request object must include both
For example, the following payload will query for all accounts with account number C000143542:
The following payload will query for all accounts where the account holder has a first name of "Ray" and a last name of "Newton":
Searching by producer
The /account/v1/search/accounts
endpoint allows you to search using two
criteria pertaining to producers: producerCode
and
organization
.
If you know a producer's code, you can search for all accounts associated with that
producer by including producerCode
as a search criteria. For example, the
following searches for accounts associated with producer code pc:16 (ACV Property
Insurance).
In the base configuration, producers are stored in the Organization
entity. If you know a producer's ID, you can search for accounts associated with that
producer by including the organization
as search criteria. For example, the
following searches for accounts associated with the producer whose id is pc:4 (ACV Property
Insurance).
Providing no search parameters
PolicyCenter will not execute an account search with no query parameters. If you attempt to execute an account search without query parameters, either from the user interface or through Cloud API, PolicyCenter returns the following error message:
Note that this message is intended primarily for user interface account searches. This is why it makes reference to partial matches and a minimum number of required letters.
Searching in Japanese
The search endpoint also supports certain Japanese locale-specific fields:
companyNameKanji
: Complete company name, in JapanesefirstNameKanji
: Complete first name, in Japanese. Can be used in combination withfirstName
orlastNameKanji.
lastNameKanji
: Complete last name, in Japanese. Can be used in combination withlastName
orfirstNameKanji
.particle
: Particle used in account holder names (matching theparticle
property of anAccountContact
resource)
The following code block is a request body for a search based on first name and first name in Japanese:
Searching for accounts using free-text search
The POST /account/v1/search/accounts-freetext
endpoint can be used if
free-text search is enabled and the Guidewire Solr Extension is set up. Additionally,
the FreeTextSearchEnabled
configuration parameter must be set to
true.
The request for a free-text account search must include search parameters in the body.
For example, to search for an account where the account holder is named Ray Newton, the request would look like this:
Request body
The search returns an list of accounts that were found. The response object looks like this:
producerCode
as a search parameter,
PolicyCenter checks to see if the user has access to that producer code. If the user
does not have access to the producer code, a 400 error is returned.