PaymentRequiredError making api calls

Thanks for responding @Ethan, just tried my API call again one more time and it worked. Not sure why it wasn’t working earlier.

1 Like

I’ve also got this issue, having transferred my credits (something which should probably be documented in the other guides!) I am still getting the Payment error.

I hope perhaps there is just a delay in noticing that the credits have been applied?

However, it is “costing” me credits every time I make an API call to see if it’s worked yet: I can see the credit count decreasing every time I make a (failed) call - so what’s going on here?

Furthermore, I only want data from my own sensor. Will I be expected to pay for more credits for this at a future point?

Screenshot from 2023-03-28 12-03-34

I am being docked credits for making API calls which fail because I don’t have enough credits?

1 Like

Six or so hours after moving the credits, the API call is now working.

I understand why there might be a delay - but it’s still an issue that I ‘spent’ credits on calls which failed?

In addition, I’d like some clarity on whether I’ll have to pay to get data from my own sensor in the future. This seems deeply opposed to the values and goals of citizen science as I understood PA to promote… (I’d understand paying for collective data - to some extent - but when I’m contributing data for free, I expect some in return).

The link was misspelled previously, which is why it was redirecting incorrectly. I’ve fixed the link, so it will redirect you to the right place now.

We are investigating this issue further to correct any errors that may exist. We are able to replicate this on our end. We will inform everyone of our findings.

More documentation on the develop site can be found in this article: New API Online Dashboard.

Thank you – am also having the same issue.

I’ve read through this page and made sure the steps were followed. I’ve attached the given account points to the project but I am still seeing “PaymentRequiredError”

The worst part about this is these also count and are actually chipping away at the points in my project just to return an error :frowning:

2 Likes

Yea, I’m down 10 credits trying to get data from my new sensor, even though they all respond with ‘you have to pay’ lol.

But, I did do the math… We get 1 million ‘credits’ so if I only wanted to get updates from a single sensor that would be 1 minute updates for like 2 years. For me I get my 5-10 minute updates from a Davis Instruments sensor cluster, so I’ll probably only poll my Purple once every 30-60 minutes which would be like 70-100 years of polling?

So false ‘charges’ during app development don’t really add up much…And at their most expensive rate you get another million for $10

We’ve been able to replicate this issue. It is a delay (around 60 minutes) in the system updating the points balance under the Project. Thus, even though you may see the points added to the Project, they may not yet be visible on the back end.

We’re looking into the source of the delay and hope to have this issue resolved soon. In the meantime, we recommend you wait 60 minutes or so after first adding points to your Project. If you are concerned about the points lost with the error message during this delay period, please send us an email at contact@purpleair.com and provide your API read key.

Be aware, however, that moving forward, API calls will cost points for the designated API endpoint, even when receiving an error message. This is typical of API points systems.

It definitely isn’t a 60 minute delay.

I disabled an automated call on Monday after it still wasn’t working for 3 days. Only the first batch of calls were made before I moved points from the main thing in to the specific project thing.

I’ll reenable it when I get home today to see if it works yet.

Can you email us at contact@purpleair.com with your API read key? We’d like to take a look at this.

This issue has been resolved. A change of point balance should be almost instantly applied. If the delay issue still occurs for anyone, please let us know.

2 Likes

I just found this post, transferred my (remaining) points to my project, and it’s still failing. All the while losing points for trying to get this figured out. The fact that there are indeed points associated to the project, but your API is failing to recognize that should not be considered a 4xx bad request, and should definitely not cost points (which according to the API I don’t have)

Hi Jason, please send an email to contact@purpleair.com with your API read key. We’d like to take a look at this for you.

Thanks Andrew - I will. In the meantime, can you explain why, when there is an error on your end, you are charging users API points? Will PurpleAir acknowledge that this is a bug, and fix it?

At this time, we’re eagerly looking to resolve this issue. We will be reimbursing points lost while we work on this.

Calls made to the API–even if they return an error–still consume API resources. Thus, moving forward after this issue is resolved, API calls will cost points for the designated API endpoint, even when receiving an error message. This is typical of API points systems.

We responded to your email. Please check there for further details about your API key and points.

1 Like

The issue should now be fixed. If anyone has the issue occur again, please let us know. If you see the PaymentRequiredError, make sure that you’ve moved your points from your Organization to your Project.

1 Like

Hi Andrew,
I’m experiencing the same issue.
I have transferred points to my project but my calls to the API are still throwing a payment required error. This is occurring for both my read and write keys; I have tried to get sensor data as well as create a group.
I will send an email to the email address you’ve mentioned, but I also wanted to document this here in case others are still running into issues.

1 Like

Update: I tried again both read and write calls about two days later and have had no issues. Looks like there still may be some lag recognizing the transfer of points, but once it was recognized in the system I have not had any further issues.

2 Likes

This may be the case. A number of changes have been implemented that should have resolved this issue for most users. That said, if any user continues to experience this issue, we’d like to hear about it.