Skip to main content

Create Sales Rep Quote

Creates a quote for a company customer on behalf of a sales rep. Product names, SKUs, images and prices are filled in from your catalog. By default, the quote notification emails are sent.

HTTP Request​

  • URL: /salesRep/quote
  • Method: POST
  • Headers:
    • accessToken: Required. Your API access token.
    • Content-Type: application/json
    • salesRepId: The ID of the sales rep creating the quote. Required unless you send salesRepId in the body.
  • Required scope: READ_WRITE_QUOTE

Request Body​

The request body is a JSON object with the following fields:

FieldTypeRequiredDescription
titleStringYesTitle of the quote.
companyStringYesID of the company.
customerStringYesID of the customer.
productsArrayYesProducts in the quote. See Product Object.
salesRepIdStringNoID of the sales rep creating the quote, if not sent in the salesRepId header.
statusStringNopending, approved, rejected, completed, negotiated or expired. Default is pending.
commentStringNoFirst comment on the quote.
notesStringNoInternal notes for the quote.
triggerEmailBooleanNoWhether to send the quote notification emails. Default is true.
metaFieldsArrayNoCustom field values. Each item has code (an existing metafield code) and value.

Product Object​

FieldTypeRequiredDescription
productStringYesID of the product.
quantityNumberYesQuantity requested.
variantStringNoID of the product variant.
requestedPriceNumberNoUnit price requested by the customer.
companyPriceNumberNoUnit price offered to the company.

cURL Example​

curl --location '<BASE_URL>/salesRep/quote' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'salesRepId: 66b1c2d3e4f5a6b7c8d9e0f1' \
--header 'Content-Type: application/json' \
--data '{
"title": "Q4 safety gloves restock",
"company": "665434c100e82884676936b9",
"customer": "66a5023524b16685e42a1eda",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"variant": "65b88ef5045a7d009e79974e",
"quantity": 50,
"companyPrice": 11.25
}
],
"comment": "Pricing valid for orders placed this quarter.",
"triggerEmail": false
}'

Response​

  • 200 OK: The quote was created successfully.
  • 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, a field is missing or invalid, or the sales rep, company or customer was not found.

Sample JSON Response​

{
"success": true,
"message": "Quote created Successfully",
"data": {
"_id": "6710a4c2e1f2a3b4c5d6e7f8",
"quoteId": 1042,
"title": "Q4 safety gloves restock",
"status": "pending",
"requestedCount": 0,
"company": "665434c100e82884676936b9",
"companyDetails": {
"companyId": "665434c100e82884676936b9",
"name": "Northwind Supply",
"email": "purchasing@northwindsupply.com",
"phoneNumber": "9735550100"
},
"customer": "66a5023524b16685e42a1eda",
"customerDetails": {
"customerId": "66a5023524b16685e42a1eda",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria.lopez@northwindsupply.com",
"phoneNumber": "9735550142"
},
"products": [
{
"_id": "6710a4c2e1f2a3b4c5d6e7f9",
"product": "65b88ef5045a7d009e79974b",
"variant": "65b88ef5045a7d009e79974e",
"name": "Nitrile Safety Gloves",
"sku": "GLV-1102-L",
"productSku": "GLV-1102",
"image": "https://cdn.example.com/products/glv-1102.webp",
"options": [
{ "optionName": "Size", "optionValueLabel": "Large", "optionValue": "L" }
],
"quantity": 50,
"price": 12.5,
"requestedPrice": null,
"companyPrice": 11.25,
"extendedPrice": 562.5
}
],
"comments": [
{
"_id": "6710a4c2e1f2a3b4c5d6e7fa",
"name": "James Carter",
"comment": "Pricing valid for orders placed this quarter.",
"isCustomer": false,
"replies": [],
"createdAt": "2024-10-17T08:30:58.412Z",
"updatedAt": "2024-10-17T08:30:58.412Z"
}
],
"timeline": [
{
"_id": "6710a4c2e1f2a3b4c5d6e7fb",
"name": "James Carter",
"description": "James Carter created new quote",
"createdAt": "2024-10-17T08:30:58.412Z",
"updatedAt": "2024-10-17T08:30:58.412Z"
}
],
"createdBy": {
"id": "66b1c2d3e4f5a6b7c8d9e0f1",
"name": "James Carter",
"type": "salesRep"
},
"notes": "",
"metaFields": [],
"isCompleted": false,
"expiryDate": "2024-11-01T08:30:58.401Z",
"createdAt": "2024-10-17T08:30:58.412Z",
"updatedAt": "2024-10-17T08:30:58.412Z"
}
}

Response Details​

Quote Data​

FieldTypeDescription
_idStringUnique identifier of the quote.
quoteIdNumberQuote number.
titleStringTitle of the quote.
statusStringStatus of the quote.
companyStringID of the company.
companyDetailsObjectCompany name, email and phoneNumber at the time of the quote.
customerStringID of the customer.
customerDetailsObjectCustomer name, email and phone number at the time of the quote.
productsArrayProducts in the quote. See below.
commentsArrayComments on the quote.
timelineArrayHistory of the quote.
createdByObjectThe sales rep who created the quote: id, name and type.
notesStringInternal notes.
metaFieldsArrayCustom field values.
expiryDateStringDate and time the quote expires (ISO 8601). Based on the store's quote settings; 15 days by default.
createdAtStringDate and time the quote was created (ISO 8601).
updatedAtStringDate and time the quote was last updated (ISO 8601).

Product Data​

FieldTypeDescription
productStringID of the product.
variantStringID of the variant, if any.
nameStringProduct name.
skuStringSKU of the variant, or of the product if there is no variant.
productSkuStringSKU of the product.
imageStringURL of the product or variant image.
optionsArrayVariant options, if any.
quantityNumberQuantity requested.
priceNumberCatalog unit price.
requestedPriceNumberUnit price requested by the customer.
companyPriceNumberUnit price offered to the company.
extendedPriceNumberLine total: quantity times the company price, the requested price, or the catalog price, in that order.

Notes​

  • To view and manage quotes after they are created, see Quotes.
  • Set triggerEmail to false to create the quote without sending emails.