cURL
Referral triggered by custom event
curl --request POST \ --url https://{cluster}.voucherify.io/client/v1/events \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Client-Application-Id: <api-key>' \ --header 'X-Client-Token: <api-key>' \ --header 'origin: <origin>' \ --data '{ "event": "user_subscribed", "customer": { "source_id": "source_customer_event" }, "referral": { "code": "46jL0kYI", "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" }, "metadata": { "login": "bob", "pricing_plan": "PP1", "volume_number": 4 }}'
{ "object": "event", "type": "cart_abandoned", "customer": { "id": "cust_ypePCF6IU6fnUvec6RMXZuH4", "name": "John Doe", "email": "john@voucherify.io", "source_id": "source_customer_event", "metadata": { "prop": "value" }, "object": "customer" }, "referral": null, "loyalty": null }
To track a custom event, you create an event object.
The event object must be linked to the customer who performs the action. If a customer doesn’t exist in Voucherify, the customer will be created.
1 - 300
Show child attributes
event
Was this page helpful?