Wallet

This module provides a repository of virtual currency and a set of APIs to credit/debit the currency. This virtual currency can be used by the application in any form it sees fit.

With this module enabled in the application, the user profile is augmented with the wallet structure - and the output of the Get Profile Details API will contain the “wallet” structure.

API: List Wallet

List Wallet API

URL: {BASE_URL}/app/<APP_ID>/wallet/<MODE>/<USER_ID>

Request Method: HTTP GET

Parameter Mandatory Type Description
APP_ID Yes Alpha-numeric The application ID issued by the Playblazer platform when the app was created
secret_key Yes Alpha-numeric The secret key issued by the Playblazer platform when the app was created
MODE Yes String The mode for user ID interpretation
USER_ID Yes String The user ID whose wallet is to be listed.
fmt No String One of (json | xml) - the format of output

The output of the API is very simple containing only status=ok and the wallet structure.

Example

URL Call:

curl "http://api.playblazer.com/v1/app/1/wallet/fb/kunalg?secret_key=cb8d878989b9478e96d1b1574a1bf4ec"

Output:

{
    "status": "ok",
    "wallet": {
        "currency": 570
    }
}

API: Credit Wallet with currency

Credit Wallet with currency API

URL: {BASE_URL}/app/<APP_ID>/wallet/<MODE>/<USER_ID>/credit

Request Method: HTTP POST

Parameter Mandatory Type Description
APP_ID Yes Alpha-numeric The application ID issued by the Playblazer platform when the app was created
secret_key Yes Alpha-numeric The secret key issued by the Playblazer platform when the app was created
MODE Yes String The mode for user ID interpretation
USER_ID Yes String The user ID whose wallet is to be listed.
amount Yes Float The amount to be added/credited to the wallet.
fmt No String One of (json | xml) - the format of output

The output of the API is very simple containing only status=ok and the wallet structure.

Example

URL Call:

curl -X POST \
    -F "secret_key=cb8d878989b9478e96d1b1574a1bf4ec" \
    -F "amount=224.50" \
    "http://api.playblazer.com/v1/app/1/wallet/fb/kunalg/credit"

Output:

{
    "status": "ok",
    "wallet": {
        "currency": 794.5
    }
}

API: Debit currency from Wallet

Debit currency from Wallet API

URL: {BASE_URL}/app/<APP_ID>/wallet/<MODE>/<USER_ID>/debit

Request Method: HTTP POST

Parameter Mandatory Type Description
APP_ID Yes Alpha-numeric The application ID issued by the Playblazer platform when the app was created
secret_key Yes Alpha-numeric The secret key issued by the Playblazer platform when the app was created
MODE Yes String The mode for user ID interpretation
USER_ID Yes String The user ID whose wallet is to be listed.
amount Yes Float The amount to be subtracted/debited from the wallet.
fmt No String One of (json | xml) - the format of output

The output of the API is very simple containing only status=ok and the wallet structure.

Continuing with the example from the Credit Wallet section -

Example

URL Call:

curl -X POST \
    -F "secret_key=cb8d878989b9478e96d1b1574a1bf4ec" \
    -F "amount=99.50" \
    "http://api.playblazer.com/v1/app/1/wallet/fb/kunalg/debit"

Output:

{
    "status": "ok",
    "wallet": {
        "currency": 695.0
    }
}