v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Client-side

Track Custom Event (client-side)

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.

post/client/v1/events

Headers

originstring hostname required

Indicates the origin (scheme, hostname, and port).

Request body

eventstring required

Event name. This is the same name that you used to define a custom event in the Dashboard > Project Settings > Event Schema.

metadataobject

The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the Dashboard > Project Settings > Event Schema > Edit particular event > Metadata property definition.

Example request

{
  "referral": {
    "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
  },
  "loyalty": {
    "code": "L-CARD-BUHuH6g"
  }
}

Response

Returns the event type if the event was received by the application.

object'event' required

The object represented is an event.

typestring required

The event name.

referralobject nullable required

A null referral object.

loyaltyobject nullable required

A null loyalty object.

metadataobject required

Example response

{
  "customer": {
    "id": "cust_CSnYd37MXmrbS19XCrghjBsv"
  }
}