Back to News for Developers

Pricing in a User’s Preferred Currency

June 28, 2012ByColin Creitz

To help you improve monetization in your game, we are launching an API that gives you access to the user's preferred currency and the conversion rate to Credits. This lets you show prices in the user's preferred currency in your in-game stores.

For example, a user visits your store to buy an item priced at $10 (100 Credits). You can access the preferred currency — EUR for this user — and the current conversion rate from Credits to EUR via the API described below. Instead of displaying price in USD, you can now show the item price as €8.12 (100 credits * 0.0812 conversion rate). When you invoke the pay dialog, use the parameter "oscif=true", and the user will see €8.12 as the price of the item in the pay dialog as well.

Castleville's in-game store and payment dialog show items priced in EUR, this user's preferred currency.

To access this data, issue an HTTP GET to /USER_ID?fields=currency with a user access token for your app.

    GET https://graph.facebook.com/USER_ID?fields=currency
    &access_token=USER_ACCESS_TOKEN

    RESULT:
    {
    "currency": {
    "user_currency": "EUR", 
    "currency_exchange": 12.31857, 
    "currency_exchange_inverse": 0.0811782536, 
    "currency_offset": 100
    }, 
    "id": "596824621", 
    "type": "user"
    }
  

See our documentation for more details on how to implement this in your app.