Skip to main content

Actions

The ballerinax/guidewire.insnow package exposes the following clients:

ClientPurpose
ClientProvides access to the Guidewire InsuranceNow REST API for applications, policies, claims, drivers, documents, and addresses.

Client

Provides access to the Guidewire InsuranceNow REST API for applications, policies, claims, drivers, documents, and addresses.

Configuration

FieldTypeDefaultDescription
authhttp:BearerTokenConfig|http:CredentialsConfigRequiredBearer token or username/password credentials for authentication.
httpVersionhttp:HttpVersionHTTP_2_0HTTP protocol version.
timeoutdecimal30Request timeout in seconds.
retryConfighttp:RetryConfig()Retry configuration for failed requests.
secureSockethttp:ClientSecureSocket()SSL/TLS configuration.
proxyhttp:ProxyConfig()Proxy server configuration.
compressionhttp:CompressionCOMPRESSION_AUTOCompression configuration for requests.
circuitBreakerhttp:CircuitBreakerConfig()Circuit breaker configuration.
validationbooleantrueEnable or disable payload validation.
laxDataBindingbooleantrueEnable lax data binding to ignore unmapped fields.

Initializing the client

import ballerinax/guidewire.insnow;

configurable string username = ?;
configurable string password = ?;
configurable string serviceUrl = ?;

insnow:Client insnowClient = check new (
{
auth: {
username: username,
password: password
}
},
serviceUrl
);

Operations

Address operations

Get supported countries

Retrieves the list of supported countries for address operations.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional request headers.
sortType"asc"|"desc"NoSort order for the results. Defaults to asc.

Returns: ListCountry|error

Sample code:

insnow:ListCountry countries = check insnowClient->/addresses/countries();

Sample response:

{
"items": [
{"isoCd": "US", "name": "United States"},
{"isoCd": "CA", "name": "Canada"}
]
}
Get country address template

Retrieves the address template for a specific country by its ISO code.

Parameters:

NameTypeRequiredDescription
isoCdstringYesISO country code (e.g., "US").
headersmap<string|string[]>NoOptional request headers.

Returns: AddressCountryTemplate|error

Sample code:

insnow:AddressCountryTemplate template = check insnowClient->/addresses/countries/["US"]();

Sample response:

{
"isoCd": "US",
"name": "United States",
"stateProvinces": {
"items": [
{"code": "CA", "name": "California"},
{"code": "NY", "name": "New York"}
]
}
}
Fill address from Google Places

Fills an address from a Google Places place ID.

Parameters:

NameTypeRequiredDescription
placeIdstringYesGoogle Places place ID.
headersmap<string|string[]>NoOptional request headers.

Returns: Address|error

Sample code:

insnow:Address address = check insnowClient->/addresses/googlePlacesFill(placeId = "ChIJN1t_tDeuEmsRUsoyG83frY4");

Sample response:

{
"addr1": "48 Pirrama Rd",
"city": "Pyrmont",
"stateProvCd": "NSW",
"postalCode": "2009",
"countryCd": "AU"
}
Verify address

Checks whether a given address is verified.

Parameters:

NameTypeRequiredDescription
payloadAddressYesThe address to verify.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/addresses/isVerifiedRequest.post({
addr1: "123 Main St",
city: "Springfield",
stateProvCd: "IL",
postalCode: "62701",
countryCd: "US"
});
Submit address verification request

Submits a batch address verification request.

Parameters:

NameTypeRequiredDescription
payloadListAddressYesList of addresses to verify.
addressType"Combined"|"Uncombined"NoAddress type for verification. Defaults to Combined.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/addresses/verificationRequest.post(
{
items: [
{
addr1: "123 Main St",
city: "Springfield",
stateProvCd: "IL",
postalCode: "62701",
countryCd: "US"
}
]
},
addressType = "Combined"
);

Application management

List applications

Retrieves a list of applications (quotes) with optional filtering by customer, status, or date.

Parameters:

NameTypeRequiredDescription
customerIdstringNoFilter by customer ID.
statusstringNoFilter by application status.
quoteNumberstringNoFilter by quote number.
limitstringNoMaximum number of results to return.
continuationIdstringNoContinuation ID for pagination.
createdSinceDatestringNoFilter applications created after this date.
masterQuoteRefstringNoFilter by master quote reference.
optionalFieldsstringNoComma-separated list of optional fields to include.
headersmap<string|string[]>NoOptional request headers.

Returns: ListApplication|error

Sample code:

insnow:ListApplication applications = check insnowClient->/applications(customerId = "CUST-001");

Sample response:

