# PoweredBy API - Account Features 2.3.2

API to provide Greenlight account management and lifecycle features to partners.

## Changelog

### V2.3.2
- Documented that `pageSize` on `getUserStatement` defaults to 25 when it is not provided
- Corrected the `StatementRecordRequestType` description to list `SPEND_ADJUSTMENT_CREDIT` and `SPEND_ADJUSTMENT_DEBIT`, matching the enum
- Corrected the `getFamily` description to refer to the `id` path parameter

### V2.3.1
- Removed `account` from the required properties of the `closeUser` response; the response is the `User` plus `closureReason`
- Documented the empty JSON object returned on success by `activateUser`, `deactivateUser`, `enableCard` and `disableCard`
- Documented the 401 and 403 responses for `originateParent`, `originateChild` and `originateFamily`
- Documented the 400, 401, 403 and 404 responses for `listFinancialAccounts`, `enableCard` and `disableCard`
- Marked the request body as required for `originateFamily`, `closeUser` and `updateNicknames`

### V2.3.0
- Updated statement endpoint resource path to align with current PoweredBy v2 partner implementation pattern
  - moved from `/account/users/{id}/statement` to `/account/users/{userId}/accounts/{accountId}/statement`
- Added separation between default and custom allocation account types in `FinancialInstrumentType` and `AllocationAccountType` enum
  - added GENERAL_SPENDING default type
  - added GENERAL_SAVINGS default type
  - added GENERAL_GIVING default type

### v2.2.0
- Added `deactivateUser` endpoint to support deactivating an active user as a part of an offboarding workflow
- Added `activateUser` endpoint to allow reactivating a user that was previously deactivated
- Added `User.state` attribute to capture additional states needed for offboarding workflow
- Deprecated the `User.active` attribute in favor of new `state` attribute

### v2.1.1
- Aligned financial instrument and account types to be consistent with other schemas
- Changed `ProgramAccount`, `ModuleAccount`, and `AllocationAccounts` to be more specific to type definitions
- Removed the `ParentAccount` and `ChildAccount` as those schema objects were used
- Removed the `adjustAccountBalance` as it has not been identified as a requirement
- Changed the `getUserStatement` endpoint to support both user and account level filtering

### v2.1.0
- General
  - Changed naming convention for ECI and EAI attributes on origination endpoints
    - Reason: align on consistent naming convention with addition of parent nickname override
    - `originateParent` and `originateFamily` operations
      - body parameter `parentEAI` changed to `externalAccountId`
      - body parameter `parentECI` changed to `externalCustomerId`
    - `originateChild` and `originateFamily` operations
      - body parameter `childEAI` changed to `externalAccountId`
      - body parameter `childECI` changed to `externalCustomerId`
- Card Status
  - Feature: Support the ability to view and manage card status for a child
  - Changes:
    - Added card status to `User` entity
    - Added  `disableCard` and `enableCard` operations
- Nicknames
  - Feature:  Support the ability to override the default nickname of another user from within a user profile
  - Changes:
    - Added `nicknameOverrides` array to `User` entity
    - Updated `originateChild` operation to support parent nickname override    
    - Added `updateNicknames` operation to support updating a default nickname for a user profile or overriding defaul nicknames of other users
    - Removed `updateUser` endpoint (replaced by `updateNicknames` endpoint)

### v2.0.0 
- Baseline from v1.11.6  
- Changed entity structures to introduce user entity
- Changed several endpoint paths to align with latest style guidelines
- Added new endpoints for user resources
- Changed domain module entities from `{Domain}SubAccount` to `{Domain}Module`
- Changed GLUID resoure references to align with entity changes
  - `ExternalFundingAccount` changed to `ExternalAccount` to align with EAI terminology
  - `ExternalUser` changed to `ExternalCustomer` to align with ECI terminology
  - `GreenlightAccount` changed to `ProgramAccount` to represent the top level financial account for a child
  - `Wallet` changed to `ProgramAccount` to represent the top level financial account for a parent
