# AccountService

> Identity, balance, positions, the public profile and terms.

Source: https://docs.stxapp.io/sdks/go/reference/account/

## AccountService

```go
type AccountService struct {
	// contains filtered or unexported fields
}
```

AccountService covers identity, balance, positions, the public profile and terms acceptance. Use it through [Client.Account](/sdks/go/reference/client/#client).

### AcceptTerms

```go
func (s *AccountService) AcceptTerms(ctx context.Context, deviceID string, opts *AcceptTermsOptions) (string, error)
```

AcceptTerms accepts the current terms for your own account (`POST /api/v1/tnc/accept`) and returns the server's message. An app cannot accept terms for a member: with a member's OAuth token the exchange answers 403, and the member accepts on an STX page instead.

### Balance

```go
func (s *AccountService) Balance(ctx context.Context) (*Balance, error)
```

Balance returns the balance, liabilities and fee schedule (`GET /api/v1/account/balance`), the same object the balances channel pushes.

### Me

```go
func (s *AccountService) Me(ctx context.Context) (*Me, error)
```

Me returns who this key belongs to (`GET /api/v1/me`): the user id the account channels are keyed by, the account id, and the key's scope ("read\_only" or "read\_write").

### Positions

```go
func (s *AccountService) Positions(ctx context.Context, q *PositionsQuery) ([]Position, error)
```

Positions returns your open positions (`GET /api/v1/positions`), the same objects the positions channel sends on join. Position is positive when long, negative when short.

### UpdateProfile

```go
func (s *AccountService) UpdateProfile(ctx context.Context, update ProfileUpdate) (*Me, error)
```

UpdateProfile changes your public handle, avatar or leaderboard opt-in (`PATCH /api/v1/me/profile`) and returns the updated identity. Where the exchange has no leaderboard it returns an error matching [ErrNotAvailable](/sdks/go/reference/errors/#constants-and-variables).

### UserID

```go
func (s *AccountService) UserID(ctx context.Context) (string, error)
```

UserID returns the user id from [AccountService.Me](/sdks/go/reference/account/#me), fetched once and cached. When Me is forbidden for this credential, the id comes from [AccountService.Balance](/sdks/go/reference/account/#balance), which carries the same user id.