{
"items": [
{
"systemId": "APP-12345",
"quoteNumber": "Q-2024-001",
"status": "Draft",
"customerId": "CUST-001",
"productInfo": {"name": "Personal Auto"}
}
]
}
Create a new application

Creates a new quote or quick-quote application for a given customer.

Parameters:

NameTypeRequiredDescription
payloadQuoteYesThe quote payload containing application details.
customerIdstringYesThe customer ID to associate with the application.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications.post(
{
productInfo: {name: "Personal Auto"},
insured: {
nameInfo: {
givenName: "John",
surname: "Doe"
}
}
},
customerId = "CUST-001"
);
Delete an application

Deletes an application by its system ID.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application to delete.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"].delete();
Bind an application

Submits a bind request for an application, converting it to an active policy.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application to bind.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"]/bindRequest.post();
Convert to quote

Converts a quick-quote application into a full quote.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application to convert.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"]/convertToQuoteRequest.post();

Application documents

List application documents

Retrieves the list of documents attached to an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
headersmap<string|string[]>NoOptional request headers.

Returns: ListDocument|error

Sample code:

insnow:ListDocument docs = check insnowClient->/applications/["APP-12345"]/documents();

Sample response:

{
"items": [
{
"documentId": "DOC-001",
"name": "Application Form",
"mimeType": "application/pdf",
"createdDate": "2024-01-15T10:30:00Z"
}
]
}
Attach document to application

Attaches a document to an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
payloadAttachmentYesThe attachment payload including file content and metadata.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"]/documents.post({
name: "drivers_license.pdf",
mimeType: "application/pdf",
content: encodedContent
});
Delete application document

Deletes a document from an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
documentIdstringYesThe document ID to delete.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"]/documents/["DOC-001"].delete();
Get application document content

Downloads the binary content of a document attached to an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
documentIdstringYesThe document ID to download.
headersmap<string|string[]>NoOptional request headers.

Returns: byte[]|error

Sample code:

byte[] content = check insnowClient->/applications/["APP-12345"]/documents/["DOC-001"]/content();

Sample response:

<binary content of the document>

Driver management

List drivers

Retrieves the list of drivers on an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
typeCd"Driver"|"NonDriver"NoFilter by driver type.
continuationIdstringNoContinuation ID for pagination.
limitstringNoMaximum number of results to return.
includeDeletedstringNoWhether to include deleted drivers.
headersmap<string|string[]>NoOptional request headers.

Returns: ListDriver|error

Sample code:

insnow:ListDriver drivers = check insnowClient->/applications/["APP-12345"]/drivers(typeCd = "Driver");

Sample response:

{
"items": [
{
"driverNumber": 1,
"typeCd": "Driver",
"nameInfo": {"givenName": "John", "surname": "Doe"},
"licenseNumber": "D1234567",
"licenseStateCd": "CA"
}
]
}
Add driver to application

Adds a new driver to an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
payloadDriverYesThe driver details.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"]/drivers.post({
typeCd: "Driver",
nameInfo: {givenName: "Jane", surname: "Smith"},
licenseNumber: "S9876543",
licenseStateCd: "NY"
});
Get driver by number

Retrieves a specific driver from an application by driver number.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
driverNumberint:Signed32YesThe driver number.
headersmap<string|string[]>NoOptional request headers.

Returns: Driver|error

Sample code:

insnow:Driver driver = check insnowClient->/applications/["APP-12345"]/drivers/[1]();

Sample response:

{
"driverNumber": 1,
"typeCd": "Driver",
"nameInfo": {"givenName": "John", "surname": "Doe"},
"licenseNumber": "D1234567",
"licenseStateCd": "CA",
"dateOfBirth": "1985-06-15"
}
Replace driver

Replaces a driver record on an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
driverNumberint:Signed32YesThe driver number to replace.
payloadDriverYesThe updated driver details.
headersmap<string|string[]>NoOptional request headers.

Returns: Driver|error

Sample code:

insnow:Driver updated = check insnowClient->/applications/["APP-12345"]/drivers/[1].put({
typeCd: "Driver",
nameInfo: {givenName: "John", surname: "Doe"},
licenseNumber: "D1234567",
licenseStateCd: "TX"
});

Sample response:

{
"driverNumber": 1,
"typeCd": "Driver",
"nameInfo": {"givenName": "John", "surname": "Doe"},
"licenseNumber": "D1234567",
"licenseStateCd": "TX"
}
Update driver fields

Partially updates specific fields on a driver record.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
driverNumberint:Signed32YesThe driver number to update.
payloadDriverYesThe fields to update.
headersmap<string|string[]>NoOptional request headers.

Returns: Driver|error

Sample code:

insnow:Driver patched = check insnowClient->/applications/["APP-12345"]/drivers/[1].patch({
licenseStateCd: "FL"
});

