Skip to main content

Convert Quote to Order

This POST API places an order from an approved quote. The order takes the quote's customer, company and line items (at the quoted company price, or the quote price when no company price is set), so you only supply the order details the quote does not carry, such as addresses and statuses.

On success the quote moves to completed and is linked to the new order. A quote can be converted only once.

Endpoint Details​

  • URL: /api/quote/{quote_id}/order
  • Method: POST
  • Authentication: Bearer Token (required)
  • Required Scopes: READ_WRITE_QUOTE and READ_WRITE_ORDER

Path Parameters​

ParameterTypeDescription
quote_idstringThe unique identifier of the quote to convert.

Authentication​

You must provide a valid accessToken in the request headers. The token's app must have both the READ_WRITE_QUOTE and READ_WRITE_ORDER scopes.

Authentication Headers​

HeaderTypeDescription
Content-TypestringMust be set to application/json.
accessTokenstringA valid access token is required.

Request Body​

Do not send customer or lineItems; they are taken from the quote.

FieldTypeRequirements/Notes
billingAddressjoiIdIdentifier of an existing billing address of the customer.
newBillingAddressobjectA new billing address. Defined in New Billing Address.
shippingAddressIdjoiIdIdentifier of an existing shipping address of the customer.
newShippingAddressobjectA new shipping address. Defined in New Shipping Address.
paymentStatusenumDefaults to "unpaid". Valid values: "unpaid", "authorized", "declined", "partially paid", "paid", "partially refunded", "refunded".
orderStatusenumDefaults to "pending". Valid values: "fulfilled", "pending", "processing", "partially fulfilled", "restocked", "cancelled".
paymentTermjoiIdId of a payment term assigned to the quote's company.
shippingCostnumberCost of shipping, must be positive or zero.
taxAmountnumberTotal tax amount for the order.
shippingLabelstringLabel for the shipping, allows empty or null.
notesstringNotes for the order.
metaFieldsarray of objectsCollection of metaField objects stored on the order.

Either billingAddress or newBillingAddress, and either shippingAddressId or newShippingAddress, must be present.

Sample Request Body​

{
"billingAddress": "63356b3b3a6353a69043680b",
"shippingAddressId": "63356b3b3a6353a69043680c",
"paymentStatus": "unpaid",
"orderStatus": "pending",
"shippingCost": 12.5,
"taxAmount": 4.2,
"shippingLabel": "UPS Ground",
"notes": "Deliver to the loading dock."
}

Response​

Success Response​

Status CodeDescription
200 OKThe quote was converted and the order was created.

Success Response Body Structure​

FieldTypeDescription
successbooleanIndicates if the request was successful.
messagestringMessage indicating the result of the operation.
dataobjectThe newly created order. Defined in Order Object.

The order carries a quoteId meta field holding the quote's number, so you can trace it back to the quote.

Sample Response Body​

{
"success": true,
"message": "Quote converted to order successfully",
"data": {
"id": "6745f1c2a9d3e81b2c4f7a10",
"entityId": "1088",
"customer": "66d07121db294e0b70180bf6",
"company": "65ba028af764f931f1c7c18b",
"orderStatus": "pending",
"paymentStatus": "unpaid",
"metaFields": [
{
"code": "quoteId",
"label": "quoteId",
"value": 1042,
"valueType": "text",
"displayStorefront": true
}
]
//...
}
}

Error Responses​

Status CodeDescription
400 Bad RequestInvalid request body, or the quote cannot be converted (see Conversion Rules). The message field names the reason.
401 UnauthorizedInvalid or missing access token.
403 ForbiddenThe token does not have both the READ_WRITE_QUOTE and READ_WRITE_ORDER scopes.
404 Not FoundQuote not found.
500 Internal Server ErrorServer encountered an error.

Conversion Rules​

The request fails with 400 and one of these messages when the quote cannot be converted:

MessageCause
Quote not foundquote_id is not a valid identifier.
Quote not approvedThe quote's status is not approved.
Quote is expiredThe quote's expiry date has passed.
Quote is already converted to an orderThe quote is already linked to an order.
Quote is already being converted to an orderAnother request converted the quote at the same time.
Grouped products cannot be ordered directlyThe quote contains a grouped product.

Errors from order placement, such as Customer not have create order permission or Shipping Address not exists, are returned with 400 as well. When order placement fails, the quote stays approved and can be converted again.

Notes​

  • Only an approved, unexpired quote can be converted.
  • Line item prices come from the quote and cannot be overridden in the request.
  • For a B2B customer, the order is placed for the quote's company.