Log referral conversions from Square by posting discount code redemption data to Refer Labs the moment a payment is completed.
Pick one consistent place to enter the ambassador’s discount code during checkout so it’s available to automations.
Attribution depends on the exact discount code value that you post to Refer Labs.
When Square confirms payment, call the discount capture endpoint from a trusted automation (Zapier/Make) or your server.
Conversion endpoint
POST https://referlabs.com.au/api/discount-codes/redeem
Headers:
Content-Type: application/json
x-pepf-discount-secret: <YOUR_SECRET>
Body:
{
"discountCode": "CODE_FROM_SQUARE",
"orderReference": "SQUARE-PAYMENT-ID",
"amount": "199.00",
"metadata": { "platform": "square" }
}Don’t store the secret in client-side Wix/Webflow/etc scripts. Keep it in Zapier/Make or a backend.
If your trigger fires before the code is available, add a follow-up step to fetch the payment/order details from Square and extract the discount code.
discountCode matches the ambassador’s code exactly.orderReference.