# Your webhook secret
SECRET="whsec_your_secret_here"
# Build the payload
BODY='{"id":"msg_test_001","type":"conversion.created","schemaVersion":2,"createdAt":"2026-03-23T18:00:00.000Z","merchantId":"mer_test","environment":"development","data":{"id":"conv_test","affiliateId":"aff_test","amount":9900,"currency":"usd","commissionAmount":2970,"status":"pending"}}'
# Generate signature
MSG_ID="msg_test_001"
TIMESTAMP=$(date +%s)
SIGNATURE=$(echo -n "${MSG_ID}.${TIMESTAMP}.${BODY}" | openssl dgst -sha256 -hmac $(echo -n "${SECRET#whsec_}" | base64 -d) -binary | base64)
# Send the request
curl -X POST http://localhost:3000/webhooks/agentref \
-H "Content-Type: application/json" \
-H "svix-id: ${MSG_ID}" \
-H "svix-timestamp: ${TIMESTAMP}" \
-H "svix-signature: v1,${SIGNATURE}" \
-d "${BODY}"