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:
- GraphQL
- cURL
mutation RemovePurchaseOrder($id: ID!) {
removePurchaseOrder(id: $id) {
id
orderNumber
supplierCode
trackingCode
creatorName
projectName
items {
id
productName
uomName
variantName
createdAt
canceledQuantity
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RemovePurchaseOrder($id: ID!) {\n removePurchaseOrder(id: $id) {\n id\n orderNumber\n supplierCode\n trackingCode\n creatorName\n projectName\n items {\n id\n productName\n uomName\n variantName\n createdAt\n canceledQuantity\n }\n }\n}",
"variables": {
"id": "id"
}
}
EOF
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.