GET /api/v2/server-side-api/vc/balances/

List virtual currency balances

Returns the current balance of every virtual currency for a profile. If the app has no virtual currencies, data is an empty array.

Header parameters

adapty-customer-user-idstring

The unique ID of the customer in your system. Either adapty-customer-user-id or adapty-profile-id is required.

adapty-profile-idstring

The unique ID of the profile in your system. Your best option if you are working with anonymous profiles. Either adapty-customer-user-id or adapty-profile-id is required.

Responses

Balances returned successfully

Schema

Current balances for all virtual currencies of a profile.

response_created_atintegerrequired

When the response was generated, as a Unix timestamp in milliseconds.

dataarray of objectrequired
codestringrequired

Unique virtual currency code within the app. ASCII letters, digits, and underscore.

namestringrequired

Display name of the virtual currency.

balanceintegerrequired

Total balance, including amounts currently held.

heldintegerrequired

Sum of all active holds (reserved amounts). Currently always 0.

availableintegerrequired

Balance available to spend, computed as balance - held.

Example
{
  "response_created_at": 1779791400000,
  "data": [
    {
      "code": "COINS",
      "name": "Gold Coins",
      "balance": 12450,
      "held": 0,
      "available": 12450
    },
    {
      "code": "GEMS",
      "name": "Gems",
      "balance": 3280,
      "held": 0,
      "available": 3280
    },
    {
      "code": "ENERGY",
      "name": "Energy",
      "balance": 840,
      "held": 0,
      "available": 840
    }
  ]
}

Bad request.

Schema
errorsarray of objectrequired
sourcestring

Source of the error

errorsarray of string

Array of error messages

error_codestringrequired

Short error name

status_codeintegerrequired

HTTP status code

Unauthorized. The API key is missing or invalid.

Schema
errorsarray of objectrequired
sourcestring

Source of the error

errorsarray of string

Array of error messages

error_codestringrequired

Short error name

status_codeintegerrequired

HTTP status code

Forbidden. The Server API for virtual currencies is not enabled for this app.

Schema
errorsarray of objectrequired
sourcestring

Source of the error

errorsarray of string

Array of error messages

error_codestringrequired

Short error name

status_codeintegerrequired

HTTP status code

Profile not found.

Schema
errorsarray of objectrequired
sourcestring

Source of the error

errorsarray of string

Array of error messages

error_codestringrequired

Short error name

status_codeintegerrequired

HTTP status code

Internal server error