POST Create a quote from a product.
POST /commerce/webstores/{webstoreId}/products/{productId}/quotes
Operation ID: createQuoteFromProduct.
This API creates a new quote from a product on the Product Display Pages (PDP) in a B2B storefront.
It creates a temporary (secondary) cart to process the request. It converts the product details into quote line items based on the specified product ID and quantity. After processing, the secondary cart is deleted, regardless of whether the API call succeeds or fails.
Supported product types by license:
- Simple products: Supported with B2B Commerce Only or B2B Commerce and Revenue Cloud licenses.
- Static bundles: Supported only with the B2B Commerce and Revenue Cloud licenses.
Parameters
webstoreId(path, string (Id), required) The ID of the webstoreThe ID of the quote record to be retrieved.
productId(path, string (Id), required) The ID of the product to create a quote forThe ID of the product to be converted to a quote.
effectiveAccountId(query, string (Id)) ID of the account for which the request is made. If null, the context user's account is used.The ID of the user account associated with the quote.
Request body (required)
Input parameters for creating a quote from the product.
Media type: application/json. Schema: sfdc.commerce.product.connect.api.input.CreateQuoteFromProductInputRepresentation.
Example: basicQuote Basic quote request
{
"quantity": "10"
}
Example: fullQuote Full quote request with all options
{
"productSellingModelId": "01txx0000000003AAA",
"quantity": "100",
"subscriptionTerm": 24,
"comments": "Bulk order for enterprise deployment",
"additionalFields": {
"ExpirationDate": "2024-12-31",
"BuyerEmail__c": "procurement@company.com"
}
}
Responses
- 200
Quote created successfully from product.
Media type:
application/json. Schema:sfdc.commerce.product.connect.api.output.CreateQuoteFromProductOutputRepresentation.Example: success Successful quote creation
{ "quoteId": "0Q0xx0000000001AAA", "errors": [] } - 400
Invalid input parameters or request data.
Media type:
application/json. Schema:sfdc.commerce.product.connect.api.output.CreateQuoteFromProductOutputRepresentation.Example: invalidInput Invalid input error
{ "quoteId": null, "errors": [ { "code": "INVALID_INPUT", "message": "The provided parameter is invalid or malformed." } ] }Example: invalidCustomFields Invalid custom fields error
{ "quoteId": null, "errors": [ { "code": "INVALID_CUSTOM_FIELDS", "message": "One or more custom field values are invalid." } ] } - 404
Requested resource doesn't exist.
Media type:
application/json. Schema:sfdc.commerce.product.connect.api.output.CreateQuoteFromProductOutputRepresentation.Example: productNotFound Product not found error
{ "quoteId": null, "errors": [ { "code": "PRODUCT_NOT_FOUND", "message": "The specified product doesn't exist." } ] }Example: webstoreNotFound Web store not found error
{ "quoteId": null, "errors": [ { "code": "WEBSTORE_NOT_FOUND", "message": "The specified web store doesn't exist." } ] } - 500
Unexpected system error occurred.
Media type:
application/json. Schema:sfdc.commerce.product.connect.api.output.CreateQuoteFromProductOutputRepresentation.Example: internalError Internal server error
{ "quoteId": null, "errors": [ { "code": "INTERNAL_SERVER_ERROR", "message": "An unexpected error occurred while processing the request." } ] }