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:
- GraphQL
- cURL
mutation ConvertQuoteToSalesOrder($quoteId: ID!) {
convertQuoteToSalesOrder(quoteId: $quoteId) {
id
customerPoNumber
orderNumber
sourceQuoteNumber
trackingNumber
creatorName
billingAddress {
postalCode
city
country
state
street1
street2
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ConvertQuoteToSalesOrder($quoteId: ID!) {\n convertQuoteToSalesOrder(quoteId: $quoteId) {\n id\n customerPoNumber\n orderNumber\n sourceQuoteNumber\n trackingNumber\n creatorName\n billingAddress {\n postalCode\n city\n country\n state\n street1\n street2\n }\n }\n}",
"variables": {
"quoteId": "id"
}
}
EOF
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:
- GraphQL
- cURL
mutation ConvertQuoteToSalesOrder($quoteId: ID!, $idempotencyKey: String) {
convertQuoteToSalesOrder(quoteId: $quoteId, idempotencyKey: $idempotencyKey) {
id
orderNumber
status
sourceQuoteNumber
totalAmount
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ConvertQuoteToSalesOrder($quoteId: ID!, $idempotencyKey: String) {\n convertQuoteToSalesOrder(quoteId: $quoteId, idempotencyKey: $idempotencyKey) {\n id\n orderNumber\n status\n sourceQuoteNumber\n totalAmount\n }\n}",
"variables": {
"quoteId": "QUOTE_ID",
"idempotencyKey": "UNIQUE_REQUEST_KEY"
}
}
EOF
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.