Life S&P Products
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/life-snp/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"applicant_id": "0123456789",
"date_of_birth": "1990-06-15",
"gender": "male",
"smoker": false,
"policy_term_years": 20,
"premium_frequency": "monthly",
"target_premium": 250
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/life-snp/offers"
payload = {
"applicant_id": "0123456789",
"date_of_birth": "1990-06-15",
"gender": "male",
"smoker": False,
"policy_term_years": 20,
"premium_frequency": "monthly",
"target_premium": 250
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
applicant_id: '0123456789',
date_of_birth: '1990-06-15',
gender: 'male',
smoker: false,
policy_term_years: 20,
premium_frequency: 'monthly',
target_premium: 250
})
};
fetch('https://sandbox.yasmina.ai/api/v1/life-snp/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.yasmina.ai/api/v1/life-snp/offers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'applicant_id' => '0123456789',
'date_of_birth' => '1990-06-15',
'gender' => 'male',
'smoker' => false,
'policy_term_years' => 20,
'premium_frequency' => 'monthly',
'target_premium' => 250
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.yasmina.ai/api/v1/life-snp/offers"
payload := strings.NewReader("{\n \"applicant_id\": \"0123456789\",\n \"date_of_birth\": \"1990-06-15\",\n \"gender\": \"male\",\n \"smoker\": false,\n \"policy_term_years\": 20,\n \"premium_frequency\": \"monthly\",\n \"target_premium\": 250\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.yasmina.ai/api/v1/life-snp/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"applicant_id\": \"0123456789\",\n \"date_of_birth\": \"1990-06-15\",\n \"gender\": \"male\",\n \"smoker\": false,\n \"policy_term_years\": 20,\n \"premium_frequency\": \"monthly\",\n \"target_premium\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/life-snp/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"applicant_id\": \"0123456789\",\n \"date_of_birth\": \"1990-06-15\",\n \"gender\": \"male\",\n \"smoker\": false,\n \"policy_term_years\": 20,\n \"premium_frequency\": \"monthly\",\n \"target_premium\": 250\n}"
response = http.request(request)
puts response.read_body[
{
"offer_id": "<string>",
"insurer": "<string>",
"sum_assured": 123,
"premium": 123,
"premium_frequency": "<string>",
"policy_term_years": 123,
"riders_included": [
"<string>"
],
"maturity_benefit": true,
"notes": "<string>"
}
]{
"code": "40101",
"message": "Unauthenticated"
}Life S&P Products
Generates Life S&P offers (premiums and benefits) from multiple insurers for a bank’s customers.
POST
/
offers
Life S&P Products
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/life-snp/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"applicant_id": "0123456789",
"date_of_birth": "1990-06-15",
"gender": "male",
"smoker": false,
"policy_term_years": 20,
"premium_frequency": "monthly",
"target_premium": 250
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/life-snp/offers"
payload = {
"applicant_id": "0123456789",
"date_of_birth": "1990-06-15",
"gender": "male",
"smoker": False,
"policy_term_years": 20,
"premium_frequency": "monthly",
"target_premium": 250
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
applicant_id: '0123456789',
date_of_birth: '1990-06-15',
gender: 'male',
smoker: false,
policy_term_years: 20,
premium_frequency: 'monthly',
target_premium: 250
})
};
fetch('https://sandbox.yasmina.ai/api/v1/life-snp/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.yasmina.ai/api/v1/life-snp/offers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'applicant_id' => '0123456789',
'date_of_birth' => '1990-06-15',
'gender' => 'male',
'smoker' => false,
'policy_term_years' => 20,
'premium_frequency' => 'monthly',
'target_premium' => 250
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.yasmina.ai/api/v1/life-snp/offers"
payload := strings.NewReader("{\n \"applicant_id\": \"0123456789\",\n \"date_of_birth\": \"1990-06-15\",\n \"gender\": \"male\",\n \"smoker\": false,\n \"policy_term_years\": 20,\n \"premium_frequency\": \"monthly\",\n \"target_premium\": 250\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.yasmina.ai/api/v1/life-snp/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"applicant_id\": \"0123456789\",\n \"date_of_birth\": \"1990-06-15\",\n \"gender\": \"male\",\n \"smoker\": false,\n \"policy_term_years\": 20,\n \"premium_frequency\": \"monthly\",\n \"target_premium\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/life-snp/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"applicant_id\": \"0123456789\",\n \"date_of_birth\": \"1990-06-15\",\n \"gender\": \"male\",\n \"smoker\": false,\n \"policy_term_years\": 20,\n \"premium_frequency\": \"monthly\",\n \"target_premium\": 250\n}"
response = http.request(request)
puts response.read_body[
{
"offer_id": "<string>",
"insurer": "<string>",
"sum_assured": 123,
"premium": 123,
"premium_frequency": "<string>",
"policy_term_years": 123,
"riders_included": [
"<string>"
],
"maturity_benefit": true,
"notes": "<string>"
}
]{
"code": "40101",
"message": "Unauthenticated"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
- Option 1
- Option 2
Saudi National ID of the applicant (10 digits).
Pattern:
^\d{10}$YYYY-MM-DD
Available options:
male, female Required range:
5 <= x <= 40Available options:
monthly, quarterly, semi_annual, annual SAR. Required if target_premium is not provided.
Required range:
x >= 10000Required range:
100 <= x <= 250Required range:
30 <= x <= 300Insurer occupation class code or text.
Required range:
x >= 0SAR per chosen frequency. Required if sum_assured is not provided.
Required range:
x >= 50Available options:
bank Optional key-value extras (max JSON-encoded size 255 chars).
⌘I

