Build it with AI — an AI coding assistant can scaffold this entire integration for you straight from these docs. See Build with AI to get started.
Introduction
This guide describes the Yasmina’s Comprehensive Motor Insurance APIs for Single Insurance Provider (for Multiple Insurance Providers with Price comparison, click here) available on Yasmina’s platform. These APIs cover the core operations required for working with Comprehensive motor insurance, including issuing and managing policies, generating payment link, and handling claims. Our APIs use the RESTful standard and is structured to provide consistent inputs and outputs, making it quick and easy to integrate, test, and maintain within your systems.What you will learn
- Uploading vehicle photos
- Issuing and managing policies
- Payment link
- Starting a claim
Prerequisites
- Account in Yasmina - See the Onboarding section for details. You need to add “Comprehensive Motor Insurance (Single Provider)” in the products field.
- Authenticated Token - Follow the Authentication guide to generate one.
- Backend server - Required to securely call Yasmina APIs.
Vehicle photos
If the customer has selected a comprehensive policy, upload the five photos before you issue the policy — front, back, right, left, and the chassis (VIN) number. Use the Upload Vehicle Photos API, against the quote request and the price the customer selected. Example of a request- All five together. A partial upload is rejected with a
422. - JPG or PNG, up to 3 MB each.
- Once per vehicle. The insurance provider keeps the first set it accepts. A later
upload for the same vehicle still succeeds, with
already_registered: truein the response, but the registered photos do not change — so check the photos before sending them. - Comprehensive only. A
quote_price_idbelonging to a TPL quote is rejected.
Issue policy
In order to Issue a policy. You can head to the Issue Policy API These are the fields that you need to provide:
The customer’s Saudi IBAN is collected earlier in the flow: it is a required field of the Issue OTP API, not of this endpoint.
Example of a request
201 HTTP response code. Here is an example of the Policy object.
Understanding Payment and Policy activation
When you first make a request to the Issue Policy API. The Policy is not yet activated and thestatus is 0 (which means pending).
Also the provider_policy and provider_policy_id will both be null.
In order for the policy to be activated, the customer needs to make the purchase from the payment link. Once the customer successfully pays. The policy will be activated and the status becomes 1.
Although the payment page is provided by Yasmina, it does not display the Yasmina logo or have any mention of Yasmina.
Yasmina does not receive credit card information, instead the payment page sends card information directly to the payment vendor.
Yasmina does not receive credit card information, instead the payment page sends card information directly to the payment vendor.
Showing a policy
In order to get a status of a policy, you can use the Show Policy API. This API, takes a Yasmina Policyid and will return the policy object
This API is ideal when you want to re-fetch a specific policy after the PDF gets generated.
Example of a request