---
title: "Generate a Quote"
method: POST
path: "/api/v1/quote/generate"
tags: ["Headless Quoting"]
---

# Generate a Quote

`POST /api/v1/quote/generate`

Creates an official quote record in DealHub, links it to a CRM opportunity, and initiates any required approval workflows based on your active CPQ version.

This is an asynchronous endpoint. When you send a request, the API provides an immediate response to confirm that the quote generation process has started. The full processing, including data synchronization with your CRM, happens in the background.

## Request body

- GenerateQuoteRequest
  - `external_opportunity_id` string, required — CRM opportunity ID.
  - `request_action` 'draft' | 'submit' | 'publish' | 'sign_externally', required — Specifies the action (draft, submit, publish, or sign).
  - `line_item_details` 'basic' | 'all' — Determines the level of detail included in the response for line items.
  - `playbook` string — The unique name of the playbook (not the display name). If not provided, the system uses the first API-type playbook.
  - `quote_name` string — Quote or proposal name.
  - `dealroom_publish_name` string — DealRoom publish name.
  - `total_sales_discount` number — Total discount for all line items. Overrides default line-item discounts if provided.
  - `expiration_date` integer — Quote expiration date as a Unix timestamp (milliseconds, GMT).
  - `document_type` 'DealRoom' | 'PDF' | 'WORD' | 'EXCEL', required — Specifies document type (e.g., DealRoom, PDF, WORD).
  - `partner_program` PartnerProgram[] — List of selected partner programs.
    - `partner_level_name` string
    - `program_name` string
  - `timezone_offset` number — Timezone offset from GMT in hours.
  - `sign_externally_comment` string — Includes the necessary comments for external signing. It is required if `request_action` is `sign_externally`.
  - `quote_data` QuoteData[], required — List of question group data, including questions and answers.
    - `group_id` string, required — DealHub group ID.
    - `questions` object[], required — List of questions data including question ID and answer/s. The following answer types are supported: * **Text List:** Contains one or more case-sensitive values, restricted to predefined options. Supports single or multi-select (delimiter: `;`). * **Text Answer:** Captures the value exactly as provided in the request payload. * **Radio Button:** Single case-sensitive value from predefined radio button selections. * **Manual Item:** Valid SKU existing in the system. * **Numeric List:** One or more numeric values from the answer predefined list (delimiter: `;`). * **Numeric Answer/Range:** Single numeric value within a predefined range. * **Date:** Date in `yyyy-mm-dd` format.
  - `line_items` LineItem[] — A list of line items and their associated data. The system only validates that the SKU for each item exists. All other provided details are accepted as-is, and any existing data for these line items will be overwritten.
    - `sku` string, required — Unique product catalog identifier. It must exist in the DealHub product catalog.
    - `item_name` string — Catalog product name.
    - `bundle_ref_sku` string — The SKU of the bundle product to which this line item belongs. The value is required if the line item is a component of a bundle. The bundle SKU must exist in the DealHub catalog. This field should be empty for the bundle product itself.
    - `bundle_ref_id` integer — The unique identifier for a bundle instance. This is required for all line items within a bundle and for the bundle's line item itself. It is used to differentiate between multiple instances of the same bundle in a single import.
    - `list_price` number — List price of the line item.
    - `net_price_per_unit` number — Net price per unit of the line item.
    - `net_price` number — Total net price (net per unit x product factors).
    - `msrp` number — line item MSRP (Manufacturer Suggested Retail Price).
    - `msrp_discount` number — Discount applied to the MSRP.
    - `sales_discount` number — Line item sales discount.
    - `total_discount` number — Line item total discount.
    - `partner_program_data` object[]
      - `partner_program_name` string — Partner program name.
      - `partner_level_item_price` number — Item price after partner program level discount.
      - `partner_level_item_discount` number — Discount applied to the partner program level.
    - `product_factors` object — List of product-specific factors (e.g., quantity, duration).
    - `attributes` object — List of line-item-specific proposal attributes.
  - `opportunity_data` OpportunityData — Opportunity context required when the DealHub tenant uses the CRM API integration type.
    - `external_opportunity_name` string, required — The name of the CRM opportunity.
    - `opportunity_owner` OpportunityOwner, required — Information about the opportunity owner.
      - `external_user_id` string, required — The CRM user ID. Represents an employee of the organization integrating with DealHub.
      - `login` string — The user's login identifier. If not provided, the system uses the email as the login. The login must be unique across all DealHub tenants.
      - `email` string, required — The primary email address of the user.
      - `name` string, required — The user's full name.
      - `position` string — The user's role or job title within the organization.
      - `phone` string — The user's phone number.
      - `mobile` string — The user's mobile phone number.
      - `fax` string — The user's fax number.
      - `company` string — The name of the user's company.
      - `street` string — The street address of the user.
      - `city` string — The city where the user is located.
      - `state` string — The state where the user is located.
      - `country` string — The user's country.
      - `postal_code` string — The postal code of the user's location.
      - `user_manager_login` string — The login ID of the user's manager.
    - `external_customer_id` string, required — CRM customer ID (buyer account).
    - `customer_name` string, required — CRM customer name.
    - `geo_code` string, required — Geographic code.
    - `currency` string, required — Currency ISO code used for evaluating rules. This value is immutable once the opportunity or quote is created.
    - `customer_shipping_address` CustomerAddress — Address details for a customer.
      - `street` string — The street address.
      - `city` string — The city.
      - `state` string — The state.
      - `country` string — The country.
      - `postal_code` string — The postal code.
    - `customer_billing_address` CustomerAddress — Address details for a customer.
      - `street` string — The street address.
      - `city` string — The city.
      - `state` string — The state.
      - `country` string — The country.
      - `postal_code` string — The postal code.
    - `customer_contacts` CustomerContact[] — List of customer contact details.
      - `salutation` string — Salutation for the contact (e.g., Mr., Ms.).
      - `first_name` string, required — First name of the contact.
      - `last_name` string, required — Last name of the contact.
      - `title` string — Job title of the contact.
      - `email` string, required — Primary email address of the contact.
      - `phone` string — Phone number of the contact.
      - `account_name` string — Name of the contact's company.
      - `mailing_address` string — Postal address of the contact.
      - `primary_contact` boolean — Whether this is the primary contact.

## Response `202`

Accepted. The quote generation process has been initiated.

- QuoteResponse
  - `status` string
  - `dealhub_proposal_id` string
  - `dealhub_quote_id` string
  - `dealroom_url` string, uri
  - `approval_flows` boolean
  - `summary` ResponseSummary
    - `currency` string
    - `total_list_price` number
    - `total_net_price` number
    - `total_discount` number
    - `total_sales_discount` number
  - `line_items` ResponseLineItem[]
    - `id` string
    - `sku` string
    - `bundle_ref` string
    - `name` string
    - `list_price` number
    - `net_price` number
    - `product_factors` object
    - `total_discount` number
    - `additional_data` ResponseAdditionalData
      - `primary_tag` string
      - `msrp` number
      - `msrp_discount` number
      - `user_price` number
      - `net_per_unit` number
      - `partner_discounts` object[]
        - `name` string
        - `discount` number
        - `price` number
      - `sales_discount` number
      - `attributes` object

## Other responses

- `400` — Bad Request.

---

[API](https://skmtc.net/dealhub/apis/quote-api.md) · [All operations](https://skmtc.net/dealhub/apis/quote-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dealhub/quote-api/versions/c30f5b9fbfab/schema)
