Skip to main content

removeSalesOrder

Requires permission sales:sales_order:delete.

Delete an order. Only DRAFT or CANCELLED orders can be deleted, and not when invoices are linked to them. The order is soft-deleted and returned.

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

Variables:

{
"id": "id"
}

Response:

{
"data": {
"removeSalesOrder": {
"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"
}
}
}
}
removeSalesOrder(
id: ID!
): SalesOrder!

Arguments​

removeSalesOrder.id ● ID! non-null scalar​

The ID of the sales order.

Type​

SalesOrder object​

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