Skip to main content

API Reference

Last updated on April 19th, 2024

Supported Operations

The two root types of a GraphQL schema are the Query type and the Mutation type. These types define the entry points for retrieving and modifying data, respectively. The fields under these types define the capabilities of our GraphQL API.

Schema-Defined Types

All types in our GraphQL schema fall into one of the following categories:

Directives

Directives are used to modify the behavior of the GraphQL schema. They are used to annotate fields, fragments, and operations.

GraphQL Schema (SDL)

Download the schema at https://developer.firstdollar.com/oauth.schema.graphql

schema.graphql
"""Controls the rate of traffic."""
directive @rateLimit(
"""Number of seconds before limit is reset."""
duration: Int! = 60

"""Number of occurrences allowed over duration."""
limit: Int! = 60
) on FIELD_DEFINITION | OBJECT

"""Represents an account on a user's health wallet."""
type Account {
"""Whether or not the account is considered active."""
active: Boolean!

"""The user's available balance, which factors in pending withdrawals."""
availableBalance: Money!

"""The user's current balance, which factors in pending deposits."""
currentBalance: Money!

"""
The datetime at which this benefit account will end. If null, the account has no end date.
"""
endDateTime: DateTime

"""The name of the account."""
name: String!

"""The account's type."""
type: AccountType!
}

"""The type of an account in a user's health wallet."""
enum AccountType {
COMMUTER
DCFSA
DIRECTED_SPEND
FSA
HRA
HSA
LPFSA
LSA
REMOTE_WORK
REWARDS
}

"""
A field whose value is a Currency: https://en.wikipedia.org/wiki/ISO_4217.
"""
scalar Currency

"""
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.
"""
scalar DateTime

"""
A field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.
"""
scalar EmailAddress

"""Represents a monetary value."""
type Money {
"""
The amount of money in the smallest denomination of the target currency. In `USD`, for example, this represents cents.
"""
amount: Int!

"""
The ISO-4217 currency associated with this money (currently, only USD is supported)
"""
currency: Currency!

"""The amount and currency formatted for display e.g. $10.00"""
display(
"""The format to use for display."""
format: MoneyDisplayFormat = STANDARD
): String!
}

enum MoneyDisplayFormat {
ACCOUNTING
STANDARD
}

"""Represents a person's name."""
type PersonName {
"""The person's first name."""
firstName: String!

"""The person's last name."""
lastName: String!

"""The person's middle name."""
middleName: String
}

"""
Describes the street address belonging to an individual or corporation.
"""
type PhysicalAddress {
"""The first line of the address."""
addressLine1: String!

"""The second line of the address."""
addressLine2: String

"""The city in which the address is located."""
city: String!

"""The country in which the address is located."""
country: String

"""The state in which the address is located."""
state: String!

"""The postal ("zip") code of the address."""
zip: String!
}

"""Queries are used to retrieve data from the API."""
type Query {
"""A simple ping query to test the API."""
ping: String

"""Retrieve information about the authenticated user."""
user: User
}

"""Represents a First Dollar user."""
type User {
"""The user's primary address."""
address: PhysicalAddress

"""The user's primary email address."""
email: EmailAddress!

"""The user's unique identifier."""
id: ID!

"""The address to which mail should be sent."""
mailingAddress: PhysicalAddress

"""The user's name."""
name: PersonName!

"""The user's health wallet."""
wallet: Wallet!
}

"""Represents a First Dollar user's wallet."""
type Wallet {
"""The user's health wallet accounts."""
accounts(
"""The types of accounts to return."""
types: [AccountType!] = [COMMUTER, DCFSA, DIRECTED_SPEND, FSA, HRA, HSA, LPFSA, LSA, REMOTE_WORK, REWARDS]
): [Account!]!
}