Title-Wide Data Management - Add Virtual Currency Types

NOTE: This is a Legacy Economy API, and is in bugfix-only mode. All new Economy features are being developed only for version 2. Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of 2,147,483,647 when granted to a player. Any value over that will be discarded.

POST https://titleId.playfabapi.com/Admin/AddVirtualCurrencyTypes

Request Header

Name Required Type Description
X-SecretKey True

string

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Request Body

Name Required Type Description
VirtualCurrencies True

VirtualCurrencyData[]

List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) to the title

Responses

Name Type Description
200 OK

BlankResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-SecretKey

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Type: apiKey
In: header

Definitions

Name Description
AddVirtualCurrencyTypesRequest

This operation is additive. Any new currencies defined in the array will be added to the set of those available for the title, while any CurrencyCode identifiers matching existing ones in the game will be overwritten with the new values.

ApiErrorWrapper

The basic wrapper around every failed API response

BlankResult
VirtualCurrencyData

AddVirtualCurrencyTypesRequest

This operation is additive. Any new currencies defined in the array will be added to the set of those available for the title, while any CurrencyCode identifiers matching existing ones in the game will be overwritten with the new values.

Name Type Description
VirtualCurrencies

VirtualCurrencyData[]

List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) to the title

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

BlankResult

VirtualCurrencyData

Name Type Description
CurrencyCode

string

unique two-character identifier for this currency type (e.g.: "CC")

DisplayName

string

friendly name to show in the developer portal, reports, etc.

InitialDeposit

number

amount to automatically grant users upon first login to the title

RechargeMax

number

maximum amount to which the currency will recharge (cannot exceed MaxAmount, but can be less)

RechargeRate

number

rate at which the currency automatically be added to over time, in units per day (24 hours)

Error Codes

Name Code
InvalidVirtualCurrencyCode 1236
VirtualCurrencyCodeExists 1230
VirtualCurrencyCountLimitExceeded 1229