What is session ?
A session represents a user's journey through OneAssure's embedded iframe. When a user starts interacting with the iframe, a unique session ID has to be generated to track their activity. Think of this session ID as a digital fingerprint that connects all of the user's interactions in one place.
The session ID helps track:
- Quotes generated for insurance products
- Proposals created.
- Policies purchased.
While a single session ID can be associated with multiple insurance quotes (since users often compare different options), there can only be one active proposal per quote per variant at any given time. This ensures clarity and prevents duplicate submissions for the same insurance product.
For example, if a user is shopping for health insurance:
- They may generate multiple quotes to compare different plans (all linked to one session ID)
- When they decide on a plan, they can submit one proposal for that specific quote
- The proposal status (accepted/rejected) is tracked using the same session ID
Session APIs
Create Session
Create a new session for a customer. This endpoint creates a unique session id and links it to all further actions performed by the user.
Endpoint
POST /v1/business/session
Request
Body
{
"metadata": {
// A JSON object containing key-value pairs, where all values must be strings.
// Use this for any additional context or tracking information that you wish to pass.
// Example: "txn_id": "merchant_1234"
}
}
Response
Body
{
"session_id": "18rRLLwvdI5tjPZM",
"metadata": {
// A JSON object containing key-value pairs, where all values must be strings.
// Use this for any additional context or tracking information that you wish to pass.
// Example: "txn_id": "merchant_1234"
}
}
Fields
| Field | Type | Optional | Description |
|---|---|---|---|
| metadata | object | Yes | Any metadata that has to be associated with the session |
| session_id | string | No | Unique Id generated by our system to track the user journey |