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

# Declare a shipment

> Declares one shipment under an open-cover policy. A shipment inside the policy's terms (its goods, its routes and its limit per shipment) is covered at once: `status` is `issued` and `certificate_url` is its certificate. A shipment outside them is `referred` to an underwriter, and `reasons` says why; read the declaration again until it is `issued` or `rejected`.

`premium` is what the shipment costs at the policy's rate. Declared premiums are reported here and totalled on the policy; they are not paid through a payment link.

`shipment.departure_date` has to fall within the policy period.



## OpenAPI

````yaml /cargo-api-reference/openapi.json post /policies/{policyId}/declarations
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}/declarations:
    post:
      tags:
        - Open cover
      summary: Declare a shipment
      description: >-
        Declares one shipment under an open-cover policy. A shipment inside the
        policy's terms (its goods, its routes and its limit per shipment) is
        covered at once: `status` is `issued` and `certificate_url` is its
        certificate. A shipment outside them is `referred` to an underwriter,
        and `reasons` says why; read the declaration again until it is `issued`
        or `rejected`.


        `premium` is what the shipment costs at the policy's rate. Declared
        premiums are reported here and totalled on the policy; they are not paid
        through a payment link.


        `shipment.departure_date` has to fall within the policy period.
      parameters:
        - name: policyId
          in: path
          required: true
          schema:
            type: integer
          description: An open-cover policy that is paid for and issued.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                shipment:
                  $ref: '#/components/schemas/DeclaredShipment'
              required:
                - shipment
            example:
              shipment:
                goods:
                  category: electronics
                  quantity: 400
                  packaging: container_fcl
                  description: 400 cartons of tablets
                  characteristics: []
                origin:
                  city: Shanghai
                  country: CN
                freight: 14000
                currency: SAR
                conveyance:
                  vessel_name: MV Jeddah Star
                  carrier_name: Bahri Logistics
                  voyage_or_flight_number: JS-2291
                references:
                  bill_of_lading: BHLU40112233
                  invoice_number: INV-2026-0142
                destination:
                  city: Jeddah
                  country: SA
                invoice_value: 620000
                departure_date: '2026-12-02'
                transport_mode: sea
      responses:
        '201':
          description: The declaration, with its decision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Declaration'
              example:
                id: a3494d91-326e-4a59-8545-d99fe282d5eb
                policy_id: 2
                status: issued
                coverage_confirmed: true
                shipment:
                  goods:
                    category: electronics
                    quantity: 400
                    packaging: container_fcl
                    description: 400 cartons of tablets
                    characteristics: []
                  origin:
                    city: Shanghai
                    country: CN
                  freight: 14000
                  currency: SAR
                  conveyance:
                    vessel_name: MV Jeddah Star
                    carrier_name: Bahri Logistics
                    voyage_or_flight_number: JS-2291
                  references:
                    bill_of_lading: BHLU40112233
                    invoice_number: INV-2026-0142
                  destination:
                    city: Jeddah
                    country: SA
                  invoice_value: 620000
                  departure_date: '2026-12-02'
                  transport_mode: sea
                premium:
                  vat: 334.75
                  premium: 2231.68
                  currency: SAR
                  total_price: 2566.43
                  rate_percent: 0.32
                  insured_amount: 697400
                  price_currency: SAR
                  insured_amount_sar: 697400
                reasons: []
                certificate_number: WAL/MOC/7845407-0003
                certificate_url: >-
                  https://sandbox.yasmina.ai/storage/generated-pdfs/cargo/declarations/08802f0e-cf12-489d-8571-4cbe8528f5b6.pdf
                decided_at: '2026-11-22T12:58:13.000000Z'
                created_at: '2026-11-22T12:58:13.000000Z'
                updated_at: '2026-11-22T12:58:13.000000Z'
        '400':
          description: >-
            `40027` when the open-cover policy is not paid for and issued yet,
            or is past its last day.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: '40027'
                message: >-
                  Shipments can be declared once the open-cover policy is paid
                  for and issued, and until its last day.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    DeclaredShipment:
      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.
        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
        - departure_date
        - conveyance
        - references
      description: >-
        A shipment declared under an open-cover policy. The coverage, extensions
        and valuation basis are the policy's, so it does not name them. It is
        covered straight away, so `departure_date`, `conveyance.carrier_name`
        and `references.invoice_number` are required.
    Declaration:
      type: object
      properties:
        id:
          type: string
          format: uuid
        policy_id:
          type: integer
        status:
          type: string
          description: >-
            `issued`: the shipment is covered and has its certificate.
            `referred`: an underwriter is reviewing it; read the declaration
            again until the status changes. `rejected`: it cannot be covered.
          enum:
            - issued
            - referred
            - rejected
        coverage_confirmed:
          type: boolean
          description: '`true` once the shipment is covered.'
        shipment:
          $ref: '#/components/schemas/DeclaredShipment'
        premium:
          type: object
          properties:
            insured_amount:
              type: number
            currency:
              type: string
            insured_amount_sar:
              type: number
            rate_percent:
              type: number
            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
          description: What the shipment costs at the policy's rate.
        reasons:
          type: array
          items:
            type: string
        certificate_number:
          type: string
          nullable: true
        certificate_url:
          type: string
          description: The shipment's certificate (PDF). `null` until it is covered.
          nullable: true
        decided_at:
          type: string
          format: date-time
          nullable: true
        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
    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.