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

# Set Quote Intended Layer

> **Quote door.** Saves the layer of the
[pricing stack](/api-reference/invoicing/quote-invoicing#intended-layer)
the quote is meant to bind at, or clears the choice with `null`. Only
the intended layer is written: the quote's fields, its invoice settings
and plan, and its rating stay as they are. Choosing a layer changes
nothing else on the quote; you make its pricing, billing and invoices
match it.

The body is `intendedLayer`. It may also carry `quoteId`, so a
[Get Quote Intended Layer](/api-reference/policy-invoicing/get-quote-intended-layer)
response can be sent back as it is; that `quoteId` must be the path's.

Binds do not check the intended layer yet:
[Bind Quote](/api-reference/field-model-policy-transactions/bind-quote),
[Check Bind Conditions](/api-reference/field-model-policy-validation/check-bind-conditions)
and Complete behave the same whatever it says.

**Refusals.** An `intendedLayer` that is missing or is not one of the
four layers, an unknown field, or a `quoteId` other than the path's
returns `400`. With policy invoicing disabled, this returns
`403 finv2-policy-invoicing-disabled`. A bound or cancelled quote returns
`409`: its intended layer can no longer change. Nothing is saved on a
refusal. Every quote type takes one: new business, renewal, endorsement,
cancellation and reinstatement.

**Required permission:** `quote.edit`




## OpenAPI

````yaml /openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/quotes/{quoteId}/intended-layer
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://go.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/companies/{companyId}/quotes/{quoteId}/intended-layer:
    put:
      tags:
        - Policy Invoicing
      summary: Set Quote Intended Layer
      description: >
        **Quote door.** Saves the layer of the

        [pricing stack](/api-reference/invoicing/quote-invoicing#intended-layer)

        the quote is meant to bind at, or clears the choice with `null`. Only

        the intended layer is written: the quote's fields, its invoice settings

        and plan, and its rating stay as they are. Choosing a layer changes

        nothing else on the quote; you make its pricing, billing and invoices

        match it.


        The body is `intendedLayer`. It may also carry `quoteId`, so a

        [Get Quote Intended
        Layer](/api-reference/policy-invoicing/get-quote-intended-layer)

        response can be sent back as it is; that `quoteId` must be the path's.


        Binds do not check the intended layer yet:

        [Bind Quote](/api-reference/field-model-policy-transactions/bind-quote),

        [Check Bind
        Conditions](/api-reference/field-model-policy-validation/check-bind-conditions)

        and Complete behave the same whatever it says.


        **Refusals.** An `intendedLayer` that is missing or is not one of the

        four layers, an unknown field, or a `quoteId` other than the path's

        returns `400`. With policy invoicing disabled, this returns

        `403 finv2-policy-invoicing-disabled`. A bound or cancelled quote
        returns

        `409`: its intended layer can no longer change. Nothing is saved on a

        refusal. Every quote type takes one: new business, renewal, endorsement,

        cancellation and reinstatement.


        **Required permission:** `quote.edit`
      operationId: putQuoteIntendedLayer
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/quoteIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteIntendedLayerRequest'
            examples:
              invoicingLayer:
                summary: Meant to bind with pricing, billing and invoices
                value:
                  intendedLayer: invoicing
              pricingLayer:
                summary: Meant to bind with pricing only
                value:
                  intendedLayer: pricing
              sentBack:
                summary: >-
                  A Get Quote Intended Layer response, sent back with a new
                  layer
                value:
                  quoteId: 550e8400-e29b-41d4-a716-446655440002
                  intendedLayer: billing
              clear:
                summary: Clear the choice
                value:
                  intendedLayer: null
      responses:
        '200':
          description: The quote's intended layer as saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteIntendedLayer'
              examples:
                saved:
                  summary: The invoicing layer is saved
                  value:
                    quoteId: 550e8400-e29b-41d4-a716-446655440002
                    intendedLayer: invoicing
                cleared:
                  summary: The choice is cleared
                  value:
                    quoteId: 550e8400-e29b-41d4-a716-446655440002
                    intendedLayer: null
        '400':
          description: >-
            The quote id is not a uuid, or the body breaks a rule:
            `intendedLayer` is missing or is not one of the four layers, a field
            is unknown, or `quoteId` is not the quote the path names. Nothing is
            saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unknownLayer:
                  summary: A layer that does not exist
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        intendedLayer: Invalid option: expected one of
                        "base"|"pricing"|"billing"|"invoicing"
                      userMessages:
                        - >-
                          Invalid option: expected one of
                          "base"|"pricing"|"billing"|"invoicing"
                      details:
                        - field: intendedLayer
                          message: >-
                            Invalid option: expected one of
                            "base"|"pricing"|"billing"|"invoicing"
                quoteIdMismatch:
                  summary: A quoteId other than the path's
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        quoteId: quoteId 550e8400-e29b-41d4-a716-446655440003 is
                        not the quote the path names
                        (550e8400-e29b-41d4-a716-446655440002). Send the path's
                        quote id, or leave quoteId out.
                      userMessages:
                        - >-
                          quoteId 550e8400-e29b-41d4-a716-446655440003 is not
                          the quote the path names
                          (550e8400-e29b-41d4-a716-446655440002). Send the
                          path's quote id, or leave quoteId out.
                      details:
                        - field: quoteId
                          message: >-
                            quoteId 550e8400-e29b-41d4-a716-446655440003 is not
                            the quote the path names
                            (550e8400-e29b-41d4-a716-446655440002). Send the
                            path's quote id, or leave quoteId out.
                unknownField:
                  summary: A field the body does not take
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: 'Unrecognized key: "layer"'
                      userMessages:
                        - 'Unrecognized key: "layer"'
                      details:
                        - message: 'Unrecognized key: "layer"'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenQuoteInvoicing'
        '404':
          description: No quote with the given id exists for this company.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quoteNotFound:
                  summary: Quote not found
                  value:
                    error:
                      code: NotFoundError
                      message: Quote not found
                      userMessages:
                        - Quote not found
        '409':
          description: >-
            The quote's intended layer can no longer change. A `bound` quote
            returns `QuoteBoundImmutable` with `referencingPolicy`, the policy
            it is bound to; change that policy's pricing or billing with an
            endorsement, and its invoices with [Update Policy
            Invoices](/api-reference/financials/update-policy-invoices). A
            `cancelled` quote returns `QuoteNotEditable`. The message names the
            fix with your request's ids. Nothing is saved.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        enum:
                          - QuoteBoundImmutable
                          - QuoteNotEditable
                        description: Machine-readable error code
                      message:
                        type: string
                        description: Human-readable error message, naming why and the fix
                      userMessages:
                        type: array
                        items:
                          type: string
                      referencingPolicy:
                        type: string
                        format: uuid
                        nullable: true
                        description: >-
                          `QuoteBoundImmutable` only: the policy the quote is
                          bound to.
              examples:
                quoteBound:
                  summary: The quote is bound
                  value:
                    error:
                      code: QuoteBoundImmutable
                      message: >-
                        Quote 550e8400-e29b-41d4-a716-446655440002 is bound to
                        policy 550e8400-e29b-41d4-a716-446655440020, so its
                        intended layer can no longer change. To change the
                        policy's pricing or billing, endorse it with POST
                        /api/v1/companies/550e8400-e29b-41d4-a716-446655440001/policies/550e8400-e29b-41d4-a716-446655440020/transaction/endorse;
                        to change its invoices, use POST
                        /api/v1/companies/550e8400-e29b-41d4-a716-446655440001/financials/policies/550e8400-e29b-41d4-a716-446655440020/invoices/batch.
                      userMessages:
                        - >-
                          Quote 550e8400-e29b-41d4-a716-446655440002 is bound to
                          policy 550e8400-e29b-41d4-a716-446655440020, so its
                          intended layer can no longer change. To change the
                          policy's pricing or billing, endorse it with POST
                          /api/v1/companies/550e8400-e29b-41d4-a716-446655440001/policies/550e8400-e29b-41d4-a716-446655440020/transaction/endorse;
                          to change its invoices, use POST
                          /api/v1/companies/550e8400-e29b-41d4-a716-446655440001/financials/policies/550e8400-e29b-41d4-a716-446655440020/invoices/batch.
                      referencingPolicy: 550e8400-e29b-41d4-a716-446655440020
                quoteCancelled:
                  summary: The quote is cancelled
                  value:
                    error:
                      code: QuoteNotEditable
                      message: >-
                        Quote 550e8400-e29b-41d4-a716-446655440002 is cancelled,
                        so its intended layer can no longer change. A cancelled
                        quote is closed: to bind a variation, create a new quote
                        with POST
                        /api/v1/companies/550e8400-e29b-41d4-a716-446655440001/entities/quote.
                      userMessages:
                        - >-
                          Quote 550e8400-e29b-41d4-a716-446655440002 is
                          cancelled, so its intended layer can no longer change.
                          A cancelled quote is closed: to bind a variation,
                          create a new quote with POST
                          /api/v1/companies/550e8400-e29b-41d4-a716-446655440001/entities/quote.
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    quoteIdPath:
      name: quoteId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Quote identifier
  schemas:
    QuoteIntendedLayerRequest:
      type: object
      additionalProperties: false
      description: >-
        The body of Set Quote Intended Layer: the layer to save, or `null` to
        clear the choice. A Get Quote Intended Layer response can be sent back
        as it is.
      required:
        - intendedLayer
      properties:
        quoteId:
          type: string
          format: uuid
          description: >-
            Optional. When you send it, it must be the quote the path names;
            another id returns `400`.
        intendedLayer:
          description: The layer to save, or `null` to clear the choice.
          anyOf:
            - $ref: '#/components/schemas/PricingStackLayer'
            - type: string
              nullable: true
              enum:
                - null
    QuoteIntendedLayer:
      type: object
      additionalProperties: false
      description: >-
        A quote's intended layer: the layer of the pricing stack the quote is
        meant to bind at, or `null` while none is chosen. Get Quote Intended
        Layer and Set Quote Intended Layer both return this.
      required:
        - quoteId
        - intendedLayer
      properties:
        quoteId:
          type: string
          format: uuid
        intendedLayer:
          description: >-
            The layer the quote is meant to bind at, or `null` while none is
            chosen.
          anyOf:
            - $ref: '#/components/schemas/PricingStackLayer'
            - type: string
              nullable: true
              enum:
                - null
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            userMessages:
              type: array
              description: >-
                Clean, verbatim-displayable messages — one entry per failure,
                free of error-code tags, field paths, and internal noise.
                Suitable for showing to end users as-is.
              items:
                type: string
              example:
                - Exposures of type 'company' require an address
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  code:
                    type: string
                    description: Stable problem code for this individual validation failure
                    example: BLANK_LIST_ELEMENT
                  reason:
                    type: string
                    description: Stable reason the value violates its canonical contract
                    example: blank-list-element
                  expected:
                    type: string
                    description: The expected canonical value contract
                    example: nonblank trimmed string
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
    PricingStackLayer:
      type: string
      enum:
        - base
        - pricing
        - billing
        - invoicing
      description: >-
        A layer of the pricing stack, bottom-up. A layer is read from three
        things: the pricing (`fullTermPricingInfo`), the billing
        (`fullTermBillingInfo`) and the active policy invoices. `base` has no
        pricing, billing or invoices. `pricing` has pricing only. `billing` has
        pricing and billing, and no active invoices; a `fullTermBillingInfo`
        with no lines counts as billing. `invoicing` has pricing, billing and
        active invoices that add up to the billing. Billing that owes nothing
        needs no invoices, so a zero bill with no invoices sits at both
        `billing` and `invoicing`.
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: AuthenticationError
                  message: API key authentication required
                  userMessages:
                    - API key authentication required
            invalidApiKey:
              summary: >-
                Invalid API key (e.g. unknown key, or a Bearer token used
                instead of an API key)
              value:
                error:
                  code: AuthenticationError
                  message: Invalid API key
                  userMessages:
                    - Invalid API key
    ForbiddenQuoteInvoicing:
      description: >
        Forbidden. The API key lacks the endpoint's permission, or the company
        does

        not invoice (`finv2-policy-invoicing-disabled`): its policy invoicing is
        not

        turned on, or it is on while its Quote billing calculation is still

        `NO_BILLING()`. Support turns invoicing on; replacing `NO_BILLING()` is
        a

        configuration change ([Quote billing
        calculations](/api-reference/configuration/overview#quote-billing-calculations)).

        Nothing is saved.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invoicingDisabled:
              summary: Policy invoicing is disabled
              value:
                error:
                  code: finv2-policy-invoicing-disabled
                  message: >-
                    Policy invoicing is not turned on for your company yet, so
                    policy invoices cannot be created or changed. Contact
                    support to enable it.
                  userMessages:
                    - >-
                      Policy invoicing is not turned on for your company yet, so
                      policy invoices cannot be created or changed. Contact
                      support to enable it.
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: AuthorizationError
                  message: User is not authorized to perform the requested action
                  userMessages:
                    - User is not authorized to perform the requested action
            companyMismatch:
              summary: A valid API key naming another company in the URL
              value:
                error:
                  code: AuthorizationError
                  message: API key is not scoped to the requested company
                  userMessages:
                    - API key is not scoped to the requested company
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: UncaughtActionError
                  message: Uncaught error occurred in <actionName>
                  userMessages:
                    - An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Send your raw API key as the `Authorization`
        header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do
        NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key`
        header; those are not accepted.

````

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