Skip to main content

requestQuote: v2 vs. v1

As of October 2024, requestQuoteV2 is the recommended version for new integrations. If you're starting a new integration, please use v2 to ensure access to the latest improvements. v2 includes advanced features like soft rejections and enhanced error handling, which are not available in v1.

Rejections in Offers

When making a quote request through requestQuoteV2, an offer may include rejections. These rejections provide detailed information about why certain types of insurance were not offered or were restricted in the quote.

Rejections may be related to various policy types like auto, home, or condo, and can either be soft or hard.

  • Soft rejections indicate issues that may be resolvable, such as missing or incorrect information.
  • Hard rejections indicate that the quote cannot proceed for the rejected type.

Example: Offer with Rejections

query {
requestQuoteV2(
userInput: {
fname: "Kurt"
lname: "Muldrew-Clean"
address: "100 Beatrice Dr"
city: "Dayton"
state: "OH"
zip: "45404"
home: { numOccupants: 13 }
}
) {
id
options {
id
type
}
rejections {
value
level
type
data
}
quote {
offerings {
offerHomeowners
}
}
}
}

In the example above, the response includes an offer ID and a list of options (e.g., different policy types like home, auto, or bundles). The rejections array details any reasons for rejection of certain options.

Example Response

{
"data": {
"requestQuoteV2": {
"id": "9ef3e975-5774-454f-a07b-63f421c81569",
"options": [
{
"id": "7ced3caf-8c42-41bf-9e24-c02db1027fac",
"type": "A"
},
{
"id": "9fe053d6-a6c5-40c3-bb50-76dcb2a91125",
"type": "HA"
},
{
"id": "24846b51-0115-43fe-9c44-7b4e15a07cf4",
"type": "H"
}
],
"rejections": [
{
"value": 50003,
"level": "soft",
"type": "home",
"data": null
}
],
"quote": {
"offerings": {
"offerHomeowners": true
}
}
}
}
}

In this response:

  • options are the different policy options offered to the customer.
  • rejections provide details about the rejected policy options. For example, a soft rejection of type "home" with the rejection code 50003 means that there was a soft issue with the home coverage, but it may be resolvable.
  • quote provides information about the specific coverages and offerings included in the quote.

Making Requests from Code

JavaScript Example

cconst { GraphQLClient, gql } = require('graphql-request');

const graphQLClient = new GraphQLClient('https://staging.v2.api.ourbranch.com/', {
headers: {
Authorization: '<API key>',
'x-affinity-code': '<Affinity code>'
}
});

const query = gql`
query RequestQuoteV2(
$fname: String!
$lname: String!
$address: String!
$city: String!
$state: String!
$zip: String!
) {
requestQuoteV2(
userInput: { fname: $fname, lname: $lname, address: $address, city: $city, state: $state, zip: $zip }
) {
id
options {
id
type
description
homeTotal
autoTotal
}
rejections {
value
level
type
data
}
}
}
`;

const variables = {
fname: 'Kurt',
lname: 'Muldrew',
address: '100 Beatrice Rd',
city: 'Dayton',
state: 'OH',
zip: '45404'
};

graphQLClient.request(query, variables).then((data) => console.log(data));

CURL Example

You can also use CURL to make the same request:

curl --request POST \
--header 'Authorization: <API key>' \
--header 'x-affinity-code: <Affinity code>' \
--header 'content-type: application/json' \
--url 'https://staging.v2.api.ourbranch.com' \
--data '{"query":"query RequestQuoteV2($fname: String!, $lname: String!, $address: String!, $city: String!, $state: String!, $zip: String!) { requestQuoteV2(userInput: { fname: $fname, lname: $lname, address: $address, city: $city, state: $state, zip: $zip }) { id options { id type description homeTotal autoTotal } rejections { value level type data } } }","variables":"{\"fname\": \"Kurt\",\"lname\": \"Muldrew\",\"address\": \"100 Beatrice Rd\",\"city\": \"Dayton\",\"state\": \"OH\",\"zip\": \"45404\"}"}'