Skip to main content

convertQuoteToSalesOrder

Requires permission sales:sales_order:create.

Convert a quote into a sales order. Lines keep the quoted prices; any price drift is recorded rather than repriced. Taxed lines without a valid tax method are rejected. Send an idempotencyKey so a retry returns the original order instead of creating another. The quote moves to ACCEPTED and links to the order.

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 ConvertQuoteToSalesOrder($quoteId: ID!) {
convertQuoteToSalesOrder(quoteId: $quoteId) {
id
customerPoNumber
orderNumber
sourceQuoteNumber
trackingNumber
creatorName
billingAddress {
postalCode
city
country
state
street1
street2
}
}
}

Variables:

{
"quoteId": "id"
}

Response:

{
"data": {
"convertQuoteToSalesOrder": {
"id": "id",
"customerPoNumber": "string",
"orderNumber": "string",
"sourceQuoteNumber": "string",
"trackingNumber": "string",
"creatorName": "string",
"billingAddress": {
"postalCode": "string",
"city": "string",
"country": "string",
"state": "string",
"street1": "string",
"street2": "string"
}
}
}
}

Convert a quote to a sales order, safely retryable:

mutation ConvertQuoteToSalesOrder($quoteId: ID!, $idempotencyKey: String) {
convertQuoteToSalesOrder(quoteId: $quoteId, idempotencyKey: $idempotencyKey) {
id
orderNumber
status
sourceQuoteNumber
totalAmount
}
}

Variables:

{
"quoteId": "QUOTE_ID",
"idempotencyKey": "UNIQUE_REQUEST_KEY"
}

Response:

{
"data": {
"convertQuoteToSalesOrder": {
"id": "SALES_ORDER_ID",
"orderNumber": "ORDER_NUMBER",
"status": "DRAFT",
"sourceQuoteNumber": "QUOTE_NUMBER",
"totalAmount": 200
}
}
}
convertQuoteToSalesOrder(
idempotencyKey: String
quoteId: ID!
warehouseId: ID
): SalesOrder!

Arguments​

convertQuoteToSalesOrder.idempotencyKey ● String scalar​

A unique key you generate. Retrying with the same key returns the original result instead of creating another record.

convertQuoteToSalesOrder.quoteId ● ID! non-null scalar​

The ID of the quote to convert.

convertQuoteToSalesOrder.warehouseId ● ID scalar​

The ID of the warehouse that supplies the order, when it should differ from the quote's own.

Type​

SalesOrder object​

A confirmed demand from a customer to ship goods, usually converted from a quote. Moves through confirmation, shipment, invoicing and payment.