Skip to main content
Solved

Determine revenue currency from API response


Forum|alt.badge.img+2

Hi! I’m using Klaviyo API in my app and stuck with the problem: how can I determine the currency of revenue value from API response? Response body doesn’t contain that.

Best answer by alex.hong

Hello @dokaigra,

The currency needs to be set up a separate property in the event and would need to use a string. For Example: 

{
  “token”:PUBLIC_KEY”,
  “event”:Ordered Product”,
  “customer_properties”: {
    “$email: “test1@klaviyo.com”
  },
  “properties”: {
    “item_name”:Shoes”,
    “$value: 100',
     “currency”: “$”
  }

Traditionally, Klaviyo was built to work on a 1:1 level with ecommerce stores. It was built like this as a way to separate/manage data and keep reporting/analytics as concise as possible. Therefore, if you have stores in multiple countries, we always recommend you create a Klaviyo store per instance. With that being said, you are not able to send ISO code but rather the currency symbol instead.  

 

Thanks,

Alex

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • May 27, 2022

Hi there @dokaigra,

Welcome to the Community.

Question, would the currency returned from your API response not be the same as the default in your account’s setting? Can you provide an example of the call and response that is shown / what is expected behavior? I also recommend looking into our developer portal to find solutions there as well.

 

Thank you,

Alex


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • May 30, 2022

Hi @alex.hong,

Yes, you right, but app doesn’t know about account settings, it’s just working with the Klaviyo API.

Example: /PLACEDORDERMETRIC/export?measurement=value&by=$attributed_message&api_key=APIKEY - app got revenue data, but It doesn’t know anything about currency.

Can there be any ways to find out the currency through api?


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • Answer
  • May 31, 2022

Hello @dokaigra,

The currency needs to be set up a separate property in the event and would need to use a string. For Example: 

{
  “token”:PUBLIC_KEY”,
  “event”:Ordered Product”,
  “customer_properties”: {
    “$email: “test1@klaviyo.com”
  },
  “properties”: {
    “item_name”:Shoes”,
    “$value: 100',
     “currency”: “$”
  }

Traditionally, Klaviyo was built to work on a 1:1 level with ecommerce stores. It was built like this as a way to separate/manage data and keep reporting/analytics as concise as possible. Therefore, if you have stores in multiple countries, we always recommend you create a Klaviyo store per instance. With that being said, you are not able to send ISO code but rather the currency symbol instead.  

 

Thanks,

Alex