Refund calculate API return incorrect amount

Topic summary

Issue: Shopify’s refund calculation API returns a non‑zero amount for unpaid items in orders using new pre‑order and try‑before‑you‑buy (TBYB) flows.

Context: After Shopify introduced pre‑order/TBYB, a test “overdue payment” order was used to verify refunds. For line items that have not been paid, the API’s calculated refund amount is not zero, which the poster considers incorrect.

Expectation: Unpaid items should have a refund amount of 0, since no payment was captured.

Question: The poster asks whether this behavior is a Shopify bug or expected logic in the new order types.

Impact: This discrepancy affects how their app automates refunds and may lead to incorrect refund handling.

Artifacts: Two screenshots are attached (central to understanding values shown by Shopify’s calculation).

Status: No confirmation or resolution provided in the thread; awaiting clarification on intended behavior and guidance on handling unpaid items in refund calculations.

Summarized with AI on February 14. AI used: gpt-5.

Shopify recently introduced pre-order and try-before-you-buy orders. I am verifying how to refund this overdue payment order. Below is my test order, I found that for unpaid items, the amount returned by Shopify’s refund calculation is unexpected, and the refund amount for unpaid items should return 0 to be reasonable. I would like to ask if this is a bug of Shopify or is it expected? This affects our app’s handling of automatic refunds.