Skip to main content
A broker, Example Pets, sells the pet insurance of an insurer, Example Mutual, in France. An agent finds the product, quotes a cat called Miso for Alice, and applies for the first offer. Alice approves the application once, on Example Pets’ page, where she also signs and pays. All companies, people and prices are fictional. The repository writes these files with scripts/examples.ts and checks them against the schema and the rules on every push.

1. Find the distributor

get_distributor, result The agent asks who sells and under which licence. Example Pets is a broker in the ORIAS register, and it declares level 3 for pet insurance in France.
spec/examples/insurance-01-get_distributor.result.json

2. Look for a product

list_products, params Alice lives in France and wants to insure her cat. The agent asks for the products that cover a cat in France. With the country, the family and the kind, the filters cover the whole structured part of the scope.
spec/examples/insurance-02-list_products.params.json

3. Read the scope, the tiers and the documents

list_products, result The product publishes its scope before any question: France only, cats and dogs, and four conditions in plain words. The agent checks the conditions against what Alice said, and asks her when it is not sure. The product names its insurer, Example Mutual, and the agent checks it in the registry before it asks any question. It has two tiers, Essentiel 70 and Essentiel 90, each with its cover and no price. The product also lists its documents. The IPID and the general conditions must reach the customer before they commit.
spec/examples/insurance-03-list_products.result.json

4. Quote with the answers from the chat

quote, params The agent quotes with the five answers it already has. Each answer has a source. Alice gave four of them, and the agent read the breed from her photo.
spec/examples/insurance-04-quote.params.first.json

5. Get the questions that are still open

quote, result The server returns the questions of the product as a JSON Schema, and lists the required answers that are missing. The agent asks Alice only those, and her vet clinic’s record gives the date of birth. No question asks for a bank account or an identity number: Example Pets asks for them on its own page.
spec/examples/insurance-05-quote.result.needs_input.json

6. Quote with every answer

quote, params The agent sends all the answers and their sources again. The date of birth comes from a third party, named in source_name.
spec/examples/insurance-06-quote.params.complete.json

7. Compare the offers

quote, result Two offers, one for each tier of the product, in the same shape, each with its excess, its limits, its fees and its documents. Their price can change after the insurer’s checks, and the approval page shows the firm price.
spec/examples/insurance-07-quote.result.offers.json

8. Get a reason when there is no offer

quote, result For a dog born in 2015, the insurer makes no offer and gives a stable reason code.
spec/examples/insurance-08-quote.result.no_offer.json

9. Refuse a risk outside the scope

quote, result A cat that lives in the United Kingdom is outside the geography of the scope. An agent that follows the rules does not send this quote. The server refuses it anyway, with the reason outside_underwriting_scope.
spec/examples/insurance-09-quote.result.outside_scope.json

10. Apply

submit_application, params Alice chooses Essentiel 70. The agent sends the offer and the parties. It does not send the answers again: the server takes them, with their sources, from the offer.
spec/examples/insurance-10-submit_application.params.json

11. Get the page to approve

submit_application, result Nothing is committed yet. The summary gives the price and each answer with its source, and asks Alice to approve only if each answer is true and complete. The agent gives Alice the url, which holds a token of its own, and keeps the application_key to itself.
spec/examples/insurance-11-submit_application.result.json

12. Approve on the seller’s page

get_operation, params On Example Pets’ page, Alice reads the documents, checks the answers and the firm price, and approves. Then she signs and pays on the same page. The agent reads the application with its ID and its key.
spec/examples/insurance-12-get_operation.params.json

13. Learn the outcome

get_operation, result Alice approved. Example Pets keeps what she approved, with the answers and their sources, for the period that the law requires.
spec/examples/insurance-13-get_operation.result.approved.json