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/jsonsalesRepId: The ID of the sales rep creating the quote. Required unless you sendsalesRepIdin the body.
- Required scope:
READ_WRITE_QUOTE
Request Body
The request body is a JSON object with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
title | String | Yes | Title of the quote. |
company | String | Yes | ID of the company. |
customer | String | Yes | ID of the customer. |
products | Array | Yes | Products in the quote. See Product Object. |
salesRepId | String | No | ID of the sales rep creating the quote, if not sent in the salesRepId header. |
status | String | No | pending, approved, rejected, completed, negotiated or expired. Default is pending. |
comment | String | No | First comment on the quote. |
notes | String | No | Internal notes for the quote. |
triggerEmail | Boolean | No | Whether to send the quote notification emails. Default is true. |
metaFields | Array | No | Custom field values. Each item has code (an existing metafield code) and value. |
Product Object
| Field | Type | Required | Description |
|---|---|---|---|
product | String | Yes | ID of the product. |
quantity | Number | Yes | Quantity requested. |
variant | String | No | ID of the product variant. |
requestedPrice | Number | No | Unit price requested by the customer. |
companyPrice | Number | No | Unit 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
| Field | Type | Description |
|---|---|---|
_id | String | Unique identifier of the quote. |
quoteId | Number | Quote number. |
title | String | Title of the quote. |
status | String | Status of the quote. |
company | String | ID of the company. |
companyDetails | Object | Company name, email and phoneNumber at the time of the quote. |
customer | String | ID of the customer. |
customerDetails | Object | Customer name, email and phone number at the time of the quote. |
products | Array | Products in the quote. See below. |
comments | Array | Comments on the quote. |
timeline | Array | History of the quote. |
createdBy | Object | The sales rep who created the quote: id, name and type. |
notes | String | Internal notes. |
metaFields | Array | Custom field values. |
expiryDate | String | Date and time the quote expires (ISO 8601). Based on the store's quote settings; 15 days by default. |
createdAt | String | Date and time the quote was created (ISO 8601). |
updatedAt | String | Date and time the quote was last updated (ISO 8601). |
Product Data
| Field | Type | Description |
|---|---|---|
product | String | ID of the product. |
variant | String | ID of the variant, if any. |
name | String | Product name. |
sku | String | SKU of the variant, or of the product if there is no variant. |
productSku | String | SKU of the product. |
image | String | URL of the product or variant image. |
options | Array | Variant options, if any. |
quantity | Number | Quantity requested. |
price | Number | Catalog unit price. |
requestedPrice | Number | Unit price requested by the customer. |
companyPrice | Number | Unit price offered to the company. |
extendedPrice | Number | Line 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
triggerEmailtofalseto create the quote without sending emails.