Skip to content
Orillion logo
Soramitsu logo

Retrieving token balance

Retrieves the token balance of the authorized FIB user's peer account at the time of the request.

Protocol: HTTP

EncodingJSON

Endpoint/data/api/v1/wallet-management/balance

MethodGET

Header: Authorization — represented by a string that is the accessToken value that was returned either at the authorization, or the previous time the token has been refreshed.

Input/request structure

A GET request to the endpoint with the Authorization header specified.

Output/response structure

Show
json5
{
  status: {
    code: integer($int32),
    name: 'string'
  },
  data: {
    tokenId: {
      definitionId: 'assetName#assetDomain',
      accountId: 'accountName@accountDomain'
    },
    balance: integer($int64)
  }
}
{
  status: {
    code: integer($int32),
    name: 'string'
  },
  data: {
    tokenId: {
      definitionId: 'assetName#assetDomain',
      accountId: 'accountName@accountDomain'
    },
    balance: integer($int64)
  }
}
json5
{
  status: {
    code: 200,
    name: 'OK'
  },
  data: {
    tokenId: {
      definitionId: 'credit#admin',
      accountId: 'admin@admin'
    },
    balance: 500
  }
}
{
  status: {
    code: 200,
    name: 'OK'
  },
  data: {
    tokenId: {
      definitionId: 'credit#admin',
      accountId: 'admin@admin'
    },
    balance: 500
  }
}

Responses

Response CodeDescription
200Token balance has been retrieved successfully.
401accessToken is either expired or invalid.
403Forbidden (in case a non-admin peer attempts to request the credit balance of another peer).
500Internal server error.