Skip to main content

createQuote

Requires permission sales:quote:create.

Create a quote for a customer. Line prices come from the quote input, so send each line's unitPrice. Counts against the organization's monthly quote limit. New quotes start as DRAFT unless a status is supplied.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateQuote($input: CreateQuoteInput!) {
createQuote(input: $input) {
id
quoteNumber
competitorName
customerName
status
createdAt
convertedToInvoice {
id
invoiceNumber
supplierCode
supplierDisplayName
supplierName
status
}
}
}

Variables:

{
"input": {
"currency": "string",
"customerId": "string",
"discountAmount": 0,
"discountType": "string",
"discountValue": 0,
"items": [
{
"discount": 0,
"discountType": "string",
"productId": "string",
"productName": "string",
"quantity": 0,
"taxAmount": 0,
"taxRate": 0,
"unitPrice": 0,
"variantId": "string"
}
],
"shippingCost": 0,
"subtotal": 0,
"taxAmount": 0,
"taxRate": 0,
"totalAmount": 0
}
}

Response:

{
"data": {
"createQuote": {
"id": "id",
"quoteNumber": "string",
"competitorName": "string",
"customerName": "string",
"status": "string",
"createdAt": "2025-01-15T00:00:00Z",
"convertedToInvoice": {
"id": "id",
"invoiceNumber": "string",
"supplierCode": "string",
"supplierDisplayName": "string",
"supplierName": "string",
"status": "APPROVED"
}
}
}
}

Create a quote with one line item:

mutation CreateQuote($input: CreateQuoteInput!) {
createQuote(input: $input) {
id
quoteNumber
status
currency
totalAmount
}
}

Variables:

{
"input": {
"customerId": "CUSTOMER_ID",
"currency": "CURRENCY_CODE",
"discountAmount": 0,
"discountType": "PERCENTAGE",
"discountValue": 0,
"items": [
{
"discount": 0,
"discountType": "PERCENTAGE",
"productId": "PRODUCT_ID",
"productName": "Product name",
"quantity": 2,
"taxAmount": 0,
"taxRate": 0,
"unitPrice": 100,
"variantId": "VARIANT_ID"
}
],
"shippingCost": 0,
"subtotal": 200,
"taxAmount": 0,
"taxRate": 0,
"totalAmount": 200
}
}

Response:

{
"data": {
"createQuote": {
"id": "QUOTE_ID",
"quoteNumber": "QUOTE_NUMBER",
"status": "DRAFT",
"currency": "CURRENCY_CODE",
"totalAmount": 200
}
}
}
createQuote(
input: CreateQuoteInput!
): Quote!

Arguments​

createQuote.input ● CreateQuoteInput! non-null input​

The quote to create.

Type​

Quote object​

A priced offer to a customer, valid until a set date. Converts to a sales order or invoice when accepted.