# Campaign currency is not available using v2 API

**URL:** <https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219>\
**Category:** API Feedback\
**Created:** [March 23, 2023, 1:52pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219 "2023-03-23T13:52:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eranziel](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@Eranziel](https://www.patreondevelopers.com/u/Eranziel)\
**Post date:** [March 23, 2023, 1:52pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/1 "2023-03-23T13:52:34Z")

</div>

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.

Thanks!

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 23, 2023, 4:53pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/2 "2023-03-23T16:53:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Eranziel](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@Eranziel](https://www.patreondevelopers.com/u/Eranziel)\
**Post date:** [March 23, 2023, 7:29pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/3 "2023-03-23T19:29:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 24, 2023, 7:35pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/4 "2023-03-24T19:35:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Eranziel](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@Eranziel](https://www.patreondevelopers.com/u/Eranziel)\
**Post date:** [March 24, 2023, 10:40pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/5 "2023-03-24T22:40:00Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 27, 2023, 5:34pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/6 "2023-03-27T17:34:01Z")

</div>

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

[https://docs.patreon.com/#pledge-event](https://docs.patreon.com/#pledge-event)

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

---

<div class="post-metadata">

**Author:** ![kakaroto](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/kakaroto/32/2292_2.png) [@kakaroto](https://www.patreondevelopers.com/u/kakaroto)\
**Post date:** [March 29, 2023, 1:36pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/8 "2023-03-29T13:36:44Z")

</div>

> [@codebard](#):
>
> Well, you can get the currency code of a given pledge by checking out the currency code of the pledge event.

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.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/9/9c56e178a827127177d4a367bf37ac3c49349dbf.png)

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:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/e/e0484cd9727ae7dedfce586bb1a664c296bfabf4.png)

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:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/c/c616d72369812e6c75e44f803c610487abfcdc23.png)

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

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/c/c83780e5a6191f4025e9e06be64d0566c13fd954.png)

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

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/a/aa3b93efa4542893dc2dafd74e99f073139645f1.png)

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

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/e/e6a0f2ea0b1106cdc92ef861e670534bcb843b53.png)

**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.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/e/e2cea4493bb3fbd874d12570b0defcf0890058f3.png)

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

---

<div class="post-metadata">

**Author:** ![kakaroto](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/kakaroto/32/2292_2.png) [@kakaroto](https://www.patreondevelopers.com/u/kakaroto)\
**Post date:** [April 26, 2023, 12:15am UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/9 "2023-04-26T00:15:58Z")

</div>

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.  
Thanks.

---

<div class="post-metadata">

**Author:** ![nomes](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/nomes/32/67_2.png) [@nomes](https://www.patreondevelopers.com/u/nomes)\
**Post date:** [May 10, 2023, 8:20pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/10 "2023-05-10T20:20:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![nomes](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/nomes/32/67_2.png) [@nomes](https://www.patreondevelopers.com/u/nomes)\
**Post date:** [May 10, 2023, 9:14pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/11 "2023-05-10T21:14:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kakaroto](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/kakaroto/32/2292_2.png) [@kakaroto](https://www.patreondevelopers.com/u/kakaroto)\
**Post date:** [May 12, 2023, 8:09pm UTC](https://www.patreondevelopers.com/t/campaign-currency-is-not-available-using-v2-api/7219/12 "2023-05-12T20:09:37Z")

</div>

> [@nomes](#):
>
> My hack for this currently:

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.  
Thanks!
