Hi!
We are working on an integration with Klaviyo, we'll be sending events to the platform based on the data that we have tracked on the website. We are using the events bulk create endpoint.
Usually, when there is invalid input for this endpoint (like an invalid phonenumber), the error pointer will point to the invalid event and we can remove those in a subsequent request so that only valid events are remaining and the request will succeed.
Now we have the following scenario, the JSON we are sending is as follows (only need to look at the profile attributes):
{
"data":{
"type":"event-bulk-create-job",
"attributes":{
"events-bulk-create":{
"data":
{
"type":"event-bulk-create",
"attributes":{
"profile":{
"data":{
"type":"profile",
"attributes":{
"_kx":"r-xYo18d25SDCR7gwRkV4Q.SaGU2i"
}
}
},
"events":{
"data":
{
"type":"event",
"attributes":{
"properties":{
"test":"test"
},
"metric":{
"data":{
"type":"metric",
"attributes":{
"name":"Viewed Product - TrackBee"
}
}
},
"time":"2024-12-16T13:32:58.153237Z",
"value":1.00,
"value_currency":"EUR"
}
}
]
}
}
},
{
"type":"event-bulk-create",
"attributes":{
"profile":{
"data":{
"type":"profile",
"attributes":{
"email":"selcuk@trackbee.io"
}
}
},
"events":{
"data":
{
"type":"event",
"attributes":{
"properties":{
"test":"test"
},
"metric":{
"data":{
"type":"metric",
"attributes":{
"name":"Viewed Product - TrackBee"
}
}
},
"time":"2024-12-16T13:33:58.153237Z",
"value":1.00,
"value_currency":"EUR"
}
}
]
}
}
}
]
}
}
}
}
These are two events, one with an invalid _kx (for whatever reason, it looks valid to me) and a valid emailadress. However the error we get is as follows:
{
"errors":
{
"id":"03326af3-82dd-4578-b0c5-9ff4af2640e1",
"status":400,
"code":"invalid",
"title":"Invalid input.",
"detail":"Invalid _kx token",
"source":{
"pointer":"_kx",
"parameter":null
}
}
]
}
How are we supposed to tell, from this error, which event is the culprit. For other error types we usually get a pointer that looks like "/data/attributes/events-bulk-create/data/0” if it's regarding the first event (index 0) but we don't get that here.