Issue policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vin": "<string>",
"car_sequence_number": "<string>",
"current_car_owner": "<string>",
"new_owner_id": "<string>"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car/policies"
payload = {
"vin": "<string>",
"car_sequence_number": "<string>",
"current_car_owner": "<string>",
"new_owner_id": "<string>"
}
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({
vin: '<string>',
car_sequence_number: '<string>',
current_car_owner: '<string>',
new_owner_id: '<string>'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/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/v1/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 => json_encode([
'vin' => '<string>',
'car_sequence_number' => '<string>',
'current_car_owner' => '<string>',
'new_owner_id' => '<string>'
]),
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/policies"
payload := strings.NewReader("{\n \"vin\": \"<string>\",\n \"car_sequence_number\": \"<string>\",\n \"current_car_owner\": \"<string>\",\n \"new_owner_id\": \"<string>\"\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/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vin\": \"<string>\",\n \"car_sequence_number\": \"<string>\",\n \"current_car_owner\": \"<string>\",\n \"new_owner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/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["Content-Type"] = 'application/json'
request.body = "{\n \"vin\": \"<string>\",\n \"car_sequence_number\": \"<string>\",\n \"current_car_owner\": \"<string>\",\n \"new_owner_id\": \"<string>\"\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>",
"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."
]
}
}Issue policy
For issuing a new policy
POST
/
car
/
policies
Issue policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vin": "<string>",
"car_sequence_number": "<string>",
"current_car_owner": "<string>",
"new_owner_id": "<string>"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car/policies"
payload = {
"vin": "<string>",
"car_sequence_number": "<string>",
"current_car_owner": "<string>",
"new_owner_id": "<string>"
}
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({
vin: '<string>',
car_sequence_number: '<string>',
current_car_owner: '<string>',
new_owner_id: '<string>'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/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/v1/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 => json_encode([
'vin' => '<string>',
'car_sequence_number' => '<string>',
'current_car_owner' => '<string>',
'new_owner_id' => '<string>'
]),
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/policies"
payload := strings.NewReader("{\n \"vin\": \"<string>\",\n \"car_sequence_number\": \"<string>\",\n \"current_car_owner\": \"<string>\",\n \"new_owner_id\": \"<string>\"\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/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vin\": \"<string>\",\n \"car_sequence_number\": \"<string>\",\n \"current_car_owner\": \"<string>\",\n \"new_owner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/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["Content-Type"] = 'application/json'
request.body = "{\n \"vin\": \"<string>\",\n \"car_sequence_number\": \"<string>\",\n \"current_car_owner\": \"<string>\",\n \"new_owner_id\": \"<string>\"\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>",
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The nationality ID of the current owner
The Nationality ID of the new owner
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

