Issue policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v2/car/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form [email protected] \
--form 'vin=<string>' \
--form 'car_sequence_number=<string>' \
--form 'current_car_owner=<string>' \
--form 'new_owner_id=<string>' \
--form istimarah='@example-file'import requests
url = "https://sandbox.yasmina.ai/api/v2/car/policies"
files = { "istimarah": ("example-file", open("example-file", "rb")) }
payload = {
"email": "[email protected]",
"vin": "<string>",
"car_sequence_number": "<string>",
"current_car_owner": "<string>",
"new_owner_id": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('email', '[email protected]');
form.append('vin', '<string>');
form.append('car_sequence_number', '<string>');
form.append('current_car_owner', '<string>');
form.append('new_owner_id', '<string>');
form.append('istimarah', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://sandbox.yasmina.ai/api/v2/car/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/v2/car/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/v2/car/policies"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/v2/car/policies")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v2/car/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
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>",
"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": {
"email": [
"The email must be a valid email address."
],
"vin": [
"The vin must be 17 characters."
],
"car_sequence_number": [
"The car sequence number must be between 8 and 9 digits."
],
"new_owner_id": [
"The new owner id must be 10 digits."
],
"current_car_owner": [
"The current owner id must be 10 digits."
],
"istimarah": [
"The istimarah field is required."
]
}
}Issue policy
For issuing a new policy. This version requires an email field and an istimarah document upload.
POST
/
v2
/
car
/
policies
Issue policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v2/car/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form [email protected] \
--form 'vin=<string>' \
--form 'car_sequence_number=<string>' \
--form 'current_car_owner=<string>' \
--form 'new_owner_id=<string>' \
--form istimarah='@example-file'import requests
url = "https://sandbox.yasmina.ai/api/v2/car/policies"
files = { "istimarah": ("example-file", open("example-file", "rb")) }
payload = {
"email": "[email protected]",
"vin": "<string>",
"car_sequence_number": "<string>",
"current_car_owner": "<string>",
"new_owner_id": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('email', '[email protected]');
form.append('vin', '<string>');
form.append('car_sequence_number', '<string>');
form.append('current_car_owner', '<string>');
form.append('new_owner_id', '<string>');
form.append('istimarah', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://sandbox.yasmina.ai/api/v2/car/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/v2/car/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/v2/car/policies"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/v2/car/policies")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v2/car/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n[email protected]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"vin\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"car_sequence_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"current_car_owner\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_owner_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"istimarah\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
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>",
"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": {
"email": [
"The email must be a valid email address."
],
"vin": [
"The vin must be 17 characters."
],
"car_sequence_number": [
"The car sequence number must be between 8 and 9 digits."
],
"new_owner_id": [
"The new owner id must be 10 digits."
],
"current_car_owner": [
"The current owner id must be 10 digits."
],
"istimarah": [
"The istimarah field is required."
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Email address (must be @syarah.com domain)
Vehicle Identification Number (17 characters, must be unique)
Car sequence number (8-9 digits, must be unique)
The nationality ID of the current owner (10 digits)
The Nationality ID of the new owner (10 digits)
Vehicle registration document (PDF, JPEG, JPG, or PNG, max 10MB)
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
⌘I

