Solved

Creating multiple events in one API call

  • 28 February 2023
  • 3 replies
  • 274 views

Badge +2

Can someone give me a example of using the Create Event API call to create multiple events within the same call? E.g. I’m trying to work out how to create multiple “ordered Product” calls within the same API call. What does the structure of the json data need to be? https://developers.klaviyo.com/en/reference/create_event

icon

Best answer by gregrobson 28 February 2023, 09:04

View original

3 replies

Userlevel 1
Badge +1

That endpoints doesn’t appear to allow multiple events. It’s just a single object, rather than an array of objects.

Would be a nice addition if Klaviyo could make that happen!

Badge +2

That endpoints doesn’t appear to allow multiple events. It’s just a single object, rather than an array of objects.

Would be a nice addition if Klaviyo could make that happen!

Thanks Greg, is it the same with all endpoints? e.g. https://developers.klaviyo.com/en/reference/create_catalog_variant you have to send each varient seperately instead of being able to send them all varients for a product in one post?

Userlevel 1
Badge +1

Yes, that is the case as the API endpoints tend to follow the pattern of as data: {“type”: “name”, “attributes”: {...}} 

If they supported arrays you would see something like data: data:[ { your }, { objects } ].

Reply