Manage virtual currency with API methods
Use the Metaframe API to manage a user’s virtual currency: retrieve balance information, top up the balance, and charge virtual currency from the user’s balance.
To work with the Metaframe API generate JWT.
To generate a token and work with API methods, use the data provided by the integration team:
client_id
— Xsolla account OAuth 2.0 client identifier obtained in authentication setup stepclient_secret
— secret key obtained in authentication setup stepX-HOST-ID
— host ID obtained in basic Metaframe configuration setup step
Implement user balance management using the Metaframe API:
Task | Method |
---|---|
Charges virtual currency from user’s balance using token | Charges virtual currency from user’s balance |
Charges virtual currency from user’s balance using Xsolla Wallet ID | Charges virtual currency from user’s balance by Xsolla account ID |
Get a list of virtual currency packages | Get package list |
Create an order | Create manual purchase |
Retrieve balance information in multiple virtual currencies | Get multi virtual currencies balance |
Top up the user’s balance | Top up user’s multicurrency balance |
In the API methods, shards are used to top up and deduct virtual currency from a user’s balance.
One unit of virtual currency is equivalent to 6 shards, so the amount of virtual currency needs to be multiplied by 6. For example, to top up the balance with 10 units of virtual currency, call the Top up user multicurrency balance method and specify 60
in the shards parameter.
Found a typo or other text error? Select the text and press Ctrl+Enter.