Overview
This guide walks you through integrating Yasmina’s Medical Insurance API into your platform. Using our secure and reliable endpoints, you’ll be able to request and manage policies, and issue claims. Everything you need to deliver insurance services seamlessly within your application.Basic Journey
- Authorize: Get an access token to authenticate all API requests.
- Create a Company: Register the SME that will provide medical insurance for its employees.
- Choose a Package: Retrieve and review available medical insurance packages.
- Issue Insurance: Select the employees who will be covered and create their policies.
- Health Declarations: Complete forms on behalf of employees or send them directly for completion.
- Payment: Receive a secure payment link to finalize the purchase.
Authorization
To access any of our API’s. You need to authorize yourself using the Generate Token API. We are using the standard OAuth 2.0 client credentials.The Generate Token API requires
client_id
and client_secret
. You can get these from your portal.After making the request, you will get access_token in the response. Example
access_token
must be used on all future Yasmina APIs and be supplied in the Authorization Header in the following form
Authorization: Bearer {access_token}
For security reasons. Do not make your client_id and client_secret public in your platform.
Create a Company record
After acquiring an access_token, you can begin using the APIs. Before you produce policies for a company, you must create a company record. After creating the company record, you can request to issue policies to the employees of that company. The The Create Company API, will require few fields that define details of the company such as Email, Phone etc… It will return a response with a unique identifier (id). Here is an example of the response from the POST companies API.List available packages
After creating a company record, you can list available packages to the company. Check out the Categories API. This gives you a list of available insurance categories.- The Insurance provider PDF
- Contains an overview picture of what is provided by the Insurance provider
- The translations
- The translations includes keys that map to the instructional text in Arabic and English that were provided by the insurance provider.
- The categories
- The categories items uses these keys and gives the coverage values
category
property. This is an important property as it is what you will need to provide when you issue policies. Notice the category field in the following sample of the categories response API.
Issue insurance policies
To issue policies, you need to execute the Issue policies API. The API takes two fields. The company_id as referenced above. And an array called insured. The insured are the employees that the company wants to issue insurance for.policies Here is an example of a payload you would sendNotice in the above, there are two employees within the company. One of them we are supplying the
iqama_id
as he is a Non-Saudi while the other we supply a nationality_id
as he is Saudi.category
that we are supplying is what was returned from the Categories API
HR declaration forms
The companies that have requested insurance needs to be supply the insurance provider with Medical forms. These are mandatory for insurance providers to know past medical histories. Yasmina offers two methods for submitting these forms:- Fill Medical Forms: Company administrators fill out the forms on behalf of the employees.
- Dispatch Medical Forms: Company administrators dispatch the forms to employees, who then complete them individually.
Fill medical forms
Fill medical forms
The fill medical forms allows the company admin to do so on behalf of the employers of the company. It takes two fields of which both are objects Check out the Fill medical forms API docs for all the supported props.
all_employees
and ids_or_emails
.The idea behind the two fields, is to allow the Company admin to select the default answers for all employees, and then override the answers for specific employees.For example, let us say that all employees except 1 (for example employee with email [email protected]), never had surgeries before, we can declare the answer No
on the surgery question in the all_employees field, but declare Yes
for the other employee.employeeHere’s an example of such caseDispatch Medical forms
Dispatch Medical forms
In this method, the Company admin puts a list of employees (emails, nationality ids, or Iqama ids). Yasmina then dispatches the medical form to each employee on email.The employees will get a link to fill the forms themselves.You can check the Dispatch Medical Form APIYou can put other components inside Accordions.