Order financial_status still paid after order is cancelled and refunded

Hey @sengming, I realized we overlooked a mutation that might actually simplify this whole process for you!

The markOrderAsPaid mutation works great for orders created with orderCreate. Here’s how it functions: you create your order with financialStatus: "PENDING" (no transactions needed), then use markOrderAsPaid which automatically calculates the full outstanding amount and creates proper SALE transactions. When you later cancel with refund: true, it correctly processes the refund and updates the financial status to “REFUNDED” instead of staying stuck on “PAID”.

From my testing, the main limitation is that markOrderAsPaid only works on orders with a positive outstanding balance where canMarkAsPaid returns true. But this approach completely eliminates the complexity of manually calculating amounts with taxes and line items, while ensuring proper refund behavior that you were originally seeking.