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

# Get Insurance Quote

> Retrieves insurance pricing rules.

A range of pricing rules is returned, and the logic to determine which rule to use should be handled on the client side.

The `store_url` is the URL of the store to get insurance quote for, e.g. `docs.orderprotection.com`.

#### Example

If the subtotal (the price before add-ons and shipping) is `$1,000`, and one of the pricing rules specifies a minimum of `$0` and a maximum of `$5,000`, this rule should be applied to calculate the price of Order Protection, as the subtotal falls within the specified range.

#### Notes

* The amounts in pricing rules are always in `USD`. If the subtotal is in a different currency, the amount should be converted to the cart's currency using the current exchange rate.

* The `rules` array is sorted by `min` in ascending order.

* If the pricing rule has a type of `brand`, Order Protection should not be added to the cart.


## OpenAPI

````yaml openapi-quote GET /v1/quote/insurance?store_url={store_url}
openapi: 3.0.0
info:
  title: Quote API
  version: '1.0'
  description: API for retrieving insurance quotes
servers:
  - url: https://api.production.orderprotection.com
    description: Production server
security: []
tags:
  - name: Quote
    description: ''
paths:
  /v1/quote/insurance?store_url={store_url}:
    get:
      tags:
        - Quote
      summary: Get Insurance Quote
      operationId: calculateQuote
      parameters:
        - name: store_url
          in: path
          required: true
          schema:
            type: string
          description: URL of the store to get insurance quote for
      responses:
        '200':
          description: Successfully retrieved insurance quote
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - automaticallyAddToCart
                  - mandatoryOp
                  - rules
                properties:
                  id:
                    type: string
                    example: clz1sc3z8039p8ruxx7mrob50
                  automaticallyAddToCart:
                    type: boolean
                    description: >-
                      Order Protection should automatically be added to the cart
                      if this is true
                    example: true
                  mandatoryOp:
                    type: boolean
                    description: Order Protection should always be added to the cart
                    example: false
                  rules:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - min
                        - max
                        - terms
                      properties:
                        id:
                          type: string
                          example: cm7b0iepj0007wbgxv6q91iaj
                        min:
                          type: number
                          description: >-
                            The minimum amount the subtotal value should be to
                            use this price range
                          example: 0
                        max:
                          type: number
                          description: >-
                            The maximum amount the subtotal value should be to
                            use this price range
                          example: 5000
                        terms:
                          type: object
                          required:
                            - paidBy
                          properties:
                            paidBy:
                              type: string
                              enum:
                                - customer
                                - brand
                              example: customer
                            customer:
                              $ref: '#/components/schemas/AmountConfig'
                            brand:
                              $ref: '#/components/schemas/AmountConfig'
                  variants:
                    type: array
                    nullable: true
                    example: null
                example:
                  id: clz1sc3z8039p8ruxx7mrob50
                  automaticallyAddToCart: true
                  mandatoryOp: false
                  rules:
                    - id: cm7b0iepj0007wbgxv6q91iaj
                      min: 0
                      max: 5000
                      terms:
                        paidBy: customer
                        customer:
                          amount: 10
                          type: fixed
                    - id: cm7b0ieoo0005wbgx3790q9ex
                      min: 5000
                      max: 6000
                      terms:
                        paidBy: brand
                        brand:
                          amount: 5
                          type: fixed
                  variants: null
        '400':
          description: >-
            The store_url parameter is invalid. The value must be a valid
            hostname without protocol or path (e.g., 'store.website.com' is
            valid, but 'https://store.website.com' is not).
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      The store_url parameter is invalid. The value must be a
                      valid hostname without protocol or path (e.g.,
                      'store.website.com' is valid, but
                      'https://store.website.com' is not).
                  error:
                    type: string
                    example: store_url must be a valid hostname
                  statusCode:
                    type: number
                    example: 400
        '404':
          description: Store not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Store not found
                  statusCode:
                    type: number
                    example: 404
components:
  schemas:
    AmountConfig:
      type: object
      properties:
        amount:
          type: number
          example: 10
        type:
          type: string
          description: >-
            The type of amount to be charged. When `fixed`, the amount will be a
            fixed value. When `percentage`, the amount will be a percentage of
            the subtotal
          enum:
            - fixed
            - percentage
          example: fixed

````