recalculateQuote: v2 vs. v1
As of March 2025, recalculateQuoteV2
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 Recalculated Offers
When recalculating a quote through recalculateQuoteV2
, an offer may include rejections. These rejections provide detailed information about why certain types of insurance were not offered or were restricted in the recalculated 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.
acceptSoftRejections Parameter
The recalculateQuoteV2
resolver includes an acceptSoftRejections
parameter (default: true
). When set to true
, policies with soft rejections will remain in the offer after recalculation. When set to false
, those policies will be removed from the offer.
Example: Recalculated Offer with Rejections
query {
recalculateQuoteV2(
offerId: "390e68aa-0032-4a76-8ece-91a539e6293a"
revisedQuoteDetails: { global: { autoEffectiveDate: "2021-04-01", homeEffectiveDate: "2021-04-02" } }
acceptSoftRejections: true
) {
id
options {
id
type
description
homeTotal
autoTotal
}
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": {
"recalculateQuoteV2": {
"id": "7dac7b47-59ad-4622-8a39-bb2805e45600",
"options": [
{
"id": "edb5c84c-11ad-43bf-8530-905bda9e7382",
"type": "H",
"description": "Homeowners",
"homeTotal": 999.18,
"autoTotal": null
},
{
"id": "4b794cfb-9336-4e7a-940c-857245d99573",
"type": "HA",
"description": "Home/Auto Bundle",
"homeTotal": 871.27,
"autoTotal": 577.98
},
{
"id": "220d83b1-b771-4a32-b219-754ac2917d4e",
"type": "A",
"description": "Auto",
"homeTotal": null,
"autoTotal": 678.96
}
],
"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 after recalculation.
- 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 recalculated quote.
Making Requests from Code
JavaScript Example
Here's an example of how you'd make the above recalculateQuoteV2
call from code in JavaScript, using the graphql-request
client library (https://github.com/prisma-labs/graphql-request):
const { 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 RecalculateQuoteV2($offerId: ID!, $revisedQuoteDetails: QuoteDetailsInput!, $acceptSoftRejections: Boolean) {
recalculateQuoteV2(
offerId: $offerId
revisedQuoteDetails: $revisedQuoteDetails
acceptSoftRejections: $acceptSoftRejections
) {
id
options {
id
type
description
homeTotal
autoTotal
}
rejections {
value
level
type
data
}
quote {
offerings {
offerHomeowners
}
}
}
}
`;
const variables = {
offerId: '390e68aa-0032-4a76-8ece-91a539e6293a',
revisedQuoteDetails: {
global: {
autoEffectiveDate: '2021-04-01',
homeEffectiveDate: '2021-04-02'
}
},
acceptSoftRejections: true
};
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 RecalculateQuoteV2($offerId: ID!, $revisedQuoteDetails: QuoteDetailsInput!, $acceptSoftRejections: Boolean) { recalculateQuoteV2(offerId: $offerId, revisedQuoteDetails: $revisedQuoteDetails, acceptSoftRejections: $acceptSoftRejections) { id options { id type description homeTotal autoTotal } rejections { value level type data } quote { offerings { offerHomeowners } } } }","variables":"{\"offerId\": \"390e68aa-0032-4a76-8ece-91a539e6293a\", \"revisedQuoteDetails\": { \"global\": { \"autoEffectiveDate\": \"2021-04-01\", \"homeEffectiveDate\": \"2021-04-02\" } }, \"acceptSoftRejections\": true}"}'