0

I am working on a game and need to be able to access the credits balance for a current user. The Facebook credits API documentation referenced this but it seems it has been removed.

Is getBalance still available? How would one implement the getBalance call?

Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
StefanU
  • 13
  • 1
  • 3
  • Interesting, I did some integration against this the other day. I didn't see it mentioned. Could it be Facebook are masking it. I mean, if you think about it from a Facebook perspective why would you need to know. If the user doesn't have enough credits to purchase your in-app item then the flow changes to them buying FB Credits from Facebook. So tbh I wouldn't be surprised it doesn't exist anymore. – James 'Cookie' Cook Dec 05 '11 at 17:11

2 Answers2

1

You can call this:
https://api.facebook.com/method/users.getStandardinfo?uids={USER_UID}&fields=credit_balance&access_token={ACCESS_TOKEN}&format=json

Pay attention:
1. In order to use this method, you should apply your app for using Credits: http://www.facebook.com/help/contact_us.php?id=157379954315015
2. The REST API is being deprecated, but I still haven't found new documentations of how using the Graph API to fetch user's balance... I'm still using this method too.

Roei

Roei
  • 319
  • 4
  • 15
1

I don't believe it's available at this time if it isn't in the graph api which would seem to be the case based on what I've read (or haven't read as there's no mention of it after the credits "promotional period" ended).

I just tried using the users.getStandardInfo method and received this error: The underlying FQL query made by this API call has encountered the following error: credit_balance is not a member of the user table.

Returned by this:

$obj = json_decode(
curl_call_fb(
    'https://api.facebook.com/method/users.getStandardinfo'.
    '?uids='.$user->getFacebookId().
    '&fields=credit_balance'.
    '&access_token='.$access_token.
    '&format=json'
    )
);