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

# Create a quote

> Draft a quote for a customer. Prices are in major units here (49.5 is $49.50); the quote you get back is in minor units. With `send: true` it is marked sent in the same call, so `url` opens right away. Refusals include `customer_key_not_set`, `quote_product_not_found`, `invalid_discount`, `invalid_expiry`, `return_url_invalid` and `return_url_not_allowed`. A `customer` that matches nothing is `customer_not_found`; a workspace without payments set up is `payments_not_set_up`. **Requires scope:** `quotes:write`.



## OpenAPI

````yaml /openapi-v1.json post /v1/quotes
openapi: 3.1.0
info:
  title: Custral API
  version: v1
  description: >-
    The curated, versioned, API-key-authenticated public REST surface (`/v1`).
    Every endpoint here is what the official SDKs (`@custral/sdk`) and the MCP
    server are built on. Authenticate with a secret API key (`sk_…`) created in
    **Settings → Developers → Applications**.


    Every `/v1` response is sent with **HTTP 200**, success and failure alike. A
    success carries `data`; a failure carries `error` with a machine-readable
    `code` (see the `Error` schema), so branch on `error`, never on the status.
    `POST /v1/mcp` is the one exception: it answers auth failures with real 401
    / 403 / 429 statuses, as MCP clients expect.
  contact:
    name: Custral Support
    email: hello@custral.com
    url: https://custral.com
  license:
    name: Proprietary
    url: https://custral.com
servers:
  - url: https://api.custral.com
    description: Production
security:
  - ApiKey: []
tags:
  - name: Identity
    description: Introspect the calling API key.
  - name: Records
    description: Create, list, retrieve, and update records on any object.
  - name: Objects
    description: Read the object (table) schema of your workspace.
  - name: Conversations
    description: View, manage, and ingest conversations and their messages.
  - name: MCP
    description: Custral's MCP server, and the tool surface a key sees on it.
  - name: Documents
    description: Read record notes / page documents as markdown.
  - name: Connectors
    description: The MCP servers Stella can use tools from.
  - name: Property agents
    description: AI auto-fill agents on properties.
  - name: Usage modules
    description: Metered-product setups, their usage events, and per-record usage.
  - name: Applications & keys
    description: Developer applications and the API keys they hold.
  - name: Widget identity
    description: Vouch for who a chat widget visitor is.
  - name: Embeds & real-time
    description: Read the rows behind your own embed block, with an embed token.
  - name: Lists
    description: Read lists and change who is on them.
  - name: Customer journeys
    description: The workspace's customer journey, and where each customer is in it.
  - name: Quotes
    description: Quotes, contracts and contract templates.
  - name: Billing
    description: >-
      Customer billing, invoices, subscriptions, revenue metrics, the billing
      page, Stripe customer links, billing setup, products and plans.
paths:
  /v1/quotes:
    post:
      tags:
        - Quotes
      summary: Create a quote
      description: >-
        Draft a quote for a customer. Prices are in major units here (49.5 is
        $49.50); the quote you get back is in minor units. With `send: true` it
        is marked sent in the same call, so `url` opens right away. Refusals
        include `customer_key_not_set`, `quote_product_not_found`,
        `invalid_discount`, `invalid_expiry`, `return_url_invalid` and
        `return_url_not_allowed`. A `customer` that matches nothing is
        `customer_not_found`; a workspace without payments set up is
        `payments_not_set_up`. **Requires scope:** `quotes:write`.
      operationId: createQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQuoteBody'
      responses:
        '200':
          description: The quote.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Quote'
                  reqId:
                    $ref: '#/components/schemas/RequestId'
