Full Quote Lifecycle Workflow
This guide covers the complete quote lifecycle workflow, from initial submission through to policy conversion.
Overview
The full quote lifecycle provides comprehensive quote management capabilities:
- Product Information - Retrieve available insurance products
- Quote Submission - Submit detailed insurance quotes (XML or JSON format)
- Quote Management - Override pricing, add addons, retrieve quotes
- Document Generation - Generate policy documents
- Quote Acceptance - Convert quotes to policies
This approach is ideal for:
- Agency management systems
- Full-featured quote platforms
- Scenarios requiring quote modification and tracking
- Complete policy lifecycle management
Base URL
https://api.assistinsurances.ie
Prerequisites
- API credentials (client ID and secret)
- Understanding of XML or JSON quote formats
- Familiarity with OAuth 2.0
Contact neil.reilly@assistinsurances.ie to obtain your API credentials.
Authentication
The API accepts tokens in both form-encoded and JSON formats for convenience.
- Form-Encoded (Standard)
- JSON (Convenience)
curl -X POST "https://api.assistinsurances.ie/auth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=api://1c15f5fa-f434-401b-b4ec-ab3ea75d48bb/assist-api-gateway/.default" \
-d "grant_type=client_credentials"
curl -X POST "https://api.assistinsurances.ie/auth/token" \
-H "Content-Type: application/json" \
-d '{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"scope": "api://1c15f5fa-f434-401b-b4ec-ab3ea75d48bb/assist-api-gateway/.default",
"grant_type": "client_credentials"
}'
Response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"token_type": "Bearer",
"expires_in": 3599
}
Complete Integration Example
- JavaScript
- Python
class QuoteLifecycleClient {
constructor(clientId, clientSecret) {
this.clientId = clientId;
this.clientSecret = clientSecret;
this.baseUrl = 'https://api.assistinsurances.ie';
this.token = null;
this.tokenExpiresAt = null;
}
async getAccessToken() {
if (this.token && this.tokenExpiresAt > Date.now() + 300000) {
return this.token;
}
const response = await fetch(`${this.baseUrl}/auth/token`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
client_id: this.clientId,
client_secret: this.clientSecret,
scope: 'api://1c15f5fa-f434-401b-b4ec-ab3ea75d48bb/assist-api-gateway/.default',
grant_type: 'client_credentials',
}),
});
const data = await response.json();
this.token = data.access_token;
this.tokenExpiresAt = Date.now() + (data.expires_in * 1000);
return this.token;
}
async getOptions() {
const token = await this.getAccessToken();
const response = await fetch(`${this.baseUrl}/applied/options`, {
headers: { 'Authorization': `Bearer ${token}` },
});
return response.json();
}
async submitQuote(xmlQuote) {
const token = await this.getAccessToken();
const response = await fetch(`${this.baseUrl}/applied/quote/quote`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/xml',
},
body: xmlQuote,
});
return response.json();
}
async getQuote(quoteId) {
const token = await this.getAccessToken();
const response = await fetch(
`${this.baseUrl}/applied/quote/${encodeURIComponent(quoteId)}`,
{
headers: { 'Authorization': `Bearer ${token}` },
}
);
return response.json();
}
async overrideQuote(quoteId, overrideType, value, reason) {
const token = await this.getAccessToken();
const response = await fetch(`${this.baseUrl}/applied/quote/override`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
quoteId,
overrideType,
value,
reason,
}),
});
return response.json();
}
async addAddon(quoteId, addonType, addonOptions = {}) {
const token = await this.getAccessToken();
const response = await fetch(`${this.baseUrl}/applied/quote/addon`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
quoteId,
addonType,
addonOptions,
}),
});
return response.json();
}
async generateDocuments(quoteId, documentTypes) {
const token = await this.getAccessToken();
const response = await fetch(
`${this.baseUrl}/applied/documentgeneration/generateDocuments`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
quoteId,
documentTypes,
}),
}
);
return response.json();
}
async acceptQuote(quoteId, paymentMethod, paymentReference) {
const token = await this.getAccessToken();
const response = await fetch(`${this.baseUrl}/applied/accept`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
quoteId,
paymentMethod,
paymentReference,
}),
});
return response.json();
}
}
// Usage example
const client = new QuoteLifecycleClient(
process.env.ASSIST_CLIENT_ID,
process.env.ASSIST_CLIENT_SECRET
);
// Complete workflow
async function quoteWorkflow() {
// 1. Get product options
const options = await client.getOptions();
console.log('Available products:', options);
// 2. Submit quote
const xmlQuote = `<?xml version="1.0" encoding="UTF-8"?>
<IrishMotorQuote>
<Policy>
<InceptionDate>2025-10-02T00:00:00+01:00</InceptionDate>
<CoverType>Comprehensive</CoverType>
</Policy>
<Customer>
<DateOfBirth>1987-09-18</DateOfBirth>
<FirstName>John</FirstName>
<Surname>Doe</Surname>
</Customer>
</IrishMotorQuote>`;
const quote = await client.submitQuote(xmlQuote);
console.log('Quote created:', quote);
// 3. Add addon
const withAddon = await client.addAddon(quote.quoteId, 'breakdown');
console.log('Addon added:', withAddon);
// 4. Generate documents
const docs = await client.generateDocuments(
quote.quoteId,
['schedule', 'terms']
);
console.log('Documents:', docs);
// 5. Accept quote
const policy = await client.acceptQuote(
quote.quoteId,
'direct_debit',
'PAY-2025-5678'
);
console.log('Policy created:', policy);
}
import os
import requests
from datetime import datetime, timedelta
from typing import Dict, List, Optional
class QuoteLifecycleClient:
def __init__(self, client_id: str, client_secret: str):
self.client_id = client_id
self.client_secret = client_secret
self.base_url = 'https://api.assistinsurances.ie'
self.token: Optional[str] = None
self.token_expires_at: Optional[datetime] = None
self.session = requests.Session()
def get_access_token(self) -> str:
if self.token and self.token_expires_at:
if datetime.now() < (self.token_expires_at - timedelta(minutes=5)):
return self.token
response = self.session.post(
f'{self.base_url}/auth/token',
json={
'client_id': self.client_id,
'client_secret': self.client_secret,
'scope': 'api://1c15f5fa-f434-401b-b4ec-ab3ea75d48bb/assist-api-gateway/.default',
'grant_type': 'client_credentials',
},
timeout=30
)
response.raise_for_status()
data = response.json()
self.token = data['access_token']
self.token_expires_at = datetime.now() + timedelta(
seconds=data['expires_in']
)
return self.token
def get_options(self) -> Dict:
token = self.get_access_token()
response = self.session.get(
f'{self.base_url}/applied/options',
headers={'Authorization': f'Bearer {token}'},
timeout=30
)
response.raise_for_status()
return response.json()
def submit_quote(self, xml_quote: str) -> Dict:
token = self.get_access_token()
response = self.session.post(
f'{self.base_url}/applied/quote/quote',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/xml',
},
data=xml_quote,
timeout=30
)
response.raise_for_status()
return response.json()
def get_quote(self, quote_id: str) -> Dict:
token = self.get_access_token()
response = self.session.get(
f'{self.base_url}/applied/quote/{quote_id}',
headers={'Authorization': f'Bearer {token}'},
timeout=30
)
response.raise_for_status()
return response.json()
def override_quote(
self,
quote_id: str,
override_type: str,
value: float,
reason: str
) -> Dict:
token = self.get_access_token()
response = self.session.post(
f'{self.base_url}/applied/quote/override',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json',
},
json={
'quoteId': quote_id,
'overrideType': override_type,
'value': value,
'reason': reason,
},
timeout=30
)
response.raise_for_status()
return response.json()
def add_addon(
self,
quote_id: str,
addon_type: str,
addon_options: Optional[Dict] = None
) -> Dict:
token = self.get_access_token()
response = self.session.post(
f'{self.base_url}/applied/quote/addon',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json',
},
json={
'quoteId': quote_id,
'addonType': addon_type,
'addonOptions': addon_options or {},
},
timeout=30
)
response.raise_for_status()
return response.json()
def generate_documents(
self,
quote_id: str,
document_types: List[str]
) -> Dict:
token = self.get_access_token()
response = self.session.post(
f'{self.base_url}/applied/documentgeneration/generateDocuments',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json',
},
json={
'quoteId': quote_id,
'documentTypes': document_types,
},
timeout=30
)
response.raise_for_status()
return response.json()
def accept_quote(
self,
quote_id: str,
payment_method: str,
payment_reference: str
) -> Dict:
token = self.get_access_token()
response = self.session.post(
f'{self.base_url}/applied/accept',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json',
},
json={
'quoteId': quote_id,
'paymentMethod': payment_method,
'paymentReference': payment_reference,
},
timeout=30
)
response.raise_for_status()
return response.json()
# Usage
client = QuoteLifecycleClient(
os.environ['ASSIST_CLIENT_ID'],
os.environ['ASSIST_CLIENT_SECRET']
)
# Complete workflow
def quote_workflow():
# 1. Get options
options = client.get_options()
print(f'Options: {options}')
# 2. Submit quote
xml_quote = """<?xml version="1.0" encoding="UTF-8"?>
<IrishMotorQuote>
<Policy>
<InceptionDate>2025-10-02T00:00:00+01:00</InceptionDate>
</Policy>
</IrishMotorQuote>"""
quote = client.submit_quote(xml_quote)
print(f'Quote: {quote}')
# 3. Add addon
with_addon = client.add_addon(quote['quoteId'], 'breakdown')
print(f'With addon: {with_addon}')
# 4. Generate documents
docs = client.generate_documents(
quote['quoteId'],
['schedule', 'terms']
)
print(f'Documents: {docs}')
# 5. Accept quote
policy = client.accept_quote(
quote['quoteId'],
'direct_debit',
'PAY-2025-5678'
)
print(f'Policy: {policy}')
API Endpoints
1. Get Product Options
Retrieve information about available insurance products.
GET /applied/options
Authorization: Bearer {access_token}
Response:
{
"products": [
{
"id": "motor-comprehensive",
"name": "Comprehensive Motor Insurance",
"description": "Full coverage including third-party and own damage"
}
]
}
2. Submit Quote
Submit an insurance quote request using XML format.
POST /applied/quote/quote
Authorization: Bearer {access_token}
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<IrishMotorQuote>
<Policy>
<InceptionDate>2025-10-02T00:00:00+01:00</InceptionDate>
<CoverType>Comprehensive</CoverType>
</Policy>
<Customer>
<DateOfBirth>1987-09-18</DateOfBirth>
<FirstName>John</FirstName>
<Surname>Doe</Surname>
</Customer>
<Vehicle>
<RegistrationNumber>12-D-12345</RegistrationNumber>
<Make>Toyota</Make>
<Model>Corolla</Model>
</Vehicle>
</IrishMotorQuote>
Response:
{
"quoteId": "QT-2025-001234",
"premium": 426.0,
"status": "quoted"
}
3. Apply Override
Apply an override to adjust pricing or terms.
POST /applied/quote/override
Authorization: Bearer {access_token}
Content-Type: application/json
{
"quoteId": "QT-2025-001234",
"overrideType": "premium",
"value": 400.0,
"reason": "Customer loyalty discount"
}
Override Types:
premium- Override total premiumexcess- Adjust excess amountdiscount- Apply discount percentage
4. Add Addon
Add optional coverage to a quote.
POST /applied/quote/addon
Authorization: Bearer {access_token}
Content-Type: application/json
{
"quoteId": "QT-2025-001234",
"addonType": "breakdown",
"addonOptions": {}
}
Available Addons:
breakdown- Breakdown assistancelegal- Legal expenses coverwindscreen- Enhanced windscreen coverkeycare- Key replacement cover
5. Retrieve Quote
Get full details of an existing quote.
GET /applied/quote/{id}
Authorization: Bearer {access_token}
Response:
{
"quoteId": "QT-2025-001234",
"premium": 450.0,
"status": "quoted",
"createdAt": "2025-10-20T10:30:00Z",
"expiresAt": "2025-11-20T10:30:00Z",
"customer": { /* ... */ },
"vehicle": { /* ... */ },
"policy": { /* ... */ }
}
6. Generate Documents
Generate insurance documents for a quote.
POST /applied/documentgeneration/generateDocuments
Authorization: Bearer {access_token}
Content-Type: application/json
{
"quoteId": "QT-2025-001234",
"documentTypes": ["schedule", "terms"]
}
Document Types:
schedule- Policy scheduleterms- Terms and conditionscertificate- Certificate of insuranceall- All documents
Response:
{
"quoteId": "QT-2025-001234",
"documents": [
{
"type": "schedule",
"url": "https://documents.assistinsurances.ie/QT-2025-001234/schedule.pdf",
"expiresAt": "2025-10-21T10:30:00Z"
}
]
}
7. Accept Quote
Convert a quote to a policy.
POST /applied/accept
Authorization: Bearer {access_token}
Content-Type: application/json
{
"quoteId": "QT-2025-001234",
"paymentMethod": "direct_debit",
"paymentReference": "PAY-2025-5678"
}
Payment Methods:
card- Credit/debit carddirect_debit- Direct debit mandatebank_transfer- Bank transfer
Response:
{
"quoteId": "QT-2025-001234",
"policyId": "POL-2025-001234",
"status": "accepted",
"policyStartDate": "2025-10-02T00:00:00+01:00"
}
XML Quote Format
Complete XML Example
<?xml version="1.0" encoding="UTF-8"?>
<IrishMotorQuote>
<Policy>
<InceptionDate>2025-10-02T00:00:00+01:00</InceptionDate>
<ExpiryDate>2026-10-02T00:00:00+01:00</ExpiryDate>
<CoverType>Comprehensive</CoverType>
<UseClass>SocialDomesticPleasure</UseClass>
</Policy>
<Customer>
<Title>Mr</Title>
<FirstName>John</FirstName>
<Surname>Doe</Surname>
<DateOfBirth>1987-09-18</DateOfBirth>
<LicenceType>Full</LicenceType>
<LicenceHeldYears>10</LicenceHeldYears>
<Email>john.doe@example.com</Email>
<Phone>0851234567</Phone>
</Customer>
<Address>
<AddressLine1>123 Main Street</AddressLine1>
<Town>Dublin</Town>
<County>Dublin</County>
<Eircode>D02X285</Eircode>
<Country>Ireland</Country>
</Address>
<Vehicle>
<RegistrationNumber>12-D-12345</RegistrationNumber>
<Make>Toyota</Make>
<Model>Corolla</Model>
<Year>2012</Year>
<EngineSize>1600</EngineSize>
<FuelType>Petrol</FuelType>
<Value>8000</Value>
<Mileage>120000</Mileage>
<SecurityDevices>
<AlarmImmobiliser>true</AlarmImmobiliser>
</SecurityDevices>
</Vehicle>
<ClaimsHistory>
<NumberOfClaims>0</NumberOfClaims>
<YearsNoClaims>5</YearsNoClaims>
</ClaimsHistory>
</IrishMotorQuote>
Required Fields
| Section | Field | Type | Description |
|---|---|---|---|
| Policy | InceptionDate | DateTime | Policy start date (ISO 8601) |
| Policy | CoverType | String | Comprehensive, ThirdParty, TPFT |
| Customer | FirstName | String | Customer first name |
| Customer | Surname | String | Customer surname |
| Customer | DateOfBirth | Date | YYYY-MM-DD format |
| Vehicle | RegistrationNumber | String | Irish VRM format |
| Vehicle | Make | String | Vehicle manufacturer |
| Vehicle | Model | String | Vehicle model |
Integration Workflow
Complete Quote Lifecycle
sequenceDiagram
participant C as Client App
participant API as Assist API
Note over C,API: 1. Product Discovery
C->>API: GET /options
API->>C: Available products
Note over C,API: 2. Quote Submission
C->>API: POST /quote (XML or JSON)
API->>C: Quote ID + pricing
Note over C,API: 3. Quote Modification
C->>API: POST /quote/addon
API->>C: Updated quote
Note over C,API: 4. Document Generation
C->>API: POST /documentgeneration/generateDocuments
API->>C: Document URLs
Note over C,API: 5. Quote Acceptance
C->>API: POST /accept
API->>C: Policy ID
Note over C: Quote converted to policy
Error Handling
Common Errors
400 Bad Request - Invalid XML:
{
"statusCode": 400,
"message": "Invalid XML format: Missing required field 'DateOfBirth'"
}
403 Forbidden - Insufficient Permissions:
{
"statusCode": 403,
"message": "Insufficient permissions for override operation"
}
404 Not Found - Quote Not Found:
{
"statusCode": 404,
"message": "Quote QT-2025-001234 not found"
}
Best Practices
-
XML Validation
- Validate XML before submission
- Use proper encoding (UTF-8)
- Ensure all required fields are present
-
Quote Management
- Store quote IDs for reference
- Implement quote expiry handling
- Track quote status changes
-
Document Handling
- Download documents immediately after generation
- Document URLs expire after 24 hours
- Store documents securely
-
Error Recovery
- Implement retry logic for transient failures
- Log all API interactions
- Handle rate limiting gracefully
Testing
Test Quote XML
<?xml version="1.0" encoding="UTF-8"?>
<IrishMotorQuote>
<Policy>
<InceptionDate>2025-10-02T00:00:00+01:00</InceptionDate>
<CoverType>Comprehensive</CoverType>
</Policy>
<Customer>
<FirstName>Test</FirstName>
<Surname>User</Surname>
<DateOfBirth>1987-09-18</DateOfBirth>
</Customer>
<Vehicle>
<RegistrationNumber>12-D-12345</RegistrationNumber>
<Make>Toyota</Make>
<Model>Corolla</Model>
</Vehicle>
</IrishMotorQuote>
Support
- Technical Support: neil.reilly@assistinsurances.ie
- Rate Limit: 100 requests per minute
- Support Hours: Monday-Friday, 9:00-17:00 IST
Next Steps
- Authentication Guide - OAuth 2.0 implementation
- Error Handling - Error handling patterns
- API Reference - Full API documentation
- Quick Pricing Workflow - Simplified pricing approach