Hello community,
I’m trying to figure out what would be the best way to partially cancel an order programmatically, while correctly voiding authorised funds from a partially captured transaction. The store is set up to capture funds on fulfilment. Here is an example scenario:
- Customer purchases 2 items
- 1 of the items is fulfilled
- 1 of the items can’t be fulfilled and should be cancelled
There are two different variations of the scenario:
- The partial cancellation occurs on an item with the same line item ID
- The partial cancellation occurs on items with different line item IDs
I’m currently using the following process as a base for both variations:
- Calculate a refund for the cancelled item
- Create a refund with no transaction associated
The following happens in Shopify when this is followed:
Partial cancellation occurs on an item with the same line item ID
- Shopify always selects the already fulfilled item when the refund is created
- The unfulfilled item that should be cancelled stays in the “Unfulfilled” state
- The fulfilled item can no longer be returned
- The payment section still requires capturing the remaining funds
Partial cancellation occurs on items with different line item IDs
- The cancelled item is marked as “Removed” after the $0 refund is submitted
- The payment section still requires capturing the remaining funds
I have tried the following without any success:
- Void the partially captured auth transaction (transactionVoid)-> Shopify returns an error `AUTH_NOT_VOIDABLE`.
- Create a void transaction via the REST API → Shopify refunds the captured funds and doesn’t actually create a void transaction
- Execute the `orderEditBegin`, `orderEditSetQuantity`, `orderEditCommit` → Although this solves the issue of the 1st variation scenario and moves the “Unfulfilled” product as “Removed”, Shopify now request that a refund needs to be issued to the customer. It always tries to refund the already captured portion and doesn’t allow you to void the remaining auth funds
- Cancel the fulfilment order → It simply creates a new one. Nothing really happens
At this point, I’m a bit clueless about what else I can try out, and I hope that someone that had faced this issue in the past can shed some light on what the best practice is for handling it.
TL;DR: there are two things that I want to achieve when a partial cancellation occurs on an order:
- Mark any cancelled “Unfulfilled” items as “Removed” via the Shopify API
- Void the remaining partially captured authorised funds via the Shopify API
Thanks in advance!


