If your trying to have a custom feature set you may need to build a custom app.
By “Prompt” you mean like a popup or modal on the theme for the online sales channel?
Or other messaging like an announcement/footer bar, or even just an email that takes them to the “gift” products page?
If you can’t build a custom app you can probably assemble the process:
Frontend
If only theme based that can be handled by using the customer.total_spent liquid object either in a custom-liquid section, or one time theme customization.
https://shopify.dev/docs/api/liquid/objects/customer#customer-total_spent
And if the “gift” product price is free prevent others from seeing it on the store based on that logic , and if they have gotten the product they can’t see it again. If “gift” price isn’t set to $0 then apply a manual discount code if not using automatic discounts.
There are apps like locksmith that help gate products.
Note how even if using an app you would still want some backend validation to lower the chance that abusing gifts is possible.
Backend -
If needing transactional email , and or discount code generation, and or individual product generation this can be setup using an automation tool like usemechanic
Which would generally pivot around taging the customer for eligibility
https://tasks.mechanic.dev/tag-customers-by-order-tier
alternatively a rolling spend threshold: https://tasks.mechanic.dev/auto-tag-customers-having-a-rolling-minimum-total-spend
Then generate the discount and email them, there is no 1:1 script for this but there is a demo script here: https://tasks.mechanic.dev/email-customers-a-unique-discount-code-two-weeks-after-order-fulfillment
If your using other automation services like make.com,zapier,ifftt, they may be able to facilitate pieces of process.
Hypothetically the email part, maybe even the discount generation, may be possible using shopify-flow though it doesn’t have transactional email features really https://community.shopify.com/c/shopify-flow-app/shopify-flow-email-sent-to-customer-if-order-contains-a-tag/td-p/1799428
If you need any of the below setup you can contact me directly for such customizations and consults. Please provide context: store url, theme name, post urls, additional issue detail, etc.
Contact info in signature.