Automatic Referral Code Integration

Заказчик: AI | Опубликовано: 07.01.2026

I’m upgrading my ecommerce site with a fully-functional referral code system. Here’s exactly what I need built and plugged into the existing checkout and account flows: A. Each time a purchase is made, the buyer receives a code which allows the buyer to obtain a set of FREE ADS ON MY REAL ESTATE WEBSITES. B. AFTER THEY RECEIVE THEIR CODE, THEY HAVE 72 HOURS TO USE IT OR LOSE IT. • Every time a customer completes their very first purchase, the system must auto-generate a unique referral code tied to that user’s account. • The code should be stored in the database, surface in the customer’s dashboard, and be easily shareable (simple copy button and a share-by-link endpoint are enough). • When a new shopper lands on the site using that code and finishes a purchase, the original referrer and the new buyer each need to be flagged so that I can apply rewards in our admin panel. I only need the flagging logic—reward calculations will be handled later. • Admin reporting: a lightweight view that lists codes, owners, total redemptions, and date of last use. My stack is PHP 8 / Laravel with a MySQL database, but clean, framework-agnostic PHP classes are fine as long as they drop into Laravel without friction. Please keep code well-commented so future reward logic is easy to slot in. I’ll consider the task complete once I can create a test user, complete a first purchase, see the code appear, redeem it on a second test user, and view both events in the admin report.