Campaign currency is not available using v2 API

As the title says, I can’t find a way to get a campaign’s currency code using the v2 API. It seems to be missing entirely. Am I missing something?

The campaign’s currency code is available via the v1 API as part of the campaign resource (campaign.attributes.currency). Currently this would require us to call both the v2 API and the v1 API in order to get all of the information we need for a given creator’s campaign. I work on a platform that provides integrations for multiple creators, so I can’t safely assume the campaign’s currency.

I would kindly request that the campaign currency code gets added to the Campaign resource in the v2 API.


1 Like

Currency codes are provided for pledges and not campaigns. Yeah, currently you cant get the currency code of a campaign from the api. Why do you need it?

We want to give the creator the ability to set a minimum lifetime contribution for unlocking a given piece of content for a given user. That works fine, but we can’t accurately show what the currency units are on the UI for either the creator or the user without knowing what the currency is.

The currency of the user’s pledge is irrelevant (or misleading), because the threshold total and the amount of their lifetime contribution both need to use the campaign’s currency.

campaign_lifetime_support_cents is in campaign currency and it shows the total historic pledge from the patron to the creator in the campaign’s currency. You could use that.

Also currently_entitled_amount_cents in a user’s info is also in the campaign currency.

Yes, those values accurately tell us whether a given user qualifies to unlock a given piece of content.

I’m looking for a way to show the user on the UI what the currency itself is. “You need to have contributed [$]X to unlock, and you have contributed [$]Y” - what is [$]? Is it USD, CAD, GBP, EUR, etc…? Making any assumption will be misleading to some creators and users, because the creators do not all use the same campaign currencies (nor should they have to).

Well, you can get the currency code of a given pledge by checking out the currency code of the pledge event.

Its more roundabout. But its more reliable. Since the patrons can change their currency at times.

Currency on a pledge is unusable if we’re catering to creators, since they wouldn’t have a pledge to their own campaigns, so we couldn’t show which currency they use in their own UI, we’d only be able to get it (in a roundabout way like you said) for their users, though that value would still be wrong (see below).

The currency on a pledge will be in the patron’s currency, not in the campaign’s currency. I’ve also tested this on my own account, and as a creator, my currency is USD, but as a patron, my currency is CAD, therefore my pledge to a creator is in CAD, and that creator’s own campaign currency was GBP. I also checked the campaign_lifetime_support_cents value and it was indeed the lifetime support I’ve given in the creator’s currency (GBP, not my pledge currency of CAD).

You can see that in the Pledge documentation itself, that the currency is in the Patron’s own currency (in the currency in which the patron paid), not the campaign’s.

The API docs clearly say “in the campaign’s currency” for the lifetime contribution, and yet, it’s an information that is not available anywhere:

Also, campaigns do have a currency, as a creator, I can’t change my currency on a per-tier level, and they all use my campaign’s currency:

You can also clearly see the currency field is provided for the type Campaign when using the API v1.

But trying to specify the field on a v2 API call gives an error:

Also note how campaign_currency is also a field provided on the Member object on API v1, but is missing in API v2

In conclusion, a Campaign does have a currency field and a Member does have a campaign_currency field, both being available in API v1, but both missing on API v2. Adding the ability to get that information via the available fields of v2 would fix the problem.

Finally, though we don’t need this for our own integration, for your information, a User object also has a patron_currency field which is also missing from the API v2 but was there in API v1.

I hope this helps you better understand the situation and provide us with a fix.
Thank you.

Hi @codebard, it’s been a month since your last comment. I’d like to bump this thread and ask if you have any further information or solutions since my last reply with the additional info I provided about the missing fields in API v2.

I agree! As someone who builds for Patreon creators, not having campaign currency in v2 doesn’t make sense. Would love to see it added!

My hack for this currently:

  1. Look at pledge events (pledge history) for a campaign because these have an associated currency.
  2. If the pledge value of the pledge event matches the reported pledge value for the member associated with the campaign, this means that the currency of the pledge and the currency of the campaign are the same. You’ll find that if there’s discrepancy for the pledge value between the pledge event and the member, the currency for the patron and the campaign are different.

Hope this helps.

Thanks for the trick, that’s smart! Right now, I’m using the v1 API just to get the currency of the campaign, but it doesn’t always work (i.e: if you are a member of a campaign but you canceled so you don’t have a pledge), so I think I’ll use your trick to get the currency of the creator themselves directly then store that in my DB and use that for when I check patron’s pledges.
Still hoping that Patreon would add that field (which clearly does exist) to the list of supported fields so we don’t have to jump through hoops and write unnecessarily complex and inefficient code.