• Register

TuGo API Forums

General

RSS Feed

Selling Annual Policies

    • matt
    • Topic created 9 years ago

    This is similar to my last post about purchasing multiple products.

    I'm unable to quote annual policies with multiple products. Your system doesn't return a response. I have tried annual policies for individuals and for a family of three. In both cases your system does not return a response.

    Here's an example request for an annual policy for an individual:

    { "productLineCode": "PR-FDM-1", "insuredType": "CANADIAN", "trip": { "departureProvince": "AB", "cost": 3000 }, "insuredPersons": [ { "insuredType": "CANADIAN", "homeProvince": "AB", "plansToPrice": [ { "planCode": "PL-MMED-3" }, { "planCode": "PL-MTCAN-1" }, { "planCode": "PL-MTI-1" }, { "planCode": "PL-MADD-1" } ] } ] }

    Is there something wrong with this request?

    Message edited by matt 9 years ago

  1. Clyde9 years ago

    Hi Matt,

    I was able to run your request through the webservice and there are several errors returned in the HTTP response. If you inspect the response you will notice a collection of error messages.

    1. {
    2.    "messages":    [
    3.             {
    4.          "key": "sales.drl.trip.startDate.is.not.specified",
    5.          "type": "ERROR",
    6.          "summarykey": "sales.drl.trip.startDate.is.not.specified.summary",
    7.          "summaryMessage": "Add Trip Start Date.",
    8.          "detailMessage": "Add Trip Start Date.",
    9.          "sourceType": "MSG_BUNDLE",
    10.          "catalogName": "tu.venture.domain.messages.sales.i18n.SalesResources",
    11.          "params": []
    12.       },
    13.             {
    14.          "key": "sales.drl.trip.endDate.is.not.specified",
    15.          "type": "ERROR",
    16.          "summarykey": "sales.drl.trip.endDate.is.not.specified.summary",
    17.          "summaryMessage": "Add Trip End Date.",
    18.          "detailMessage": "Add Trip End Date.",
    19.          "sourceType": "MSG_BUNDLE",
    20.          "catalogName": "tu.venture.domain.messages.sales.i18n.SalesResources",
    21.          "params": []
    22.       },
    23.             {
    24.          "key": "sales.drl.error.rule.insured.age.required",
    25.          "type": "WARNING",
    26.          "summarykey": "sales.drl.error.rule.insured.age.required.summary",
    27.          "summaryMessage": "!sales.drl.error.rule.insured.age.required.summary!",
    28.          "detailMessage": "!sales.drl.error.rule.insured.age.required!",
    29.          "sourceType": "MSG_BUNDLE",
    30.          "catalogName": "tu.venture.domain.messages.sales.i18n.SalesResources",
    31.          "params": []
    32.       }
    33.    ],
    34.    "availablePlanPrices": [],
    35.    "selectedPlanPrices":    {
    36.       "selectedPlanPriceBreakDown": [],
    37.       "totalPremiums": 0,
    38.       "totalTaxes": 0,
    39.       "totalCost": 0
    40.    }
    41. }

    In this case the trip's start date, end date, and the insured's age are absent in the request.

  2. Clyde9 years ago

    Matt,

    Also keep in mind you may use the filter options on the request to filter results. In the example below I use the tripType filter to get all multi/annual plans assigned to the freedom product line.

    1. {  
    2.    "productLineCode":"PR-FDM-1",
    3.    "insuredType":"CANADIAN",
    4.    "tripType":"MULTI",
    5.    "trip":{  
    6.       "startDate":"2015-09-01",
    7.       "endDate":"2015-10-01",
    8.       "departureProvince":"AB",
    9.       "cost":3000
    10.    },
    11.    "insuredPersons":[  
    12.       {  
    13.          "insuredType":"CANADIAN",
    14.          "homeProvince":"AB",
    15.          "birthDate":"2000-10-10"
    16.       }
    17.    ]
    18. }
  3. matt9 years ago

    Oh, we thought annual policies began on the day they're purchased and end one year later. We didn't know we could specify dates.

    So the start date is the date the policy should begin? And the end date represents what? The date one year from the start date?

  4. matt9 years ago

    Now that I'm sending the required parameters (age, startDate and endDate) I'm getting responses for the proper products. Thanks. The quoting works just fine.

    But I'm not able to purchase the products.

    Your system returns a generic "Internal Server Error" message so I'm not sure what's wrong with this purchase request.

    Here is my request:

    {"policyInfo":{},"trip":{"startDate":"2015-02-18","endDate":"2016-02-17","departureProvince":"AB","cost":3000,"bookingDate":"2015-02-18"},"insuredPersons":[{"insuredType":"CANADIAN","inHomeProvince":true,"homeProvince":"AB","selectedPlans":[{"planCode":"PL-MTCAN-1,PL-MADD-1,PL-MTI-1,PL-MMED-3"}],"firstName":"Matt","lastName":"Annual","birthDate":"1997-01-01","phoneNumbers":[{"number":"5048552666"}],"addresses":[{"addressLine1":"123 Main St","city":"Calgary","country":"CA","province":"AB","postalCode":"H0H 0H0","type":"MAIL"}]}],"payments":[{"amount":945,"transactionType":"PURCHASE","paymentStatus":"APPROVED","paymentType":"COLLECTED","paymentMethod":"SINGLE","currencyCode":"CAD"}]}

  5. Clyde9 years ago

    Matt,

    You might want to check the following block of javascript:

    1.          "selectedPlans":[  
    2.             {  
    3.                "planCode":"PL-MTCAN-1,PL-MADD-1,PL-MTI-1,PL-MMED-3"
    4.             }
    5.          ]

    I have an example in one of my earlier postings of a working example. The selected plans list should contain a list of plans.

  6. matt9 years ago

    Ok, thanks.

    Now I'm getting an error saying "Multi Trip length doesnt cover the entire trip"

    So I'm still wondering about startDate and endDate and how an annual policy doesn't cover, in this case, a year.

  7. matt9 years ago

    Is this "Multi Trip length doesnt cover the entire trip" error perhaps related to the max trip length of 182 in MMED-3? I notice that MADD-1 has max length of 365, which is what we'd expect.

  8. Ken Lum9 years ago

    Here are some additional notes on multi-trip annual policies:

    First off, let's define a glossary for some terms that follow:

    • Trip start date: The start date of the first trip to be covered by the multi-trip annual policy.
    • Trip end date: The end date of the first trip to be covered by the multi-trip annual policy.
    • Policy start (effective) date: The start date of the multi-trip annual policy, which coincides with the trip start date.
    • Policy end (expiry) date: The end date of the multi-trip annual policy, which does not coincide with the trip end date because the policy is intended to be used on multiple trips.
    • Trip length: The maximum length of any trip intended to be covered by the multi-trip annual policy. This must be carefully selected by the customer to ensure that it is greater than or equal to the maximum possible length of any trip taken by the customer during the coverage period of the policy.

    • The policy start and end dates are always one year apart.

    • A rounded-up difference between the trip end and start dates is used to generate a default (suggested) trip length for a multi-trip annual policy. The trip length for a multi-trip annual policy can be customized to a different length if so desired. In short, the trip end date is used to generate this default (suggested) trip length that should be greater than or equal to the longest expected trip length.
    • A multi-trip annual policy can be used for multiple trips during the one-year period in which the policy is in effect; each of these trips, including the first trip, must be of a length no greater than the trip length specified in the policy.
    • Please experiment with https://uat-shop.travelunderwriters.com/store/TESTFGM to see the high-level details of quoting and purchasing multi-trip (and other) policies. The tooltips are especially helpful in aiding your understanding of the business rules.
[ Page 1 of 1 ]