Skip to main content
Solved

How to save date/time in an event using the Events API (stored as string instead of date)

  • December 19, 2025
  • 3 replies
  • 63 views

shahidIqbal
Contributor I
Forum|alt.badge.img+1

Hello everyone,
I hope you’re all doing well.

I have a question about sending date/time values via the Klaviyo Events API.

I’m trying to store a date-time value in an event property, but it is always saved as a string instead of a date in Klaviyo. I’ve tried several formats, but the result is the same.

For example, I want the following value to be stored as a date, not a string:

 

expiry_date: "2022-11-08T00:00:00+00:00"

Below is a sample of the event payload I’m sending:

 

{ "CUS-stockist-name": "OLD-STKST",

"Coupon": {

      "minimum_order_amount": 0,

      "expiry_date": "2022-11-08T00:00:00+00:00",

      "amount": 500,

      "code": "BDAY-1SEDQNB"

}, "recommended-stockists": [ { "distance_km": 0.11, "address": "ADDR3F", "id": 3259, "url": "https://xxxxxxx.jp/stores/3259/", "name": "TEST-STK" } ], "CUS-stockist-id": 4667, "group-stockist": false, "$value_currency": "JPY", "$value": 500 }

Is there a specific way or required field type to ensure Klaviyo recognizes this as a date/time property instead of a string?
Or is it expected behavior that event properties are always stored as strings?

Any guidance or best practices would be greatly appreciated.
Thank you in advance!

Best answer by cadence

Hey ​@shahidIqbal, what exactly are you trying to do with this expiry_date property? Are you trying to use it in a segment? As part of a flow trigger filter or conditional split? 

 

From a quick test, I don’t think the UTC offset is causing problems here. ISO8601 format is Klaviyo’s recommended datetime format. 

 

A few thoughts: 

  1. From your code snippet, it looks like your `expiry_date` field is nested below the Coupon field. I wanted to share a quick reminder that nested fields are not accessible in segments and flow splits / trigger filters: https://community.klaviyo.com/analytics-72/top-level-vs-nested-data-what-you-can-and-can-t-use-in-klaviyo-segments-and-flows-16874 
  2. Klaviyo doesn’t seem to support filtering by top-level date fields in segments in a way that recognizes it as a date. The date operators (before, less than, between, etc.) are not supported for these “What someone has done” sub-filters. 

Depending on what you’re trying to do here, you might want to do one or more of the following: 

  •  Move this date to be a top-level field on the event properties.
  • Use a profile property instead. These have more expansive filtering capabilities in segments. 
  • Create an event modeling Product 

Happy to share more specific advice once I know what you’re trying to do!

 

Cadence / Book a demo

 

3 replies

whereisjad
Expert Problem Solver IV
Forum|alt.badge.img+17
  • Expert Problem Solver IV
  • December 19, 2025

@shahidIqbal have you tried sending it without +00:00?  just convert the datetime to the Klaviyo’s account’s timezone and abide by that instead of trying to pass the timezone suffix.


Byrne C
Community Manager
Forum|alt.badge.img+28
  • Community Manager
  • December 22, 2025

Hi ​@shahidIqbal,

Let us know if you tried Jad’s solution, and if that worked! Happy to look into this more with you if needed!


cadence
Expert Problem Solver III
Forum|alt.badge.img+12
  • Expert Problem Solver III
  • Answer
  • December 23, 2025

Hey ​@shahidIqbal, what exactly are you trying to do with this expiry_date property? Are you trying to use it in a segment? As part of a flow trigger filter or conditional split? 

 

From a quick test, I don’t think the UTC offset is causing problems here. ISO8601 format is Klaviyo’s recommended datetime format. 

 

A few thoughts: 

  1. From your code snippet, it looks like your `expiry_date` field is nested below the Coupon field. I wanted to share a quick reminder that nested fields are not accessible in segments and flow splits / trigger filters: https://community.klaviyo.com/analytics-72/top-level-vs-nested-data-what-you-can-and-can-t-use-in-klaviyo-segments-and-flows-16874 
  2. Klaviyo doesn’t seem to support filtering by top-level date fields in segments in a way that recognizes it as a date. The date operators (before, less than, between, etc.) are not supported for these “What someone has done” sub-filters. 

Depending on what you’re trying to do here, you might want to do one or more of the following: 

  •  Move this date to be a top-level field on the event properties.
  • Use a profile property instead. These have more expansive filtering capabilities in segments. 
  • Create an event modeling Product 

Happy to share more specific advice once I know what you’re trying to do!

 

Cadence / Book a demo