- Added `User` type that does not contain financial information unlike the `UserAccount` type
- Changed `closeAccount` operation to a sub-resource path under a user to align with `adjustAccount` operation
- Simplified schema to align on generic `AllocationAccount` and `ModuleAccount` types
- Changed `familyId` to `familyReference` to more clearly indicate acceptance of GLUID for family identification on origination endpoints

## Terminology
### ECI
External Customer Identifier.  An identifier, provided by GL partners, to uniquely identify parents and children that will participate in the GL platform.  This value should not change during the relationship of the user with the GL platform.

### EAI
External Account Identifier.  An identifier, provided by GL partners, to uniquely identify financial accounts owned by parents and children that will participate in the GL platform.  This value should not change during the relationship of the user with the GL platform.

### GLUID
Greenlight Unique Identifier, is a compound Id that is globally unique in the resource model exposed by the GL APIs. A GLUID is composed of a Resource Entity Type and a Resource Id. GlUIDs are constructed with the following format `{ResourceType}::{ResourceId}`.  

As an example, an External User is a GL resource entity type that relates to an External Customer Id (ECI) resource.  If an external user has an ECI of `abc123-xyz789`, this user can be represented as the GLUID `ExternalCustomer::abc123-xyz789`.

## Types

### DateTime
A DateTime object is represented as a String in the GL resource model.  DateTime strings should be compliant with the date-time format outlined in section 5.6 of the [RFC 3339 profile of the ISO 8601](https://tools.ietf.org/html/rfc3339) standard for representation of dates and times using the Gregorian calendar.  An example of a DateTime string representing a date and time in UTC is `2019-09-03T10:15:30Z`.

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.

### Currency
Money amounts, or currency, is represented in the resource model as a Number (32.74).  The assumption is that this number represents US currency.

### String
Unless otherwise noted against the specific data type in the specification, the maximum length for all String data types is 255 characters.

## Servers

- https://{env}.{partner}.gl-tech.io/api/v2

## Authentication

- `OAuth`: OAuth 2.0

## Operations

### Account

- [GET /account/families/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/getFamily): View Family
- [GET /account/users/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/getUser): View User
- [GET /account/users/{id}/accounts](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/listFinancialAccounts): List Financial Accounts
- [POST /account/users/{id}/activate](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/activateUser): Activate User Account
- [POST /account/users/{id}/deactivate](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/deactivateUser): Deactivate User Account
- [POST /account/users/{id}/disable-card](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/disableCard): Disable Card
- [POST /account/users/{id}/enable-card](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/enableCard): Enable Card
- [POST /account/users/{id}/update-nicknames](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/updateNicknames): Update Nicknames

### Offboarding

- [POST /account/users/{id}/close](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/closeUser): Close User Account

### Onboarding

- [POST /account/originate-child](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/originateChild): Originate Child
- [POST /account/originate-family](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/originateFamily): Originate a Family
- [POST /account/originate-parent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/originateParent): Originate Parent

### Reporting

- [POST /account/users/{userId}/accounts/{accountId}/statement](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/operations/getUserStatement): View User Statement

## Schemas

- [AllocationAccount](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/AllocationAccount)
- [AllocationAccountType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/AllocationAccountType)
- [BaseExceptionResponse](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/BaseExceptionResponse)
- [Family](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/Family)
- [FinancialInstrument](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/FinancialInstrument)
- [FinancialInstrumentType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/FinancialInstrumentType)
- [FundingCategoryType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/FundingCategoryType)
- [LedgerActivity](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/LedgerActivity)
- [ModuleAccount](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/ModuleAccount)
- [ModuleAccountType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/ModuleAccountType)
- [Nicknames](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/Nicknames)
- [ProgramAccount](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/ProgramAccount)
- [ProgramAccountType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/ProgramAccountType)
- [StatementRecord](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/StatementRecord)
- [StatementRecordMetadata](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/StatementRecordMetadata)
- [StatementRecordRequestType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/StatementRecordRequestType)
- [StatementRecordStateType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/StatementRecordStateType)
- [StatementReport](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/StatementReport)
- [User](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Account%20Management%20API.json/schemas/User)

Bundled OpenAPI file: https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/bundle/v2/Account%20Management%20API.json
