Create Quote

Creates a new sales quote and automatically submits it to the assigned buyer. While the B2B Edition control panel allows you to save a new quote as a draft without sending it to the buyer, quotes created with this endpoint are automatically visible in a Company user's Buyer Portal. However, you can give the `allowCheckout` a value of `false` to prevent the buyer from purchasing it immediately upon submission. ### Custom Products While you can create custom products from within a quote while creating or editing it in your B2B Edition control panel, you cannot create a custom product with this endpoint. Create a custom product while [creating or editing](https://support.bigcommerce.com/s/article/B2B-Edition-Quotes) a quote in the B2B Edition control panel, or by using the [Create a Product](/developer/api-reference/rest/admin/catalog/products#create-a-product) endpoint in the Catalog API. Obtain your newly-created product’s ID and add it to the `productId` field of the Create a Quote request body to include it in the quote. ### Minimum Required Fields In order to create a sales quote, the request body must include the following fields. Fields marked with an asterisk are only required under specific conditions. * `grandTotal` * `discount` * `subtotal` * `userEmail` * `expiredAt` * `contactInfo` * `name` * `email` * `companyId`* * `productList` * `sku` * `productId` * `basePrice` * `discount` * `offeredPrice` * `quantity` * `extraFields`* * `fieldName`* * `fieldValue`* * `channelId`* The `companyId` field is only required if you are linking a quote to a Company’s Buyer Portal. The `companyName` field and `email` fields will not link a quote to a particular Company or Company user without a corresponding `companyId`. The `extraFields` array is only required if you have created Quote extra fields which are marked as required. To learn more about extra fields, see B2B Edition Settings (Help Center). The `channelId` field is required if you have multiple storefront channels. If you only have a single storefront, then you do not need to include it.

Authentication

X-Auth-Tokenstring
### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
X-Store-Hashstring
### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |

Request

This endpoint expects an object.
productListlist of objectsRequired
totalAmountdoubleRequired
The total price of the quote after any discounts.
allowCheckoutbooleanOptional
Determines whether or not the buyer can take the quote to the checkout page. If left blank, the quote uses the checkout selection in your Quote settings.
channelIdintegerOptionalDefaults to 1

The storefront channel ID associated with the quote. This is required if your store has multiple storefront channels. Use 1 for your store’s default storefront channel.

companyIdintegerOptional
The unique identifier for the Company account associated with the quote. This field is required when creating a quote for a Company account.
contactInfoobjectOptional
currencyobjectOptional
discountdoubleOptional
The total value of discounts applied to the quote.
displayDiscountbooleanOptional
Determines if buyers can see quoted discount values in the Buyer Portal, or if they only see the quoted prices. If left blank, the quote uses the discount display selection in your Quote settings.
expiredAtstringOptional

The date when the buyer can no longer purchase the quote. Use ‘%m/%d/%Y’ format when entering the expiration date.

extraFieldsobjectOptional
grandTotaldoubleOptional
The quoted total after discounts, shipping, and tax are applied. If you are updating the line items or discounts on a quote, you must also update the grand total to reflect the new pricing.
legalTermsstringOptional

The quote’s terms and conditions. Use the newline character to separate each line of text. Omitting this field or leaving it blank does not add your store’s default terms and conditions to the quote. Instead, the quote will not display any terms.

messagestringOptional

A message sent to the buyer via the in-quote messaging system.

notesstringOptional

The quote’s buyer-facing notes. Use the newline character to separate each line of text.

quoteTitlestringOptional
The external title given to the quote.
referenceNumberstringOptional
An identifier for the quote that can be supplied by the sales rep or the buyer, such as a Purchase Order number.
shippingAddressobjectOptional
subtotaldoubleOptional
The quoted total after discounts and before shipping and tax. If you are updating the line items or discounts on a quote, you must also update the subtotal to reflect the new pricing.
userEmailstringOptionalformat: "email"

The email address of the quote’s sales rep. Any user email found within the B2B Edition System Users menu is considered a valid value for this field.

This field is optional. If left blank, it will default to the store owner’s email address as shown in the B2B Edition System Users menu.

Response

OK
codedoubleDefaults to 200
HTTP Response Code
dataobject
messagestringDefaults to SUCCESS
metaobject

Errors

422
Unprocessable Entity Error