Add Coupon unique code to Lead Webhook response
I'm needing to use these Webhook responses to programmatically build an interface where the user sees a description of the offer, then clicks a link to go to a lead that contains a form to fill out to get to the voucher/coupon to redeem.
All the descriptive info I need to show the user is in the VOUCHER_UPDATED event:
event: 'VOUCHER_UPDATED',
timestamp: '2024-01-30 05:30:45',
user: 'buckscountyarc@gmail.com',
voucherid: 'y5c2o8',
title: 'Olive Garden',
description: 'Get a free taste of Little Italy from Olive Garden!',
type: 'UNIQUEID',
productname: 'Free Italian Dinner!',
couponnumber: '5 Total Available',
eancode: '1234567890123',
website: 'http://olivegarden.com',
quantity: '5',
validfrom: '2024-01-29 00:00:00',
validto: '2024-02-02 00:00:00',
secrettoken: '<token goes here>'
So using this data I can build a UI that shows the offer details.
The problem is, it then needs to link to the Lead/Landing Page that contains the voucher/coupon. The data from creating that looks like:
event: 'QRCODEUPDATED',
timestamp: '2024-01-30 05:23:02',
user: 'buckscountyarc@gmail.com',
code: '1tmdw7',
secrettoken: '<token goes here>'
Right now there's no way to associate one with the other from the Webhook responses. So my user can see all the details of the offer for the coupon/voucher, but can't get to the correct Lead/Landing Page that contains it.
I was thinking since each Lead can only ever contain at most one voucher/coupon, is it possible to include the id of that voucher/coupon (if present) with the Lead/Landing Page data returned from the webhook?
So something like:
event: 'QRCODEUPDATED',
timestamp: '2024-01-30 05:23:02',
user: 'buckscountyarc@gmail.com',
code: '1tmdw7',
voucherid: 'y5c2o8',
secrettoken: '<token goes here>'