Actions
The ballerinax/guidewire.insnow package exposes the following clients:
| Client | Purpose |
|---|---|
Client | Provides 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
| Field | Type | Default | Description |
|---|---|---|---|
auth | http:BearerTokenConfig|http:CredentialsConfig | Required | Bearer token or username/password credentials for authentication. |
httpVersion | http:HttpVersion | HTTP_2_0 | HTTP protocol version. |
timeout | decimal | 30 | Request timeout in seconds. |
retryConfig | http:RetryConfig | () | Retry configuration for failed requests. |
secureSocket | http:ClientSecureSocket | () | SSL/TLS configuration. |
proxy | http:ProxyConfig | () | Proxy server configuration. |
compression | http:Compression | COMPRESSION_AUTO | Compression configuration for requests. |
circuitBreaker | http:CircuitBreakerConfig | () | Circuit breaker configuration. |
validation | boolean | true | Enable or disable payload validation. |
laxDataBinding | boolean | true | Enable 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Optional request headers. |
sortType | "asc"|"desc" | No | Sort 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:
| Name | Type | Required | Description |
|---|---|---|---|
isoCd | string | Yes | ISO country code (e.g., "US"). |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
placeId | string | Yes | Google Places place ID. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Address | Yes | The address to verify. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ListAddress | Yes | List of addresses to verify. |
addressType | "Combined"|"Uncombined" | No | Address type for verification. Defaults to Combined. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
customerId | string | No | Filter by customer ID. |
status | string | No | Filter by application status. |
quoteNumber | string | No | Filter by quote number. |
limit | string | No | Maximum number of results to return. |
continuationId | string | No | Continuation ID for pagination. |
createdSinceDate | string | No | Filter applications created after this date. |
masterQuoteRef | string | No | Filter by master quote reference. |
optionalFields | string | No | Comma-separated list of optional fields to include. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Quote | Yes | The quote payload containing application details. |
customerId | string | Yes | The customer ID to associate with the application. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application to delete. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application to bind. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application to convert. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
payload | Attachment | Yes | The attachment payload including file content and metadata. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
documentId | string | Yes | The document ID to delete. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
documentId | string | Yes | The document ID to download. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
typeCd | "Driver"|"NonDriver" | No | Filter by driver type. |
continuationId | string | No | Continuation ID for pagination. |
limit | string | No | Maximum number of results to return. |
includeDeleted | string | No | Whether to include deleted drivers. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
payload | Driver | Yes | The driver details. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
driverNumber | int:Signed32 | Yes | The driver number. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
driverNumber | int:Signed32 | Yes | The driver number to replace. |
payload | Driver | Yes | The updated driver details. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
driverNumber | int:Signed32 | Yes | The driver number to update. |
payload | Driver | Yes | The fields to update. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the application. |
driverNumber | int:Signed32 | Yes | The driver number to delete. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the claim. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the claim. |
payload | DocumentDetail | Yes | The document detail payload. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the claim. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the claim. |
payload | NoteDetail | Yes | The note detail payload. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
customerId | string | No | Filter by customer ID. |
policyNumber | string | No | Filter by policy number. |
status | string | No | Filter by policy status. |
limit | string | No | Maximum number of results to return. |
continuationId | string | No | Continuation ID for pagination. |
createdSinceDate | string | No | Filter policies created after this date. |
providerRef | string | No | Filter by provider reference. |
recentlyViewed | string | No | Filter recently viewed policies. |
expiredDateAfter | string | No | Filter policies expiring after this date. |
includePriorTerms | string | No | Whether to include prior term data. |
optionalFields | string | No | Comma-separated list of optional fields to include. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the policy. |
optionalFields | string | No | Comma-separated list of optional fields to include. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
systemId | string | Yes | The system ID of the policy to update. |
payload | PolicyDetails | Yes | The fields to update on the policy. |
headers | map<string|string[]> | No | Optional 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"}
}
}