Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

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
Need Credentials?

Contact neil.reilly@assistinsurances.ie to obtain your API credentials.

Authentication​

The API accepts tokens in both form-encoded and JSON formats for 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"

Response:

{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"token_type": "Bearer",
"expires_in": 3599
}

Complete Integration Example​

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);
}

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 premium
  • excess - Adjust excess amount
  • discount - 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 assistance
  • legal - Legal expenses cover
  • windscreen - Enhanced windscreen cover
  • keycare - 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 schedule
  • terms - Terms and conditions
  • certificate - Certificate of insurance
  • all - 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 card
  • direct_debit - Direct debit mandate
  • bank_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​

SectionFieldTypeDescription
PolicyInceptionDateDateTimePolicy start date (ISO 8601)
PolicyCoverTypeStringComprehensive, ThirdParty, TPFT
CustomerFirstNameStringCustomer first name
CustomerSurnameStringCustomer surname
CustomerDateOfBirthDateYYYY-MM-DD format
VehicleRegistrationNumberStringIrish VRM format
VehicleMakeStringVehicle manufacturer
VehicleModelStringVehicle 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​

  1. XML Validation

    • Validate XML before submission
    • Use proper encoding (UTF-8)
    • Ensure all required fields are present
  2. Quote Management

    • Store quote IDs for reference
    • Implement quote expiry handling
    • Track quote status changes
  3. Document Handling

    • Download documents immediately after generation
    • Document URLs expire after 24 hours
    • Store documents securely
  4. 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​

Next Steps​