Skip to main content
POST
Cancel policy

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

carPolicy
integer
required

Body

multipart/form-data
cancellation_document
file
required

Updated vehicle information document after ownership transfer. Upload a PDF, JPG, JPEG, or PNG file. The document must include the same VIN and sequence number as the policy, and the owner ID must be different from the policy owner.

Response

Cancellation success

id
integer

Yasmina's unique identifier for the policy. Use it to correlate webhook payloads with your records.

meta_data
object

The information the policy was requested with: vin, email, car_sequence_number, current_car_owner, new_owner_id, the stored istimarah document path, and the extra_fields object you submitted (echoed back unchanged, useful for carrying your own reference IDs). When the policy is placed on hold (status = 3), incorrect_info_message explains what needs to be corrected.

status
enum<integer>

Policy lifecycle status:

  • 0Pending issuance: the request was received and the policy has not been issued yet.
  • 1Issued: the policy has been issued; policy_url and invoice_url point to the policy and invoice documents.
  • 2Canceled: cancellation was requested or completed (cancellation_request_at / canceled_at are set).
  • 3On hold, correction required: Yasmina flagged the submitted information as incorrect (for example an unreadable istimarah). The reason is provided in meta_data.incorrect_info_message. This status is not final: once a corrected document is provided, the status returns to 0 (pending) and the policy can still be issued (1).

Every status change triggers the Status Update webhook, so your webhook endpoint should accept any transition between these values.

Available options:
0,
1,
2,
3
client_id
string<uuid>

Identifier of your client account.

product_id
integer

Identifier of the Yasmina product this policy belongs to.

insurance_company_id
string<uuid> | null

Identifier of the insurance company issuing the policy.

provider_policy_id
string | null

The policy number assigned by the policy provider. null until assigned.

provider_policy
string | null

Storage path of the issued policy document. Use policy_url for a downloadable link. null until the policy is issued.

policy_url
string | null

Download URL of the issued policy document. null until the policy is issued.

invoice
string | null

Storage path of the invoice document. Use invoice_url for a downloadable link. null until available.

invoice_url
string | null

Download URL of the invoice document. null until available.

Secure payment link generated by Yasmina, when payment is required.

price
number | null

Price of the policy in Saudi Riyal.

redirect_url
string | null

URL the customer is redirected to after payment, when configured.

start_date
string<date> | null

Start date of the policy coverage.

uploaded_at
string<date-time> | null

When the issued policy document was uploaded.

purchased_at
string<date-time> | null

When the policy was purchased.

transfer_date_at
string<date-time> | null

When the vehicle ownership transfer took place.

cancellation_request_at
string<date-time> | null

When cancellation was requested. Non-null implies status = 2.

canceled_at
string<date-time> | null

When the policy was canceled. Non-null implies status = 2.

cancellation_confirmed_at
string<date-time> | null

When the cancellation was confirmed by the insurance company.

cancellation_document
string | null

Storage path of the cancellation document submitted with a cancellation request.

is_old_policy
integer

Internal flag; 0 for policies issued through this API.

pdf_parsed
integer

Internal flag indicating whether the issued policy PDF has been parsed.

has_sent_cancellation_email
integer

Internal flag indicating whether a cancellation email has been sent.

created_at
string<date-time>

When the policy request was created.

updated_at
string<date-time>

When the policy was last updated.

deleted_at
string<date-time> | null

When the policy was deleted, if ever.