# viewer

Query · GraphQL API

The currently authenticated viewer.

## Authentication

- SERVER

## Input

This operation has no inputs.

## Returns [Viewer](/braintree/graphql/reference/types/viewer)

Details about the user and merchant authenticated in this request.

### Returned fields

- `id` (`ID`) — deprecated since 2019-05-29: Unique identifier.
- `email` (`String`) — deprecated since 2019-05-29: Email address.
- `status` (`UserStatus`) — deprecated since 2019-05-29: Current status.
- `name` (`String`) — deprecated since 2019-05-29: Full name.
- `roles` (`[Role!]`) — deprecated since 2019-05-29: Associated roles.
- `user` (`User`): Details about the authenticated user.
- `merchant` (`Merchant`): Details about the authenticated merchant.
- `rights` (`[Right!]`): Associated rights based on authentication.

## Examples

### Viewer

The currently authenticated viewer.

```graphql
query viewer($merchantAccountsInput: MerchantAccountSearchInput, $merchantAccountsFirst: Int, $merchantAccountsAfter: String)  {
  viewer {
    user {
      id
      email
      status
      name
      roles {
        id
        name
        isAccountAdmin
        rights {
          name
        }
      }
    }
    merchant {
      id
      status
      companyName
      website
      timezone
      countryName
      merchantAccounts(
        input: $merchantAccountsInput
        first: $merchantAccountsFirst
        after: $merchantAccountsAfter
      ) {
        edges {
          cursor
          node {
            id
            currencyCode
            dbaName
            externalId
            status
            isDefault
            paypalAccount {
              __typename
              billingAgreementId
              billingAddress {
                company
                addressLine1
                addressLine2
                fullName
                adminArea2
                adminArea1
                postalCode
                countryCode
                phone {
                  countryPhoneCode
                  phoneNumber
                  extensionNumber
                }
              }
              shippingAddress {
                company
                addressLine1
                addressLine2
                fullName
                adminArea2
                adminArea1
                postalCode
                countryCode
                phone {
                  countryPhoneCode
                  phoneNumber
                  extensionNumber
                }
              }
              email
              phone
              payerId
              firstName
              lastName
              cobrandedCardLabel
              origin {
                type
                details {
                  __typename
                  ... on ApplePayOriginDetails {
                    __typename
                    paymentInstrumentName
                    bin
                    merchantTokenIdentifier
                    dpanLastTwo
                    isDeviceToken
                    last4
                    paymentAccountReference
                  }
                  ... on GooglePayOriginDetails {
                    __typename
                    googleTransactionId
                    bin
                    last4
                    paymentAccountReference
                  }
                  ... on MasterpassOriginDetails {
                    __typename
                    bin
                  }
                  ... on MetaCheckoutOriginDetails {
                    __typename
                    containerId
                    bin
                  }
                  ... on NetworkTokenOriginDetails {
                    __typename
                    bin
                  }
                  ... on SamsungPayOriginDetails {
                    __typename
                    bin
                  }
                  ... on VisaCheckoutOriginDetails {
                    __typename
                    callId
                    bin
                  }
                  ... on PayPalLocalPaymentOriginDetails {
                    __typename
                    captureId
                    customField
                    paymentId
                    transactionFee {
                      value
                      currencyCode
                    }
                    blikAliases {
                      key
                      label
                    }
                  }
                  ... on CardPresentOriginDetails {
                    __typename
                    authorizationMode
                    pinVerified
                    inputMode
                    terminalId
                    readerId
                    storeId
                  }
                  ... on EmvCardOriginDetails {
                    __typename
                    authorizationMode
                    pinVerified
                    inputMode
                    terminalId
                    applicationPreferredName
                    applicationIdentifier
                    terminalVerificationResult
                    cardSequenceNumber
                    applicationInterchangeProfile
                    terminalTransactionDate
                    terminalTransactionType
                    cashbackAmount
                    applicationUsageControl
                    terminalCountryCode
                    applicationCryptogram
                    cryptogramInformationData
                    cardholderVerificationMethodResults
                    applicationTransactionCounter
                    unpredictableNumber
                    issuerActionCodeDefault
                    issuerActionCodeDenial
                    issuerActionCodeOnline
                    readerId
                    storeId
                  }
                }
              }
              limitedUseOrderId
              selectedFinancingOption {
                term
                monthlyPayment {
                  value
                  currencyCode
                }
                discountPercentage
                discountAmount {
                  value
                  currencyCode
                }
              }
              fundingSourceDescription
              vaultedBillingAgreementId
            }
            hyperwalletAccount {
              userId
            }
            venmoAccount {
              __typename
              username
              venmoUserId
            }
            threeDSecure {
              v1 {
                supportedCardBrands
              }
              v2 {
                supportedCardBrands
              }
            }
            capabilities {
              supportsPublicDescriptors
            }
            accountType
          }
        }
        pageInfo {
          hasNextPage
          hasPreviousPage
          startCursor
          endCursor
        }
      }
    }
    rights {
      name
    }
  }
}
```

---

[View the complete GraphQL schema on GitHub](https://raw.githubusercontent.com/braintree/graphql-api/refs/heads/master/schema.graphql)