Skip to main content
POST
/
client
/
v1
/
events
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
}

Authorizations

X-Client-Application-Id
string
header
required
X-Client-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

origin
string<hostname>
required

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

Body

application/json

Specify the details of the custom event.

Request body schema for POST v1/events.

event
string
required

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

Required string length: 1 - 300
customer
object
required

Customer's information.

referral
object

If a conversion event for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event.

loyalty
object

If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.

metadata
object

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.

Response

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

Response body schema for POST v1/events.

object
enum<string>
default:event
required

The object represented is an event.

Available options:
event
type
string
required

The event name.

customer
object
required

A simple customer object This is an object representing a customer with limited properties used in Event Tracking endpoints.

referral
null
required

A null referral object.

loyalty
null
required

A null loyalty object.

metadata
object
required
I