curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001",
"iban": "SA0380000000608010167519"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp"
payload = {
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001",
"iban": "SA0380000000608010167519"
}
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({
email: '[email protected]',
phone: '0501234567',
owner_id: '1012345678',
quote_request_id: 123,
quote_reference_id: '550e8400-e29b-41d4-a716-446655440000',
quote_price_id: '550e8400-e29b-41d4-a716-446655440001',
iban: 'SA0380000000608010167519'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp', 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/car-comp/issue-otp",
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([
'email' => '[email protected]',
'phone' => '0501234567',
'owner_id' => '1012345678',
'quote_request_id' => 123,
'quote_reference_id' => '550e8400-e29b-41d4-a716-446655440000',
'quote_price_id' => '550e8400-e29b-41d4-a716-446655440001',
'iban' => 'SA0380000000608010167519'
]),
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/car-comp/issue-otp"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"iban\": \"SA0380000000608010167519\"\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/car-comp/issue-otp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"iban\": \"SA0380000000608010167519\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp")
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 \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"iban\": \"SA0380000000608010167519\"\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": "40013",
"message": "The IBAN number is incorrect or does not belong to the customer"
}{
"code": "40101",
"message": "Unauthenticated"
}Request OTP for Issuing Policy
Sends a separate policy issuance OTP. This OTP is valid for 15 minutes and must be submitted to POST /policies before it expires. The 8-hour quote OTP validity does not apply to policy issuance.
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001",
"iban": "SA0380000000608010167519"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp"
payload = {
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001",
"iban": "SA0380000000608010167519"
}
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({
email: '[email protected]',
phone: '0501234567',
owner_id: '1012345678',
quote_request_id: 123,
quote_reference_id: '550e8400-e29b-41d4-a716-446655440000',
quote_price_id: '550e8400-e29b-41d4-a716-446655440001',
iban: 'SA0380000000608010167519'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp', 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/car-comp/issue-otp",
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([
'email' => '[email protected]',
'phone' => '0501234567',
'owner_id' => '1012345678',
'quote_request_id' => 123,
'quote_reference_id' => '550e8400-e29b-41d4-a716-446655440000',
'quote_price_id' => '550e8400-e29b-41d4-a716-446655440001',
'iban' => 'SA0380000000608010167519'
]),
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/car-comp/issue-otp"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"iban\": \"SA0380000000608010167519\"\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/car-comp/issue-otp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"iban\": \"SA0380000000608010167519\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp")
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 \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"iban\": \"SA0380000000608010167519\"\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": "40013",
"message": "The IBAN number is incorrect or does not belong to the customer"
}{
"code": "40101",
"message": "Unauthenticated"
}Authorizations
JWT Authorization header using the Bearer scheme
Body
Email address of the car owner
Phone number starting with 05 and containing 10 digits
^05\d{8}$"0501234567"
National ID or Iqama ID of the car owner (10 digits)
^(1|2)\d{9}$"1012345678"
ID of the car quote request
123
Unique identifier for the quote reference ID (coming from POST /quote-requests)
"550e8400-e29b-41d4-a716-446655440000"
Unique identifier for the quote price ID that exists inside a quote item (coming from POST /quote-requests)
"550e8400-e29b-41d4-a716-446655440001"
The customer's Saudi IBAN (SA followed by 22 digits, no spaces). It is sent to the insurance provider with the payment OTP request and used to transfer claim settlements and refunds to the customer; the account is never charged.
^SA\d{22}$"SA0380000000608010167519"