Cancel purchase order
PATCH/v1/entities/:entity_id/purchase_orders/:uuid/cancel
Cancels a purchase order that is still in draft or ordered status and has no receipts against it.
Requires the purchase_orders:write scope. The key's shop must also be linked to
{entity_id}, else 403 — see the API key scheme on the Authentication page. A
purchase order can be cancelled only while its status is draft or ordered, it has no
receipts, and it has no partially-applied incoming inventory changes — otherwise 422. A
purchase_orders:write key can cancel a purchase order this way, but cannot mark one
ordered, receive it, or delete it.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 422
- 504
Purchase order cancelled.
Missing or malformed changed_by.
The Authorization header is missing, is not HTTP Basic, or does not carry a valid API key. Manage your keys under Shopify admin → Bookkeep app → Settings → Manage API Keys.
The key is missing the purchase_orders:write scope, or the key's shop is not linked to {entity_id} (or is not linked to any Bookkeep entity).
Purchase order not found, belongs to another shop, or is soft-deleted. A malformed path segment — an {entity_id} containing anything other than letters and digits, or a {uuid} containing anything other than letters, digits, - or _ — is instead rejected by routing before this endpoint runs, and that 404 carries the Bookkeep app's HTML error page rather than the JSON body below.
Purchase order is not in a cancellable state (wrong status, has receipts, or has partially-applied incoming inventory changes).
The purchase order service did not respond in time. The cancellation may or may not have been applied — re-load the purchase order before retrying.