Credits Remaining API Call
I would like the ability to query "credits remaining" on my account. It's available for parent accounts to call on their subusers, but not for Lite or RackSpace Bronze accounts to query on themselves.
-
As a workaround, you can use the Web API Statistics Call:
https://sendgrid.com/api/stats.get.xm...
Using the first of the current month of course. You get the "requests" value, and subtract it from the total allotment for your package. This number is your credits remaining. -
-
Hi Jacob,
Unfortunately the api fails in one specific scenario.
Background
- We are based in the UK and we are 8 hours or more ahead of you.
- Our customers are very conscious about their costs. Therefore they want to keep within their monthly credit limit.
- Our customers send out their monthly emails at the start of the month normally at 8am UK time.
Scenario
8am on the first of the month the customer sends out their monthly emails. Before I allow them to send the emails I check to see if they have enough credits. So:
I run the API call to tell me the number of credits our customer has used. As it is the first of the month the number of credits used will be zero. Therefore the customer has 40,000 credits and the emails are sent out.
The problem
At 8am UK time you may not have reset our monthly credits to 40,000 see http://community.sendgrid.com/sendgri... for more details. Therefore 40,000 emails have gone out which the customer will then get charged an additional $40. We then have a very unhappy customer.
Hopefully you will see the problem.
The only accurate way of seeing the number of available credits is by logging into the sendgrid administration screens. However our customers do not have access to them.
Can you please:
- Ask your developers to think again.
or
- Provide me a solution for this problem.
Many thanks -
-
I've talked to our Billing developers and have confirmed how this works:
The Dashboard view takes a little while to roll over, because it queries our billing system for the package for the upcoming month, and runs as a cronjob through all of our accounts.
However, credit usage is based on when our system received the request. So long as the request is received after 00:00:01 Central Time, it will count towards the new day & month's credits.
TL;DR: Don't worry about that fact that the dashboard is reflecting other information, the credit allotment is based on the statistics of the "processed", and the day rolls over in Central Time. -
-
Hi Jacob,
As the credits no longer seem to roll over on the 1st of each month (see http://community.sendgrid.com/sendgri...) can we have an api call to tell us how many credits we have left?
Many thanks -
-
We're working on the API call. Credits do reset at 00:00:01 PT on the 1st of each month, provided you're a direct SendGrid customer. Our reseller clients have the option to change that method.
-
-
This is in our system as US987, though I do not currently have an ETA. As soon as I do, I'll update!
-
Loading Profile...



Twitter,
Facebook, or email.
EMPLOYEE

