> ## 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



## OpenAPI

````yaml /car-api-reference/openapi.json post /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: 1.0.0
servers:
  - x-fern-server-name: Sandbox
    url: https://sandbox.yasmina.ai/api/v1/car-comp
  - x-fern-server-name: Production
    url: https://production.yasmina.ai/api/v1/car-comp
security:
  - Oauth2: []
paths:
  /policies:
    post:
      tags:
        - Policies
      summary: Issue policy
      description: For issuing a new policy
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                otp:
                  type: string
                  description: The OTP received by the customer from the Issue OTP API
                  example: '123456'
                quote_request_id:
                  type: integer
                  description: ID of the car quote request
                  example: 123
                quote_reference_id:
                  type: string
                  format: uuid
                  description: >-
                    Unique identifier for the quote reference ID (coming from
                    POST /quote-requests)
                  example: 550e8400-e29b-41d4-a716-446655440000
                quote_price_id:
                  type: string
                  format: uuid
                  description: >-
                    Unique identifier for the quote price ID that exists inside
                    a quote item (coming from POST /quote-requests)
                  example: 550e8400-e29b-41d4-a716-446655440001
                benefits:
                  type: array
                  items:
                    type: string
                    format: uuid
                    description: UUID of a benefit (coming from POST /quote-request)
                  description: List of benefit UUIDs
                  example:
                    - 6f45768d-edcd-4bb0-ab8a-712d549deee9
                    - 2f276e18-0c6e-49ca-b6e6-64700a1bef90
                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
              required:
                - otp
                - quote_request_id
                - quote_reference_id
                - quote_price_id
      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:
                    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.
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
        uploaded_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Timestamp when the provider policy document was attached. For issued
            motor policies this is the closest available issue/purchase
            timestamp.
        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:
    Oauth2:
      description: JWT Authorization header using the Bearer scheme
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes: {}

````