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

# Preview every line an order would bill

> Resolve one product for a company profile BEFORE creating anything: your own amount (override, matching price rule, or default - `applied_rule` says which), each option value's effective amount, and every pass-through government or state fee line at today's amounts. Use it to price your own offer with no surprises. The order itself resolves again and freezes what it billed on the order's `fees`. Formation keys also carry the state's filing fee.



## OpenAPI

````yaml /partner/openapi.yaml get /products/{productKey}/price-preview
openapi: 3.1.0
info:
  title: Clemta Partner API
  description: |
    The Clemta partner surface. Authenticate with your API key as a bearer
    token (`Authorization: Bearer clmt_live_` or `clmt_test_`). Keys with
    the `clmt_test_` prefix operate in sandbox mode (`livemode: false`): test
    data never reaches fulfillment or billing.

    Versioning is date-based: pass `Clemta-Version` to pin a
    version, omit it to run on your account's pinned default. The effective
    version is echoed back on every response.
  version: '2026-08-13'
servers:
  - url: https://api.clemta.com/v1
    description: >
      Single host for both modes: `clmt_test_` keys operate in sandbox mode,
      `clmt_live_` keys in live mode.
security:
  - apiKey: []
tags:
  - name: Identity
    description: Identify the calling API key.
  - name: Accounts
    description: >-
      Create and read customer accounts - the incorporators companies are
      created under.
  - name: Companies
    description: Create and read client companies.
  - name: Service orders
    description: Order services against a company and follow their fulfilment.
  - name: Products
    description: The catalog you can offer, at your wholesale prices.
  - name: Tax filings
    description: >-
      Federal and state tax filings on your companies, opened by your client
      against the company's entitlements and worked by Clemta. Read-only. Follow
      them with the tax_filing.* events.
  - name: Files
    description: >-
      Documents Clemta publishes on your companies - formation deliverables,
      filed forms, letters. Read-only. Client KYC uploads are write-only and
      never listed.
  - name: Requirements
    description: >-
      Everything needed from you or your client - identity documents,
      service-order forms, Clemta's asks - as one resolvable resource. Fulfill
      over the API or hand your client a hosted link.
  - name: Status tracking
    description: >-
      End-customer status links - keyless, read-only access to a company's live
      status.
  - name: Events
    description: Poll the partner event stream.
  - name: Webhooks
    description: >-
      Events we deliver to your endpoint, and how to verify them. Each webhook
      below is a request WE send to you. Respond 2xx to acknowledge. Deliveries
      are signed and retried with exponential backoff over multiple days until
      acknowledged. Answer `410 Gone` to have the endpoint disabled and
      deliveries stopped. A `Retry-After` header on a `429` or `503` pushes the
      next attempt back. An endpoint that fails continuously for days is
      disabled automatically and the workspace owner is emailed - no events are
      lost, the stream stays available on `GET /v1/events`.


      ## Verifying a delivery


      Deliveries are signed per the [Standard
      Webhooks](https://www.standardwebhooks.com) specification, carrying BOTH
      schemes in one header: a symmetric `v1` HMAC (verify with your endpoint
      secret and any standardwebhooks library) and an asymmetric `v1a` ed25519
      signature (verify with the endpoint's public key, no shared secret held).
      Use whichever suits your setup.


      Every endpoint has its OWN signing secret (`whsec_...`), shown once when
      you create the endpoint. Each delivery carries three headers:


      - `Clemta-Webhook-Id` - the event id. Stable across retries: use it as an
      idempotency key so a redelivered event is processed once.

      - `Clemta-Webhook-Timestamp` - unix seconds of THIS attempt (a retry
      carries a fresh one).

      - `Clemta-Webhook-Signature` - a space-delimited list of `v1,<base64>`
      signatures. More than one while a secret rotation's overlap window is
      open, one per active secret.


      Each is also sent under its bare Standard Webhooks name (`webhook-id`,
      `webhook-timestamp`, `webhook-signature`) with the same value, which is
      what off-the-shelf standardwebhooks libraries look up.


      To verify by hand:


      1. Build the signed content by joining the id, the timestamp, and the raw
      request body with literal `.` separators: `{id}.{timestamp}.{body}`. Use
      the body exactly as received - do not re-serialize the JSON.

      2. Base64-decode your endpoint secret after the `whsec_` prefix. That is
      the HMAC key.

      3. Compute HMAC-SHA256 over the signed content, base64 encode it, and
      compare it against each `v1,` entry in constant time. Accept if any
      matches, otherwise reject.

      4. Check the timestamp is within 5 minutes of now, to reject replays.


      Because the secret is unique to your endpoint, a signature can only be
      verified by you - a delivery meant for another endpoint cannot be made to
      verify here. Keep the secret confidential. If it leaks, roll the
      endpoint's secret from the Webhooks page of your partner dashboard.
  - name: Sandbox
    description: >-
      Test-key-only endpoints for rehearsing event flows. Trigger a lifecycle
      transition on a test company and receive the matching webhook, without
      waiting for a real formation to progress.
paths:
  /products/{productKey}/price-preview:
    get:
      tags:
        - Products
      summary: Preview every line an order would bill
      description: >-
        Resolve one product for a company profile BEFORE creating anything: your
        own amount (override, matching price rule, or default - `applied_rule`
        says which), each option value's effective amount, and every
        pass-through government or state fee line at today's amounts. Use it to
        price your own offer with no surprises. The order itself resolves again
        and freezes what it billed on the order's `fees`. Formation keys also
        carry the state's filing fee.
      operationId: previewProductPrice
      parameters:
        - name: productKey
          in: path
          required: true
          schema:
            type: string
          example: annual_state_filing
        - name: entity_type
          in: query
          required: true
          schema:
            type: string
            enum:
              - llc
              - c_corp
        - name: state
          in: query
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z]{2}$
          description: The company's formation state, as a 2-letter code.
          example: DE
        - name: pre_existing
          in: query
          required: false
          schema:
            type: boolean
          description: Preview for a pre-existing company you bring in. Defaults to false.
        - name: owners_count
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: How many owners the company has. Defaults to 1.
        - name: has_ein
          in: query
          required: false
          schema:
            type: boolean
          description: >-
            Whether the company already holds an EIN. A price rule may condition
            on it, so state it to preview the same amount the order resolves.
            Defaults to false (a fresh formation).
        - name: incorporated
          in: query
          required: false
          schema:
            type: boolean
          description: >-
            Whether the company is already incorporated (holds a formation
            date). A price rule may condition on it. Defaults to false.
      responses:
        '200':
          description: The resolved preview.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricePreview'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    PricePreview:
      type: object
      description: >-
        Every line an order for this product COULD put on your statement,
        resolved for the stated company profile. Amounts are today's - the order
        resolves them again and freezes what it billed on the order's own `fees`
        - so treat this as an estimate, never a quote.
      required:
        - object
        - product_key
        - unit_amount
        - currency
        - estimate
      properties:
        object:
          type: string
          enum:
            - price_preview
          description: Entity name.
        product_key:
          type: string
          example: annual_state_filing
        display_name:
          type: string
        unit_amount:
          type: integer
          format: int64
          description: >-
            Your price for this product and profile, in cents - your override or
            a matching price rule when one applies, otherwise the default.
        currency:
          type: string
          example: usd
        interval:
          type: string
          enum:
            - one_time
            - monthly
            - yearly
        overridden:
          type: boolean
          description: True when your negotiated sheet priced this product.
        applied_rule:
          type: string
          description: >-
            The price rule that decided `unit_amount` for this profile, when one
            matched - why this profile pays this amount.
        options:
          type: array
          items:
            $ref: '#/components/schemas/ProductOption'
          description: >-
            The product's variants with each value's own effective amount - a
            chosen value's amount replaces `unit_amount`.
        fees:
          type: array
          items:
            $ref: '#/components/schemas/PricePreviewFee'
          description: >-
            The pass-through government and state fee lines an order would bill
            beside the product, at today's amounts. A fee the state does not
            charge (or whose price is not configured yet) produces no line.
        estimate:
          type: boolean
          enum:
            - true
          description: >-
            Always true - amounts here are resolved now. The order's own
            resolution governs and is frozen on the order.
    ProductOption:
      type: object
      description: >-
        One variant axis of a product - a choice made at order time. Pass your
        choice as `options[<key>] = <value>` when creating a service order.
      required:
        - key
        - label
        - values
      properties:
        key:
          type: string
          pattern: ^[a-z][a-z0-9_]{1,48}$
          description: The option's identifier, the key you send in `options`.
          example: llc_members
        fixed:
          type: boolean
          description: >-
            A fixed option is chosen at order time and is never upgradable
            later. The options-upgrade endpoint refuses to change it.
        label:
          type: string
          description: Human-readable name of the choice.
          example: LLC membership
        required:
          type: boolean
          description: True when an order for this product must choose a value.
        values:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ProductOptionValue'
    PricePreviewFee:
      type: object
      description: One prospective pass-through line - a government or state fee.
      required:
        - kind
        - unit_amount
        - currency
      properties:
        kind:
          type: string
          description: The fee's stable kind, the same value the order's `fees` carry.
          example: state_fee
        unit_amount:
          type: integer
          format: int64
          description: Today's amount in cents.
        currency:
          type: string
          example: usd
    Error:
      type: object
      description: >-
        Error response: a stable machine-readable `code`, human-readable
        `title`/`detail`, and for validation failures an `errors` array naming
        every violating field.
      required:
        - type
        - title
        - status
        - code
      additionalProperties: false
      properties:
        type:
          type: string
          description: Link to the error reference entry for this code.
          example: https://docs.clemta.com/partner/errors#resource_already_exists
        title:
          type: string
          description: Short human summary of the error class.
        status:
          type: integer
          format: int32
          minimum: 100
          maximum: 599
          description: HTTP status code, also included in the body.
        code:
          type: string
          enum:
            - api_key_invalid
            - api_key_expired
            - insufficient_scope
            - ip_address_not_allowed
            - invalid_request
            - invalid_api_version
            - resource_missing
            - method_not_allowed
            - test_mode_only
            - resource_already_exists
            - idempotency_key_mismatch
            - idempotency_key_in_use
            - request_too_large
            - billing_account_inactive
            - entitlement_required
            - rate_limit
            - api_error
          description: Stable machine-readable code - branch on this, never on `detail`.
        detail:
          type: string
          description: Human-readable specifics of this occurrence, wording may change.
        request_id:
          type: string
          description: >-
            Identifier of this request. Quote it in a support request so we can
            trace the failure.
        errors:
          type: array
          description: 'Present on validation failures: one entry per violating field.'
          items:
            type: object
            required:
              - reason
            additionalProperties: false
            properties:
              reason:
                type: string
              location:
                type: string
                description: JSONPath of the failing field, e.g. `$.name`.
              validation_type:
                type: string
                description: Schema keyword that failed.
              how_to_fix:
                type: string
    ProductOptionValue:
      type: object
      description: One choice on a product option.
      required:
        - value
        - label
      properties:
        value:
          type: string
          pattern: ^[a-z][a-z0-9_]{1,48}$
          description: The value you send in `options`.
          example: multi_member
        label:
          type: string
          example: Multi-member LLC
        available_when:
          type: object
          additionalProperties: true
          description: >-
            When present, this value may only be chosen for companies matching
            the condition - for example an expedited filing offered in certain
            states only. Choosing it elsewhere is refused naming the option.
        unit_amount:
          type: integer
          format: int64
          minimum: 0
          description: >-
            The wholesale price of the product when this value is chosen, in the
            currency's smallest unit. Absent means the product's own price
            applies. If Clemta set you an override on the product, the override
            applies whatever you choose.
          example: 24900
  responses:
    BadRequest:
      description: Malformed request (e.g. unknown `Clemta-Version`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, invalid, revoked, or grace-expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist, or is not yours.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        Your API key, e.g. `Authorization: Bearer clmt_test_`. Live keys use the
        `clmt_live_` prefix.

````