Skip to main content
Contributor II
Jun 6, 2024 8:21 AM UTC
Solved

Can I check with web's database before send email?

Scenario is:
I have generate orderCode in my side. Now I have popup that user can submit their email and order code. Then Klaviyo will send email to recipients. 
 
Question:
How to check with database that orderCode is correct? In case someone have submit wrong code, Klaviyo won’t send email to.

Noted: orderCode storaged in database of website, not in Klaviyo. Klaviyo just storaged orderCode that recipient submitted.

This topic has been closed for replies.
cdetdiAnswer
Problem Solver III
Jun 6, 2024 2:36 PM UTC

It sounds like you need to check the input with your INTERNAL database, not Klaviyo’s records.  If you are trying to check with Klaviyo you can do a GetEvent call with your parameters to see if there is a record with that ID.

https://developers.klaviyo.com/en/reference/get_event

5 replies

Problem Solver III
Jun 6, 2024 9:48 AM UTC

You could use the Klaviyo API to set the order ID from your system as a custom property in the Klaviyo profile. The /identify endpoint was used for this, but the new API probably has a different endpoint for it.

Contributor II
Jun 6, 2024 10:26 AM UTC

Hi @dartacus ,
Thank for answer, I thinking about this. But, User can have many orderID. How to storaged all orderID to doublecheck?

Problem Solver III
Jun 6, 2024 10:39 AM UTC

Klaviyo data storage has an array type which you can use, but personally I just store people’s most recent order ID.

Also, don’t forget that the Klaviyo ‘Placed Order’ event will probably contain your order ID. Here’s an example from my own site:

 

cdetdiAnswer
Problem Solver III
Jun 6, 2024 2:36 PM UTC

It sounds like you need to check the input with your INTERNAL database, not Klaviyo’s records.  If you are trying to check with Klaviyo you can do a GetEvent call with your parameters to see if there is a record with that ID.

https://developers.klaviyo.com/en/reference/get_event

Contributor II
Jun 10, 2024 3:26 AM UTC

Hi @cdetdi ,

But soon after user submitted, they will receive email from Klaviyo because engage a list. How can I double check in same time to prevent if they submitted wrong code?