Skip to main content

removePurchaseOrder

Requires permission purchase:purchase_order:delete.

Deletes a purchase order. Only DRAFT or CANCELLED orders can be deleted. Needs the purchase order delete permission and the purchase orders feature on your plan.

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 RemovePurchaseOrder($id: ID!) {
removePurchaseOrder(id: $id) {
id
orderNumber
supplierCode
trackingCode
creatorName
projectName
items {
id
productName
uomName
variantName
createdAt
canceledQuantity
}
}
}

Variables:

{
"id": "id"
}

Response:

{
"data": {
"removePurchaseOrder": {
"id": "id",
"orderNumber": "string",
"supplierCode": "string",
"trackingCode": "string",
"creatorName": "string",
"projectName": "string",
"items": [
{
"id": "id",
"productName": "string",
"uomName": "string",
"variantName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"canceledQuantity": 0
}
]
}
}
}
removePurchaseOrder(
id: ID!
): PurchaseOrder!

Arguments​

removePurchaseOrder.id ● ID! non-null scalar​

The ID of the purchase order.

Type​

PurchaseOrder object​

A purchase order raised with a supplier.