intercom / intercom-dotnet

Intercom API client library for .NET
https://developers.intercom.io/reference
Apache License 2.0
63 stars 53 forks source link

Company monthly_spend is an int instead of decimal #117

Closed xdansmith closed 6 years ago

xdansmith commented 6 years ago

Can monthly_spend be changed back to a decimal so accurate monthly fees can be stored, like 1.95?

DotJoshJohnson commented 6 years ago

The Intercom API only supports integer values in monthly_spend.

xdansmith commented 6 years ago

What is the correct way to map an amount with cents like 1.95 in that case, or is it not possible?

DotJoshJohnson commented 6 years ago

As far as I know, that would have to be stored in a custom attribute:

decimal monthlyFees = 1.95;
company.custom_attributes["monthly_fees"] = monthlyFees;

In the Intercom app, you can then leverage that attribute in pretty much the same way in terms of filtering, qualification, etc.

kmossco commented 6 years ago

Hey @xdansmith, thank you for bringing this up. Not quite sure which is the expected behaviour and this week I am away from any work on the API, but early next week I'll do some testing and ensure we match the type that the API accepts from curl for full feature parity. 👍

kmossco commented 6 years ago

I checked with the team and it seems that we accept Floats:

image

However they will be truncated. I made this change already, would it be possible to get a review? https://github.com/intercom/intercom-dotnet/pull/129