Skip to main content
POST/product-event-creation/:custom_id/

Create product event (alternative)

There's an alternative endpoint for creating a product event assigned to a specific user.
If your products have custom IDs with "/" character, the standard endpoint will not work and you need to use the endpoint given below:

Attributes

Optional unless marked required

user_idintegerrequired
A unique identifier for the user which is given by User automatically.
user_custom_idstringrequired
The unique identifier for the user which is provided by the client.
custom_idstring
A unique identifier for the product provided by the client.
datajsonrequired
A valid JSON object with additional data (attributes). Special "custom_data" key may contain additional custom json defined data unique per product event occurence.
event_typestringrequired
A predefined event type. See the available types in What Is a Product Event.
timestamptimestamprequired
A datetime when an event occured in UNIX format.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/product-event-creation/:custom_id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"user_custom_id": "jane-doe",
"event_type": "purchase",
"timestamp": 1794303223,
"data": {
"quantity": 1
}
}'

Response examples​

{
"id": 388
}

Response fields​

Fields returned in the 201 Created response body.

idinteger
ID of the product.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.