> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yasmina.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Issue policy

> For issuing a new policy. This version requires an email field and an istimarah document upload.



## OpenAPI

````yaml /cartpl-api-reference-v2/openapi.json post /v2/car/policies
openapi: 3.0.1
info:
  title: OpenAPI For Motor Insurance
  description: API's that you need to use to issue insurance policies to your clients
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://sandbox.yasmina.ai/api
    description: Sandbox
  - url: https://production.yasmina.ai/api
    description: Production
security:
  - bearerAuth: []
paths:
  /v2/car/policies:
    post:
      tags:
        - Policies
      summary: Issue policy
      description: >-
        For issuing a new policy. This version requires an email field and an
        istimarah document upload.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: Email address (must be @syarah.com domain)
                vin:
                  type: string
                  description: >-
                    Vehicle Identification Number (17 characters, must be
                    unique)
                car_sequence_number:
                  type: string
                  description: Car sequence number (8-9 digits, must be unique)
                current_car_owner:
                  description: The nationality ID of the current owner (10 digits)
                  type: string
                new_owner_id:
                  description: The Nationality ID of the new owner (10 digits)
                  type: string
                extra_fields:
                  type: object
                  description: >-
                    Optional free-form object with additional fields. Total
                    JSON-encoded size must not exceed 255 characters.
                  additionalProperties: true
                  example:
                    some_key: some value
                    another_key: 123
                istimarah:
                  type: string
                  format: binary
                  description: >-
                    Vehicle registration document (PDF, JPEG, JPG, or PNG, max
                    10MB)
              required:
                - email
                - vin
                - car_sequence_number
                - current_car_owner
                - new_owner_id
                - istimarah
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Problem in the values that you submitted
          content:
            application/json:
              schema:
                type: object
                example:
                  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.
components:
  schemas:
    Policy:
      type: object
      properties:
        id:
          type: integer
        meta_data:
          type: object
        start_date:
          type: string
        provider_policy_id:
          type: integer
        provider_policy:
          type: string
        order_status:
          type: integer
        approval_status:
          type: integer
        end_date:
          type: string
        is_claimed:
          type: boolean
        created_at:
          type: string
        updated_at:
          type: string
        client_id:
          type: string
        canceled_at:
          type: string
          nullable: true
        invoice:
          type: string
        cancellation_document:
          type: string
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: '40101'
              message:
                type: string
                example: Unauthenticated
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````