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

# Quote a shipment

> Asks for a price to insure one shipment. The answer is always `201`; read its `status`:

- `approved`: `quote` holds the price, valid until `quote.valid_until`. Issue the policy from it.
- `referred`: an underwriter has to review the shipment, and `reasons` says why. Read the request again until it is `approved` or `rejected`.
- `rejected`: the shipment cannot be insured, and `reasons` says why.

A quote needs the goods, the route, the value and the cover. The departure date, the carrier and the invoice number are needed to issue a policy but not to quote: send them now if you have them, or later with Issue a policy. `missing_to_issue` lists the ones still missing.



## OpenAPI

````yaml /cargo-api-reference/openapi.json post /quote-requests
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:
  /quote-requests:
    post:
      tags:
        - Single shipment
      summary: Quote a shipment
      description: >-
        Asks for a price to insure one shipment. The answer is always `201`;
        read its `status`:


        - `approved`: `quote` holds the price, valid until `quote.valid_until`.
        Issue the policy from it.

        - `referred`: an underwriter has to review the shipment, and `reasons`
        says why. Read the request again until it is `approved` or `rejected`.

        - `rejected`: the shipment cannot be insured, and `reasons` says why.


        A quote needs the goods, the route, the value and the cover. The
        departure date, the carrier and the invoice number are needed to issue a
        policy but not to quote: send them now if you have them, or later with
        Issue a policy. `missing_to_issue` lists the ones still missing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: integer
                  description: A customer you registered.
                shipment:
                  $ref: '#/components/schemas/Shipment'
              required:
                - customer_id
                - shipment
            example:
              customer_id: 2
              shipment:
                goods:
                  description: Consumer electronics, 400 cartons
                  category: electronics
                  packaging: cartons
                  quantity: 400
                  characteristics:
                    - fragile
                transport_mode: sea
                origin:
                  country: CN
                  city: Shanghai
                destination:
                  country: SA
                  city: Jeddah
                invoice_value: 250000
                currency: USD
                freight: 12000
                other_costs: 1500
                incoterm: FOB
                coverage: icc_a
                extensions:
                  - war
                  - strikes
      responses:
        '201':
          description: The quote request, with its decision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteRequest'
              examples:
                approved:
                  summary: Approved
                  value:
                    id: a34af107-128e-4c87-934f-5658d04f5870
                    type: single_shipment
                    status: approved
                    customer_id: 2
                    shipment:
                      goods:
                        description: Consumer electronics, 400 cartons
                        category: electronics
                        packaging: cartons
                        quantity: 400
                        characteristics:
                          - fragile
                      transport_mode: sea
                      origin:
                        country: CN
                        city: Shanghai
                      destination:
                        country: SA
                        city: Jeddah
                      invoice_value: 250000
                      currency: USD
                      freight: 12000
                      other_costs: 1500
                      incoterm: FOB
                      coverage: icc_a
                      extensions:
                        - war
                        - strikes
                    quote:
                      insurance_provider: walaa
                      insurance_provider_name: Walaa Cooperative Insurance
                      coverage: icc_a
                      extensions:
                        - war
                        - strikes
                      valuation_basis: cif_plus_10
                      insured_amount: 289850
                      currency: USD
                      insured_amount_sar: 1086937.5
                      rate_percent: 0.45
                      premium: 4891.22
                      vat: 733.68
                      total_price: 5624.9
                      price_currency: SAR
                      valid_until: '2026-12-23'
                    reasons: []
                    missing_to_issue:
                      - departure_date
                      - conveyance.carrier_name
                      - references.invoice_number
                    policy_id: null
                    decided_at: '2026-11-23T08:31:06.000000Z'
                    created_at: '2026-11-23T08:31:06.000000Z'
                    updated_at: '2026-11-23T08:31:06.000000Z'
                referred:
                  summary: Referred to an underwriter
                  value:
                    id: a34af107-9cae-4c87-a179-2423e81d00af
                    type: single_shipment
                    status: referred
                    customer_id: 2
                    shipment:
                      goods:
                        description: Consumer electronics, 400 cartons
                        category: electronics
                        packaging: cartons
                        quantity: 400
                        characteristics:
                          - hazardous
                      transport_mode: sea
                      origin:
                        country: CN
                        city: Shanghai
                      destination:
                        country: SA
                        city: Jeddah
                      invoice_value: 250000
                      currency: USD
                      freight: 12000
                      other_costs: 1500
                      incoterm: FOB
                      coverage: icc_a
                      extensions:
                        - war
                        - strikes
                    quote: null
                    reasons:
                      - Hazardous goods need an underwriter's review.
                    missing_to_issue:
                      - departure_date
                      - conveyance.carrier_name
                      - references.invoice_number
                    policy_id: null
                    decided_at: null
                    created_at: '2026-11-23T08:31:07.000000Z'
                    updated_at: '2026-11-23T08:31:07.000000Z'
                rejected:
                  summary: Rejected
                  value:
                    id: a34af108-2143-4865-9069-2c2b05a618dd
                    type: single_shipment
                    status: rejected
                    customer_id: 2
                    shipment:
                      goods:
                        description: Consumer electronics, 400 cartons
                        category: electronics
                        packaging: cartons
                        quantity: 400
                        characteristics:
                          - fragile
                      transport_mode: sea
                      origin:
                        country: KP
                      destination:
                        country: SA
                        city: Jeddah
                      invoice_value: 250000
                      currency: USD
                      freight: 12000
                      other_costs: 1500
                      incoterm: FOB
                      coverage: icc_a
                      extensions:
                        - war
                        - strikes
                    quote: null
                    reasons:
                      - Shipments to or from North Korea cannot be insured.
                    missing_to_issue:
                      - departure_date
                      - conveyance.carrier_name
                      - references.invoice_number
                    policy_id: null
                    decided_at: '2026-11-23T08:31:07.000000Z'
                    created_at: '2026-11-23T08:31:07.000000Z'
                    updated_at: '2026-11-23T08:31:07.000000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    Shipment:
      type: object
      properties:
        goods:
          type: object
          properties:
            description:
              type: string
              description: What the goods are, in plain words.
              maxLength: 500
            category:
              type: string
              description: >-
                The kind of goods. One of the `goods_categories` values from Get
                the options.
            packaging:
              type: string
              description: >-
                How the goods are packed. One of the `packaging` values from Get
                the options.
            characteristics:
              type: array
              description: >-
                Anything about the goods that changes the risk. Each one of the
                `characteristics` values from Get the options.
              items:
                type: string
            quantity:
              type: integer
              description: Number of packages.
              minimum: 1
            condition:
              type: string
              description: >-
                New or used. One of the `conditions` values from Get the
                options.
          required:
            - description
            - category
            - packaging
        transport_mode:
          type: string
          description: >-
            How the goods travel. One of the `transport_modes` values from Get
            the options.
        origin:
          type: object
          properties:
            country:
              type: string
              description: Two-letter country code.
              example: CN
            city:
              type: string
          required:
            - country
        destination:
          type: object
          properties:
            country:
              type: string
              description: Two-letter country code.
              example: SA
            city:
              type: string
          required:
            - country
        invoice_value:
          type: number
          description: The value of the goods on the commercial invoice, in `currency`.
          example: 250000
        currency:
          type: string
          description: >-
            The currency of the invoice, freight and other costs. One of the
            `currencies` values from Get the options.
        freight:
          type: number
          description: Freight cost, in `currency`.
        other_costs:
          type: number
          description: Other costs to deliver the goods, in `currency`.
        insured_amount:
          type: number
          description: >-
            The amount to insure, in `currency`. Leave it out to insure the
            shipment's value on the valuation basis.
        incoterm:
          type: string
          description: >-
            The Incoterm the goods are sold under. One of the `incoterms` values
            from Get the options.
        insurance_arranged_by:
          type: string
          description: >-
            Which side of the sale arranges the insurance. One of the
            `insurance_arranged_by` values from Get the options.
        coverage:
          type: string
          description: >-
            The cover wanted. One of the `coverages` values from Get the
            options.
        extensions:
          type: array
          description: >-
            Extra cover on top. Each one of the `extensions` values from Get the
            options.
          items:
            type: string
        valuation_basis:
          type: string
          description: >-
            How the shipment is valued. Defaults to `cif_plus_10`. One of the
            `valuation_bases` values from Get the options.
        departure_date:
          type: string
          description: >-
            The day the shipment leaves, `YYYY-MM-DD`. Needed before a policy
            can be issued.
          format: date
        arrival_date:
          type: string
          description: The day it is expected to arrive, on or after `departure_date`.
          format: date
        conveyance:
          type: object
          properties:
            carrier_name:
              type: string
              description: Who carries the shipment. Needed before a policy can be issued.
            vessel_name:
              type: string
            voyage_or_flight_number:
              type: string
        references:
          type: object
          properties:
            invoice_number:
              type: string
              description: >-
                The commercial invoice the shipment travels under. Needed before
                a policy can be issued.
            bill_of_lading:
              type: string
            airway_bill:
              type: string
            customs_declaration:
              type: string
        beneficiary:
          type: object
          properties:
            name:
              type: string
            address:
              type: string
          description: >-
            Who a claim is paid to, when that is not the customer (a bank, for
            example).
      required:
        - goods
        - transport_mode
        - origin
        - destination
        - invoice_value
        - currency
        - coverage
      description: >-
        One shipment to quote. The goods, route, value and cover set the price
        and are fixed once quoted; the departure date, carrier, references and
        beneficiary can be sent now or when the policy is issued.
    QuoteRequest:
      type: object
      properties:
        id:
          type: string
          description: The request's id.
          format: uuid
        type:
          type: string
          enum:
            - single_shipment
            - open_cover
        status:
          type: string
          description: >-
            `approved`: `quote` holds the price and a policy can be issued.
            `referred`: an underwriter is reviewing it; read the request again
            until the status changes. `rejected`: it cannot be insured.
          enum:
            - approved
            - referred
            - rejected
        customer_id:
          type: integer
        shipment:
          $ref: '#/components/schemas/Shipment'
        quote:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ShipmentQuote'
        missing_to_issue:
          type: array
          description: >-
            The shipment details still needed before a policy can be issued, as
            paths into `shipment`. Send them with Issue a policy.
          items:
            type: string
          example:
            - departure_date
            - conveyance.carrier_name
            - references.invoice_number
        reasons:
          type: array
          description: >-
            Why the request was referred or rejected, in plain sentences. Stays
            on a referral after it is approved.
          items:
            type: string
        policy_id:
          type: integer
          description: The policy issued from this request, once there is one.
          nullable: true
        decided_at:
          type: string
          description: >-
            When the request was approved or rejected. `null` while it is
            referred.
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ShipmentQuote:
      type: object
      properties:
        insurance_provider:
          type: string
          description: The insurance company behind the quote.
          example: walaa
        insurance_provider_name:
          type: string
          example: Walaa Cooperative Insurance
        coverage:
          type: string
        extensions:
          type: array
          items:
            type: string
        valuation_basis:
          type: string
        insured_amount:
          type: number
          description: The amount insured, in `currency`.
        currency:
          type: string
        insured_amount_sar:
          type: number
          description: The amount insured, in SAR.
        rate_percent:
          type: number
          description: The premium rate, as a percentage of the insured amount.
        premium:
          type: number
          description: The premium before VAT, in SAR.
        vat:
          type: number
          description: 15% VAT, in SAR.
        total_price:
          type: number
          description: What is paid, in SAR.
        price_currency:
          type: string
          example: SAR
        valid_until:
          type: string
          description: The last day a policy can be issued from this quote.
          format: date
      description: The price of the shipment. `null` unless the request is approved.
    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
    UnprocessableEntity:
      description: A field is missing or not valid. `details` names each one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '42201'
            message: >-
              The shipment.goods.description field cannot be empty. (and 1 more
              error)
            details:
              shipment.goods.description:
                - The shipment.goods.description field cannot be empty.
              shipment.goods.category:
                - The selected shipment.goods.category is invalid.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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