components:
  schemas:
    CreateQuoteBody:
      type: object
      properties:
        customer:
          type: string
          description: >-
            Your app's customer id (the customer key) or a record id. A deal's
            record id bills the customer it links to.
          example: acct_8812
        createCustomer:
          type: object
          description: Creates the customer when `customer` matches none.
          properties:
            name:
              type: string
              minLength: 1
            email:
              type: string
              format: email
          required:
            - name
        products:
          type: array
          items:
            type: object
            properties:
              product:
                type: string
                description: A catalog product's record id, or its exact name.
                example: Pro seats
              quantity:
                type: integer
                minimum: 1
                maximum: 1000000
                default: 1
              unitPrice:
                type: number
                description: >-
                  A custom price per unit in major units (49.5 is $49.50). The
                  catalog price when absent.
                minimum: 0
            required:
              - product
          minItems: 1
          maxItems: 100
        discount:
          type: object
          properties:
            type:
              type: string
              enum:
                - percent
                - amount
            value:
              type: number
              description: A percent (20 for 20%) or an amount in major units.
              exclusiveMinimum: 0
            duration:
              type: string
              enum:
                - once
                - repeating
                - forever
              default: once
            months:
              type: integer
              description: Required for `repeating`.
              minimum: 1
              maximum: 120
          required:
            - type
            - value
        collectionMethod:
          type: string
          enum:
            - autopay
            - invoice
          description: '`autopay` charges a saved card or bank; `invoice` sends a pay link.'
        contactName:
          type: string
          maxLength: 200
        contactEmail:
          type: string
          format: email
          maxLength: 320
        billingEvery:
          type: integer
          description: >-
            Bill the recurring products every N months (or years, for a yearly
            price): 3 is quarterly. Each bill charges N periods' price.
          minimum: 1
          maximum: 12
        billingAnchorDay:
          type: integer
          description: >-
            The day of the month bills land on, 1–31; the first bill is
            prorated. 0 bills from the day the customer accepts.
          minimum: 0
          maximum: 31
        requireSignature:
          type: boolean
          description: >-
            Ask the customer to sign a contract on the quote page before
            accepting.
        contractTemplate:
          type: string
          description: >-
            The contract to sign: a template's id or exact name, from `GET
            /v1/contract-templates`. Empty or `default` is the workspace's
            default. A name that matches none is `contract_template_not_found`;
            one that matches two is `contract_template_ambiguous`.
          maxLength: 200
        expiresAt:
          type: string
          description: The last day the quote can be accepted, `YYYY-MM-DD`.
          pattern: ^\d{4}-\d{2}-\d{2}$
        returnUrl:
          type: string
          description: >-
            Where the customer lands after accepting. Its host must be in
            Settings → Quotes and invoicing → allowed return domains.
          format: uri
        send:
          type: boolean
          description: Also mark it sent, so the returned `url` opens right away.
      required:
        - customer
        - products
    Quote:
      type: object
      description: A quote. Amounts are in minor units (cents).
      properties:
        id:
          type: string
        number:
          type: string
          description: The label a person reads.
          example: Q-0007
        status:
          type: string
          enum:
            - draft
            - sent
            - viewed
            - accepted
            - declined
            - expired
            - void
        customer:
          type: object
          properties:
            recordId:
              type: string
            name:
              type:
                - string
                - 'null'
              example: Hooli
        contactName:
          type:
            - string
            - 'null'
        contactEmail:
          type:
            - string
            - 'null'
        currency:
          type: string
          example: usd
        collectionMethod:
          type: string
          enum:
            - autopay
            - invoice
        paymentTermsDays:
          type: integer
        trialDays:
          type: integer
        billingEvery:
          type: integer
          description: >-
            Recurring lines bill every N intervals (3 with monthly lines is
            quarterly).
        billingAnchorDay:
          type:
            - integer
            - 'null'
          description: >-
            Day of the month recurring lines bill on; null bills from
            acceptance.
        requireSignature:
          type: boolean
        contractTemplateId:
          type:
            - string
            - 'null'
          description: Null means the workspace's default contract.
        startDate:
          type:
            - string
            - 'null'
        expiresAt:
          type:
            - string
            - 'null'
        sentAt:
          type:
            - string
            - 'null'
          format: date-time
        acceptedAt:
          type:
            - string
            - 'null'
          format: date-time
        acceptedName:
          type:
            - string
            - 'null'
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
        url:
          type: string
          description: >-
            The hosted page the customer accepts on. Opens once the quote is
            sent.
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/QuoteLineItem'
        discount:
          oneOf:
            - $ref: '#/components/schemas/QuoteDiscount'
            - type: 'null'
        paymentSchedule:
          type: array
          items:
            $ref: '#/components/schemas/QuoteInstalment'
        billingError:
          type:
            - string
            - 'null'
          description: Why billing failed to start after acceptance; null otherwise.
        totals:
          type: object
          properties:
            recurring:
              type: array
              items:
                type: object
                properties:
                  interval:
                    type: string
                  listAmount:
                    type: integer
                    description: Per period before discounts, in minor units.
                  phases:
                    type: array
                    items:
                      type: object
                      properties:
                        fromPeriod:
                          type: integer
                        toPeriod:
                          type:
                            - integer
                            - 'null'
                        amount:
                          type: integer
                    description: What each run of periods bills.
            oneTimeListTotal:
              type: integer
            oneTimeTotal:
              type: integer
      required:
        - id
        - number
        - status
        - customer
        - url
    RequestId:
      type: string
      description: >-
        A per-request id (`req_…`). Quote it to support when reporting a
        problem.
      example: req_2a1f9c8e7b6d5
    QuoteLineItem:
      type: object
      properties:
        productRecordId:
          type: string
        name:
          type: string
          example: Pro seats
        description:
          type: string
        quantity:
          type: integer
        unitAmount:
          type: integer
          description: Per unit, in minor units (cents).
        interval:
          type: string
          enum:
            - one_time
            - month
            - year
        usageEvent:
          type: string
          description: Set on a metered line, which bills per unit through usage.
    QuoteDiscount:
      type: object
      description: A discount. On a quote read, an `amount` is in minor units.
      properties:
        type:
          type: string
          enum:
            - percent
            - amount
        value:
          type: number
          description: A percent (20 for 20%, at most 100) or an amount.
        duration:
          type: string
          enum:
            - once
            - repeating
            - forever
        months:
          type: integer
          description: For `repeating` only.
          minimum: 1
          maximum: 120
    QuoteInstalment:
      type: object
      properties:
        label:
          type: string
        due:
          type: string
          description: '`on_acceptance` or a `YYYY-MM-DD` date.'
        type:
          type: string
          enum:
            - percent
            - amount
        value:
          type: number
        billedAt:
          type: string
          description: Set once the instalment has been invoiced.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: sk_...
      description: >-
        A Custral API key, created in Settings → Developers → Applications, sent
        as `Authorization: Bearer sk_…`. The `X-Api-Key` header is also accepted
        and takes precedence. Use a **secret** key (`sk_…`) from your server; a
        publishable key (`pk_…`) may hold only `objects:read` and `usage:write`.
        Never expose a secret key in a browser.

````

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