Skip to main content

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

  1. Account in Yasmina - See the Onboarding section for details. You need to add “Comprehensive Motor Insurance (Single Provider)” in the products field.
  2. Authenticated Token - Follow the Authentication guide to generate one.
  3. 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.
This step is required for comprehensive cover. If the photos are not uploaded, the customer cannot continue with the purchase. It must happen before you request the payment OTP.
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: true in the response, but the registered photos do not change — so check the photos before sending them.
  • Comprehensive only. A quote_price_id belonging 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
Once you make a request to the Issue Policy API, you will get the Policy object with a 201 HTTP response code. Here is an example of the Policy object.
This is a summary of the fields returned in 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 the status 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.
On Sandbox, you can use a testing card with the following information:
Card number: 4111 1111 1111 1111
Expiry: 02/27
CVV: 123
Card owner: Yasmina test

Showing a policy

In order to get a status of a policy, you can use the Show Policy API. This API, takes a Yasmina Policy id 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
Example a response

Listing policies

You can also use the List Policies API to get a list of all policies that were generated from our system. You might use this on your admin interface, or if you just want to check what has been generated.

Claims

You can issue a claim using our APIs. When you issue a claim, we communicate it with the Insurance provider, and giving them details of the incident. Go to the Issue Claim API in order to start the claim process for your customer.