Skip to main content
Give us the customer’s details from your backend, and we give you back a URL. Put that URL in an iframe on your website, or in a WebView in your app, and the rest of the journey happens inside it: comparing quotes across providers, add-ons, the payout account, vehicle photos and the verification code. When the policy is issued we hand it to you with a payment link, and the embed goes blank so your own screen can take over. You do not build any of those screens, and you do not handle the customer’s verification code.
This covers Comprehensive Motor Insurance (Multiple Providers). Your account needs that product enabled. See Onboarding.

Before you start

Register where the embed is allowed to run, in API Management under Yasmina Iframe and WebView. A session can only be opened for something on these lists. Add every site you will embed from. https://example.com and https://www.example.com are different sites to a browser, so list both if you serve both.

The flow

1

Send the verification code

Call the Quote OTP API with the customer’s ID, email and phone. This one is yours because it happens before the embed exists.
2

Open a session

Call Create Embed Session with the same payload you would send to Request Quotes, plus where the session will run. We fetch the quotes and hand back a URL.
3

Show it

Put the URL in an iframe or a WebView.
4

Receive the policy

We send you the issued policy, including its payment link. Take the customer to payment from there.

Open a session

Send Accept: application/json, as with every Yasmina API. Everything Request Quotes takes, plus:
string
required
web for an iframe, webview for a mobile app. There is no default: each one requires a different field below.
string
required
Web only. The site the iframe will sit on, scheme and domain with nothing after it. Must be one of your iframe hosts.
WebView only. Where your app is reopened once the policy is issued. Must be one of your registered deep links.
string
ar or en. Defaults to the customer’s browser.
Response
There is no permanent embed URL. Each one belongs to one customer and expires after one hour. Create a session per customer, when they are ready to see prices.
quote_request_id is yours to keep for your own records. You never have to send it back.

On a website

Listen for the policy. Always check the origin, and use the origin of the embed_url you were given rather than hardcoding one:
Only the site you registered as parent_origin can load the embed. Anywhere else gets a blank frame, refused by the browser.

In a mobile app

Load the same embed_url in a WebView. When the policy is issued we reopen your app at your deep_link with the policy id on it:
Look the policy up with Show Policy to get its payment link.
A WebView needs setting up before this works. Two things fail silently if you skip them: on Android the vehicle photo step does nothing at all without a file chooser, and JavaScript is disabled by default. Neither shows an error.

iOS

Add NSCameraUsageDescription to your Info.plist. Without it iOS terminates the app the moment a customer taps Take Photo on the vehicle photo step. Choosing an existing photo instead goes through a picker that runs outside your app, and needs no key.

Android

Request CAMERA at runtime if customers will photograph the vehicle in the app.

Getting the whole policy instead of just the id

Optional. If you would rather receive the full policy than look it up, expose a bridge and we will use it, falling back to the deep link if it is not there.

What you receive

The embed also sends { "type": "yasmina:ready" } once it has loaded, which is useful for hiding your own loading state. The policy is issued but unpaid. Take the customer to payment_link to activate it. Your webhooks fire on payment as they always do.

Showing the quotes again

The URL works for its full hour and survives a refresh, so a customer who reloads keeps their place. Once the hour is up, call the same endpoint again with the same payload. You can reuse the verification code the customer already gave you, since it stays valid for hours, so they are not asked for a new one. The new session opens on fresh quotes rather than hour-old prices. Show Embed Session returns a session you already created, and tells you whether it has expired.

When something is wrong