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

# Check Bind Conditions

> Runs the quote → policy conversion server-side and reports every unmet
**bind rule** for a quote, before an underwriter commits the bind. This is a
read-only diagnostic endpoint — no policy is created, the quote is not
linked, and nothing is persisted.

The check produces the exact policy payload the bind would produce for this
company, then evaluates the Policy entity invariants (the configured bind
rules, framework and tenant) plus the structural policy-payload validation
over it, and returns each failing condition's message — the same message the
bind's rejection would carry.

**Which quotes can be checked.** `newBusiness` and `renewal` check full
policy conversion. `endorsement` checks billing readiness and invoice
conservation and returns `checkScope: endorsement-billing`; its other
transaction checks remain at bind. Cancellation and reinstatement
return `400 BindCheckUnsupportedQuoteType`. A quote already in a terminal
state (`bound` or `cancelled`) returns `409 BindCheckQuoteNotBindable` — it
cannot be bound, so there are no bind conditions to check.

**Every rule is checked.** A bind rule whose condition cannot be evaluated
ahead of the bind (it reads the wall clock or mints a value) is reported as
a failure whose message names the rule, as the bind would refuse it. A
green check (`readyToBind: true`) is never partial.

**Rating and billing.** Rating freshness appears in `advisories`, separately
from `failures`, and never makes `readyToBind` false. Persisted quote Bind and
Complete Quote do not require fresh rating or an override. When policy
invoicing is enabled, valid freshness declarations, billing current for the
retained rating, and invoices matching every target line remain required.
Matching posted invoices need no new plan. With invoicing disabled,
unavailable billing adds no invoice-readiness gate. Ordinary policy rules
and financial integrity still apply in both modes.

**Required permission:** `quote.view`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/quotes/{quoteId}/bind-conditions
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}/bind-conditions:
    get:
      tags:
        - Field Model Policy Validation
      summary: Check Bind Conditions
      description: >
        Runs the quote → policy conversion server-side and reports every unmet

        **bind rule** for a quote, before an underwriter commits the bind. This
        is a

        read-only diagnostic endpoint — no policy is created, the quote is not

        linked, and nothing is persisted.


        The check produces the exact policy payload the bind would produce for
        this

        company, then evaluates the Policy entity invariants (the configured
        bind

        rules, framework and tenant) plus the structural policy-payload
        validation

        over it, and returns each failing condition's message — the same message
        the

        bind's rejection would carry.


        **Which quotes can be checked.** `newBusiness` and `renewal` check full

        policy conversion. `endorsement` checks billing readiness and invoice

        conservation and returns `checkScope: endorsement-billing`; its other

        transaction checks remain at bind. Cancellation and reinstatement

        return `400 BindCheckUnsupportedQuoteType`. A quote already in a
        terminal

        state (`bound` or `cancelled`) returns `409 BindCheckQuoteNotBindable` —
        it

        cannot be bound, so there are no bind conditions to check.


        **Every rule is checked.** A bind rule whose condition cannot be
        evaluated

        ahead of the bind (it reads the wall clock or mints a value) is reported
        as

        a failure whose message names the rule, as the bind would refuse it. A

        green check (`readyToBind: true`) is never partial.


        **Rating and billing.** Rating freshness appears in `advisories`,
        separately

        from `failures`, and never makes `readyToBind` false. Persisted quote
        Bind and

        Complete Quote do not require fresh rating or an override. When policy

        invoicing is enabled, valid freshness declarations, billing current for
        the

        retained rating, and invoices matching every target line remain
        required.

        Matching posted invoices need no new plan. With invoicing disabled,

        unavailable billing adds no invoice-readiness gate. Ordinary policy
        rules

        and financial integrity still apply in both modes.


        **Required permission:** `quote.view`
      operationId: checkBindConditions
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/quoteIdPath'
      responses:
        '200':
          description: The bind-condition check result for the quote.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - readyToBind
                  - failures
                properties:
                  readyToBind:
                    type: boolean
                    description: True only when `failures` is empty.
                  failures:
                    type: array
                    description: |
                      Every unmet bind condition, one entry per message. A rule
                      the check could not evaluate appears here too, with a
                      message naming it.
                    items:
                      type: object
                      additionalProperties: false
                      required:
                        - message
                        - source
                      properties:
                        message:
                          type: string
                          description: >
                            The failing condition's message, verbatim as the
                            bind's

                            rejection would carry it.
                        source:
                          type: string
                          enum:
                            - invariant
                            - payload
                          description: >
                            `invariant` — a configured Policy bind rule
                            (framework or

                            tenant); `payload` — a structural policy-payload

                            requirement.
                  advisories:
                    type: array
                    description: >-
                      Non-blocking rating freshness information; never changes
                      readyToBind.
                    items:
                      type: object
                      additionalProperties: false
                      required:
                        - source
                        - message
                      properties:
                        source:
                          type: string
                          enum:
                            - rating
                        message:
                          type: string
                  checkScope:
                    type: string
                    enum:
                      - endorsement-billing
                    description: >-
                      Present for endorsements, whose check covers billing
                      rather than full-policy conversion.
              examples:
                readyToBind:
                  summary: The quote is ready to bind
                  value:
                    readyToBind: true
                    failures: []
                withFailures:
                  summary: The quote has unmet bind conditions
                  value:
                    readyToBind: false
                    failures:
                      - message: Policy Start Date is required.
                        source: invariant
                      - message: At least one exposure is required.
                        source: invariant
                ratingAdvisory:
                  summary: Current billing with a retained rating advisory
                  value:
                    readyToBind: true
                    failures: []
                    advisories:
                      - source: rating
                        message: >-
                          Rating inputs have changed since this rating was
                          generated.
                endorsementBilling:
                  summary: >-
                    Endorsement billing is ready; other transaction checks run
                    at bind
                  value:
                    readyToBind: true
                    failures: []
                    advisories: []
                    checkScope: endorsement-billing
                uncheckableRule:
                  summary: A rule the check cannot evaluate ahead of the bind
                  value:
                    readyToBind: false
                    failures:
                      - message: >-
                          The entity invariant "Binding is closed on weekends."
                          could not be checked.
                        source: invariant
        '400':
          description: >
            The quote type is not supported for the check (supported types are

            `newBusiness`, `renewal`, and `endorsement`), or the request
            parameters are

            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unsupportedType:
                  summary: Quote type is out of scope
                  value:
                    error:
                      code: BindCheckUnsupportedQuoteType
                      message: >-
                        Check Bind Conditions is not supported for quote type
                        'cancellation'. Supported types are newBusiness,
                        renewal, and endorsement.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: No quote with the given id exists for this company.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >
            The quote is in a terminal state (`bound` or `cancelled`) and cannot
            be

            bound, so there are no bind conditions to check.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notBindable:
                  summary: Quote is already bound
                  value:
                    error:
                      code: BindCheckQuoteNotBindable
                      message: >-
                        Quote 550e8400-e29b-41d4-a716-446655440002 is 'bound'
                        and cannot be bound, so there are no bind conditions to
                        check.
        '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:
    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
  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
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            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.

````