Apply Gift Voucher
Apply a gift voucher code to reduce the cart total.Authentication
Requires user authentication token.Request Body
Gift voucher code to apply
Response
Returns the updated cart with gift voucher discount applied.Products in cart with updated pricing
Cart metadata including gift voucher details
Updated cart totals with voucher discount
Validation Process
- Code Sanitization - Voucher code is sanitized
- Ownership Check - Verifies voucher belongs to user (by email or phone)
- Status Check - Ensures voucher is active (status=1)
- Cart Validation - Vouchers cannot be applied to gift-voucher-only carts
- Discount Application - Applies available voucher balance to cart
Error Responses
Error title
Detailed error message
View Gift Vouchers
Retrieve all available gift vouchers for the authenticated user.Authentication
Requires user authentication token.Query Parameters
Platform identifier (web/app)
Response
Returns an array of gift vouchers owned by the user.Name of the person who sent the gift voucher
Unique voucher code
Current balance/value of the voucher
Original value of the voucher when issued
Event tracking ID (only for web platform)
Gift Voucher Ownership
Gift vouchers are linked to users through:- Email Address - Primary identifier
- Phone Number - Secondary identifier (if email is empty)
Database Query Logic
Gift Voucher Restrictions
- Cannot be the only items in cart when applying voucher
- Must have regular products in cart along with gift vouchers
- Voucher must be active (status=1)
- Voucher must belong to the authenticated user
- Partial usage is supported (remaining balance preserved)
Purchase Gift Vouchers
Gift vouchers can be purchased as products and will be:- Generated with unique codes
- Sent to recipient’s email/phone
- Tracked in order history
- Activated upon successful payment
Tracking & Analytics
The endpoint includes Facebook event tracking for:- Page views
- Voucher applications
- Purchase events
- User email and phone
- Event source URL
- Action source (web=1, app=2)
- Client IP address
- User agent information