Sample response:

{
"driverNumber": 1,
"typeCd": "Driver",
"nameInfo": {"givenName": "John", "surname": "Doe"},
"licenseNumber": "D1234567",
"licenseStateCd": "FL"
}
Delete driver

Removes a driver from an application.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the application.
driverNumberint:Signed32YesThe driver number to delete.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/applications/["APP-12345"]/drivers/[1].delete();

Claims

List claim documents

Retrieves the list of documents attached to a claim.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the claim.
headersmap<string|string[]>NoOptional request headers.

Returns: ListDocument|error

Sample code:

insnow:ListDocument claimDocs = check insnowClient->/claims/["CLM-56789"]/documents();

Sample response:

{
"items": [
{
"documentId": "DOC-100",
"name": "Accident Report",
"mimeType": "application/pdf",
"createdDate": "2024-02-20T14:00:00Z"
}
]
}
Attach document to claim

Attaches a document to a claim.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the claim.
payloadDocumentDetailYesThe document detail payload.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/claims/["CLM-56789"]/documents.post({
name: "police_report.pdf",
mimeType: "application/pdf",
content: encodedContent
});
List claim notes

Retrieves the list of notes on a claim.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the claim.
headersmap<string|string[]>NoOptional request headers.

Returns: ListNote|error

Sample code:

insnow:ListNote notes = check insnowClient->/claims/["CLM-56789"]/notes();

Sample response:

{
"items": [
{
"noteId": "NOTE-001",
"subject": "Initial Assessment",
"body": "Reviewed damage photos. Estimated repair cost: $3,500.",
"createdDate": "2024-02-21T09:15:00Z",
"author": "[email protected]"
}
]
}
Add note to claim

Adds a note to a claim.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the claim.
payloadNoteDetailYesThe note detail payload.
headersmap<string|string[]>NoOptional request headers.

Returns: error?

Sample code:

check insnowClient->/claims/["CLM-56789"]/notes.post({
subject: "Follow-up",
body: "Contacted insured to schedule inspection."
});

Policy operations

List policies

Retrieves a list of policies with optional filtering by customer, status, or policy number.

Parameters:

NameTypeRequiredDescription
customerIdstringNoFilter by customer ID.
policyNumberstringNoFilter by policy number.
statusstringNoFilter by policy status.
limitstringNoMaximum number of results to return.
continuationIdstringNoContinuation ID for pagination.
createdSinceDatestringNoFilter policies created after this date.
providerRefstringNoFilter by provider reference.
recentlyViewedstringNoFilter recently viewed policies.
expiredDateAfterstringNoFilter policies expiring after this date.
includePriorTermsstringNoWhether to include prior term data.
optionalFieldsstringNoComma-separated list of optional fields to include.
headersmap<string|string[]>NoOptional request headers.

Returns: ListPolicy|error

Sample code:

insnow:ListPolicy policies = check insnowClient->/policies(customerId = "CUST-001");

Sample response:

{
"items": [
{
"systemId": "POL-99001",
"policyNumber": "PA-2024-00123",
"status": "Active",
"effectiveDate": "2024-01-01",
"expirationDate": "2025-01-01",
"productInfo": {"name": "Personal Auto"}
}
]
}
Get policy details

Retrieves detailed information about a specific policy.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the policy.
optionalFieldsstringNoComma-separated list of optional fields to include.
headersmap<string|string[]>NoOptional request headers.

Returns: PolicyDetails|error

Sample code:

insnow:PolicyDetails policy = check insnowClient->/policies/["POL-99001"]();

Sample response:

{
"systemId": "POL-99001",
"policyNumber": "PA-2024-00123",
"status": "Active",
"effectiveDate": "2024-01-01",
"expirationDate": "2025-01-01",
"productInfo": {"name": "Personal Auto"},
"insured": {
"nameInfo": {"givenName": "John", "surname": "Doe"}
},
"totalPremium": 1250.00
}
Update policy

Partially updates a policy's details.

Parameters:

NameTypeRequiredDescription
systemIdstringYesThe system ID of the policy to update.
payloadPolicyDetailsYesThe fields to update on the policy.
headersmap<string|string[]>NoOptional request headers.

Returns: PolicyDetails|error

Sample code:

insnow:PolicyDetails updated = check insnowClient->/policies/["POL-99001"].patch({
insured: {
nameInfo: {givenName: "John", surname: "Doe-Smith"}
}
});

Sample response:

{
"systemId": "POL-99001",
"policyNumber": "PA-2024-00123",
"status": "Active",
"insured": {
"nameInfo": {"givenName": "John", "surname": "Doe-Smith"}
}
}