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

# Read a policy

> The policy as it stands now. While it is unpaid it carries the `payment_link`. Once it is paid for and issued, `coverage_confirmed` is `true`, `provider_policy_id` is the policy number, and `policy_url` and `invoice_url` are the certificate and the tax invoice. An open cover also totals the shipments covered under it in `declarations`.



## OpenAPI

````yaml /cargo-api-reference/openapi.json get /policies/{policyId}
openapi: 3.0.1
info:
  title: OpenAPI For Cargo Insurance
  description: >-
    APIs to insure a single shipment or run a marine open cover for your
    customers
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.yasmina.ai/api/v1/cargo
security:
  - bearerAuth: []
paths:
  /policies/{policyId}:
    get:
      tags:
        - Policies
      summary: Read a policy
      description: >-
        The policy as it stands now. While it is unpaid it carries the
        `payment_link`. Once it is paid for and issued, `coverage_confirmed` is
        `true`, `provider_policy_id` is the policy number, and `policy_url` and
        `invoice_url` are the certificate and the tax invoice. An open cover
        also totals the shipments covered under it in `declarations`.
      parameters:
        - name: policyId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: The policy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
              example:
                id: 2
                type: open_cover
                status: 1
                coverage_confirmed: true
                payment_link: null
                price: 18400
                start_date: '2026-11-22'
                provider_policy_id: WAL/MOC/7845407
                policy_url: >-
                  https://sandbox.yasmina.ai/storage/generated-pdfs/cargo/policies/bf0fb065-b93e-4965-b119-14998f1b8446.pdf
                invoice_url: >-
                  https://sandbox.yasmina.ai/storage/generated-pdfs/cargo/invoices/b4f6d7f1-913c-48cb-bfa4-fd7f6d255e05.pdf
                purchased_at: '2026-11-22T12:02:01.000000Z'
                redirect_url: https://partner.example.com/cargo/policies/2
                meta_data:
                  type: open_cover
                  quote:
                    vat: 2400
                    premium: 16000
                    coverage: icc_a
                    currency: SAR
                    cover_end: '2027-11-21'
                    extensions:
                      - warehouse_to_warehouse
                    cover_start: '2026-11-22'
                    total_price: 18400
                    valid_until: '2026-12-22'
                    price_currency: SAR
                    deposit_premium: 16000
                    valuation_basis: cif_plus_10
                    insurance_provider: walaa
                    max_value_per_shipment: 1500000
                    insurance_provider_name: Walaa Cooperative Insurance
                    declaration_rate_percent: 0.32
                    estimated_annual_premium: 64000
                    estimated_annual_value_sar: 20000000
                    max_value_per_shipment_sar: 1500000
                  customer:
                    role: importer
                    address:
                      city: Riyadh
                      street: King Fahd Road
                      country: SA
                      district: Al Olaya
                      postal_code: '13456'
                      building_number: '3456'
                    contact:
                      name: Sara Al-Harbi
                      email: sara@example.com
                      mobile: '+966512345678'
                    cr_number: '1010123456'
                    legal_name: Sample Trading Company 3456
                    vat_number: null
                    legal_name_ar: شركة التجارة النموذجية 3456
                  cover_end: '2027-11-21'
                  application:
                    goods:
                      - category: electronics
                        packaging: container_fcl
                        description: Consumer electronics
                        characteristics: []
                    routes:
                      - origin_country: CN
                        transport_mode: sea
                        destination_country: SA
                    coverage: icc_a
                    currency: SAR
                    extensions:
                      - warehouse_to_warehouse
                    policy_period:
                      start_date: '2026-11-22'
                    valuation_basis: cif_plus_10
                    insurance_history:
                      claims: []
                      first_policy: true
                    storage_locations:
                      - city: Jeddah
                        country: SA
                    estimated_annual_value:
                      export: 0
                      import: 20000000
                      domestic: 0
                    max_value_per_shipment: 1500000
                  cover_start: '2026-11-22'
                  customer_id: 1
                  quote_request_id: a349393d-185c-4688-9345-c6cdcbc52aa3
                  insurance_provider: walaa
                declarations:
                  count: 3
                  insured_amount_sar: 4067800
                  premium: 15155.36
                created_at: '2026-11-22T12:01:27.000000Z'
                updated_at: '2026-11-22T12:02:01.000000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Policy:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum:
            - single_shipment
            - open_cover
        status:
          type: integer
          description: '`0` until the policy is paid for and issued, `1` once it is.'
          enum:
            - 0
            - 1
        coverage_confirmed:
          type: boolean
          description: >-
            `true` once the policy is paid for and the insurance company has
            issued it. Treat the cargo as covered only then.
        payment_link:
          type: string
          description: >-
            The page to pay the policy on. Valid for 24 hours and renewed when
            you read the policy; `null` once the policy is issued.
          nullable: true
        price:
          type: number
          description: What is paid, VAT included, in SAR.
        start_date:
          type: string
          format: date
        provider_policy_id:
          type: string
          description: >-
            The insurance company's policy number. `null` until the policy is
            issued.
          nullable: true
        policy_url:
          type: string
          description: The policy certificate (PDF). `null` until the policy is issued.
          nullable: true
        invoice_url:
          type: string
          description: The tax invoice (PDF). `null` until the policy is issued.
          nullable: true
        purchased_at:
          type: string
          format: date-time
          nullable: true
        redirect_url:
          type: string
          nullable: true
        meta_data:
          type: object
          properties:
            type:
              type: string
            insurance_provider:
              type: string
            customer_id:
              type: integer
            quote_request_id:
              type: string
              format: uuid
            customer:
              type: object
              description: The customer as it was when the policy was issued.
            shipment:
              type: object
              description: The shipment covered. On a `single_shipment` policy.
            application:
              type: object
              description: >-
                The application the open cover was written on. On an
                `open_cover` policy.
            quote:
              type: object
              description: The quote the policy was issued from.
            cover_start:
              type: string
              format: date
            cover_end:
              type: string
              format: date
              nullable: true
        declarations:
          type: object
          properties:
            count:
              type: integer
            insured_amount_sar:
              type: number
            premium:
              type: number
          description: >-
            On an `open_cover` policy: the shipments covered under it so far,
            with their total insured amount and premium in SAR.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          description: >-
            On `42201`, the messages for each field that failed, keyed by the
            field's path.
        missing_fields:
          type: array
          description: On `40033`, the shipment details still needed.
          items:
            type: string
        policy_id:
          type: integer
          description: On `40026`, the policy the quote was already issued as.
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '40101'
            message: Unauthenticated
    NotFound:
      description: Record not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '40401'
            message: Model not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.