Discount codes for thank you page

Topic summary

A developer is building a Shopify thank‑you page extension and cannot retrieve discount data after checkout. They report that the Checkout UI hook useDiscountCodes (used alongside useApi) returns an empty array (Array(0)) despite having the read_discounts scope granted.

Key details:

  • Context: Thank‑you page (post‑purchase) extension in Shopify Checkout.
  • Methods used: useApi and useDiscountCodes (hooks intended to access checkout data, including applied discount codes).
  • Permission: read_discounts scope is enabled.
  • Result: useDiscountCodes returns no codes (Array(0)). A screenshot is included showing the empty result.

Request: The poster asks for help diagnosing why discount codes aren’t returned on the thank‑you page.

Outcome: No solutions or workarounds have been provided yet; the thread remains open with unanswered questions.

Summarized with AI on December 15. AI used: gpt-5.

Hi,
I am creating a extension for thank you page ,


I used useApi();
and useDiscountCodes();
scope permission “read_discounts”
result: Array(0)
can you help me anyone ?
Thanks
zoynul