How can you create a coupon code based on lifetime spend.
For example, if a customer has spent over $500 get 5% discount.
How can you create a coupon code based on lifetime spend.
For example, if a customer has spent over $500 get 5% discount.
To achieve the same you would need a custom app.
Which will follow below steps
Get customer’s id or every successful order.
Access customer data using retrieved customer ID from order webhook.
Check for your threshold amount value with total_spent from customer json object. Which has the total spent amount.
Below is the customer api
https://shopify.dev/docs/api/admin-rest/2022-04/resources/customer
Hope it helps…