Issue policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"otp": "1234",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/policies"
payload = {
"otp": "1234",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
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({
otp: '1234',
quote_request_id: 123,
quote_reference_id: '550e8400-e29b-41d4-a716-446655440000',
quote_price_id: '550e8400-e29b-41d4-a716-446655440001'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/policies', 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/policies",
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([
'otp' => '1234',
'quote_request_id' => 123,
'quote_reference_id' => '550e8400-e29b-41d4-a716-446655440000',
'quote_price_id' => '550e8400-e29b-41d4-a716-446655440001'
]),
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/policies"
payload := strings.NewReader("{\n \"otp\": \"1234\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\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/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"otp\": \"1234\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/policies")
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 \"otp\": \"1234\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"meta_data": {},
"start_date": "<string>",
"provider_policy_id": 123,
"provider_policy": "<string>",
"order_status": 123,
"approval_status": 123,
"end_date": "<string>",
"is_claimed": true,
"created_at": "<string>",
"uploaded_at": "2023-11-07T05:31:56Z",
"updated_at": "<string>",
"client_id": "<string>",
"canceled_at": "<string>",
"invoice": "<string>",
"cancellation_document": "<string>"
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "42201",
"message": "The vin must be 17 characters. (and 3 more errors)",
"details": {
"vin": [
"The vin must be 17 characters."
],
"car_sequence_number": [
"The car sequence number must be 9 digits."
],
"new_owner_id": [
"The new owner id must be 10 digits."
],
"current_car_owner": [
"The current owner id field cannot be empty."
]
}
}For issuing a new policy
POST
/
policies
Issue policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"otp": "1234",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/policies"
payload = {
"otp": "1234",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
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({
otp: '1234',
quote_request_id: 123,
quote_reference_id: '550e8400-e29b-41d4-a716-446655440000',
quote_price_id: '550e8400-e29b-41d4-a716-446655440001'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/policies', 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/policies",
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([
'otp' => '1234',
'quote_request_id' => 123,
'quote_reference_id' => '550e8400-e29b-41d4-a716-446655440000',
'quote_price_id' => '550e8400-e29b-41d4-a716-446655440001'
]),
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/policies"
payload := strings.NewReader("{\n \"otp\": \"1234\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\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/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"otp\": \"1234\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/policies")
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 \"otp\": \"1234\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"meta_data": {},
"start_date": "<string>",
"provider_policy_id": 123,
"provider_policy": "<string>",
"order_status": 123,
"approval_status": 123,
"end_date": "<string>",
"is_claimed": true,
"created_at": "<string>",
"uploaded_at": "2023-11-07T05:31:56Z",
"updated_at": "<string>",
"client_id": "<string>",
"canceled_at": "<string>",
"invoice": "<string>",
"cancellation_document": "<string>"
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "42201",
"message": "The vin must be 17 characters. (and 3 more errors)",
"details": {
"vin": [
"The vin must be 17 characters."
],
"car_sequence_number": [
"The car sequence number must be 9 digits."
],
"new_owner_id": [
"The new owner id must be 10 digits."
],
"current_car_owner": [
"The current owner id field cannot be empty."
]
}
}Authorizations
JWT Authorization header using the Bearer scheme
Body
application/json
The OTP received by the customer from the Issue OTP API
Pattern:
^\d{4}$Example:
"1234"
ID of the car quote request
Example:
123
Unique identifier for the quote reference ID (coming from POST /quote-requests)
Example:
"550e8400-e29b-41d4-a716-446655440000"
Unique identifier for the quote price ID that exists inside a quote item (coming from POST /quote-requests)
Example:
"550e8400-e29b-41d4-a716-446655440001"
List of benefit UUIDs
UUID of a benefit (coming from POST /quote-request)
Example:
[
"6f45768d-edcd-4bb0-ab8a-712d549deee9",
"2f276e18-0c6e-49ca-b6e6-64700a1bef90"
]
Optional free-form object with additional fields. Total JSON-encoded size must not exceed 255 characters.
Example:
{
"some_key": "some value",
"another_key": 123
}
Response
Created
Timestamp when the provider policy document was attached. For issued motor policies this is the closest available issue/purchase timestamp.
⌘I