You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The request body for usage events defines a timestamp field that should be Unix Timestamp (ref). This field accepts an integer or a string.
We were erroneously sending a string value in the timestamp field with RFC3339 format (2024-12-10T17:36:46Z).
Somehow this was being parsed to the unix timestamp of 2024 and was being processed with the time of 1970-01-01T00:33:44Z.
This was causing fees to not be created, as we were unaware were processing with an incorrect timestamp and the behavior between the usage event timestamp and customer subscription start dates.
Hello @AnthonyEnr1quez!
Thank you for pointing it out and sorry for the experienced inconveniences, this part might seem really confusing.
For the timestamp - because we accept both, string and integer, when we parse the received value, the way ruby works, when it parses a string into float (because we might receive floats to identify milliseconds), it goes through the string until the first not numeric value. That's why "2024-12-10..." becomes 2024, which is exactly "1970-01-01T00:33:44.000Z" - 2024 seconds after 'beginning of time' for the UNIX systems, so it is still kinda expected behaviour, but you're right, we can add a validation on the format of the received string.
For the inconsistency of the documentation - it is not required, I'll update it
Hello @AnthonyEnr1quez!
Thank you once again for highlighting this issue. We've added a validation of the received timestamp, it will be included in the next release.
The documentation is updated as well, thanks! ;)
Describe the bug
The request body for usage events defines a timestamp field that should be Unix Timestamp (ref). This field accepts an integer or a string.
We were erroneously sending a string value in the timestamp field with RFC3339 format (
2024-12-10T17:36:46Z
).Somehow this was being parsed to the unix timestamp of
2024
and was being processed with the time of1970-01-01T00:33:44Z
.This was causing fees to not be created, as we were unaware were processing with an incorrect timestamp and the behavior between the usage event timestamp and customer subscription start dates.
To Reproduce
Steps to reproduce the behavior:
Example Response
Response Code:
200
Expected behavior
A
400
or422
response stating that the request/timestamp is invalid.Screenshots
Additional context
This issue is happening on both the single and batch usage event endpoints.
There is conflicting documentation around the usage event timestamp field. Some places say its required, while others say it is not.
Version
The text was updated successfully, but these errors were encountered: