# PoweredBy API - Fund Features 2.2.2

API to provide Greenlight money movement features to PoweredBy commercial partners.

## Changelog

### v2.2.2
- Added separation between default and custom allocation account types in `FinancialInstrumentType` enum
  - added GENERAL_SPENDING default type
  - added GENERAL_SAVINGS default type
  - added GENERAL_GIVING default type

### v2.2.1
- Added id attribute to `FundingRule` object

### v2.2.0
- Refactor funding rules endpoints to align with latest design requirements
  - Changed resource path of funding rule endpoints to reflect rule as a sub-resource of a user
    - `/fund/rules` becomes `/fund/users/{userId}/rules`
  - Changed resource path of funding account endpoint to align with pattern used for funding rules
    - `/fund/accounts` becomes `/fund/users/{userId}/accounts`

### v2.1.0
- Align implementation with other product offerings to cancel and recreate vs edit a funding request
  - Removed the `editFundingRequest` operation
  - Changed the `approveFundingRequest` operation to not allow edits at time of approval 

### v2.0.2
- Changed the defaulted source/destination account for deposit, withdraw, receive payment, and send payment operations
  - Replaced separate versions of `ExternalParty::[Deposit | Withdraw | Payment]` with `ExternalParty::Processor`
  - This should only change the documentation related to the endpoints, not functionality of the endpoints

### v2.0.1
- Cleanup of deprecated endpoints after decision to use separate funding operations

### v2.0.0
- Upgrade to OpenAPI 3.0.0
- Added list funding requests operation as a GET method
- Deprecated search funding requests operation as a POST method
- Changed `getFundingAccounts` operation to `listFundingAccounts`
- Added `PaymentType` enumeration for valid payment types
- Added new payment attributes to the `FundingRequestMoveInput` entity
    - `paymentType` references new PaymentType enumeration
    - `paymentMetadata` provides additional attributes to describe a payment
- Changed `LedgerAccount` entity to `FinancialAccount`
- Added the `FinancialAccountTypes` enumeration with new account type definitions
- Added the `FincialInstrument` and `FinancialInstrumentTypes` entities
- Added the `listFinancialInstruments` operation
- Added specific RFP webhook definition
- Defined RFP reason enumerations
- Updated OAS version to v3.1.0 to support webhook definition
- Changed the `editFundingRequest` operation to be a PATCH vs PUT endpoint to match style guidelines
- Added a `cancelFundingRequest` operation to be consistent with other custom operations
- Deprecated `deleteFundingRequest` operation, use `cancelFundingRequest` instead
- Changed custom funding request operation endpoints from PUT to POST operations to follow style guidelines
- Deprecated `requestForPaymentCallback` operation and replaced with `authorizeFundingRequest` operation
- Added endpoints to view and manage funding rules
- Added a `declineFundingRequest` operation to allow a payment processor explicitly decline an RFP

## Deprecation Log

- N/A

## 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

### FundingAccounts

- [GET /fund/users/{id}/accounts](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/listFundingAccounts): List Funding Accounts

### FundingOperations

- [POST /fund/deposit-funds](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/depositFunds): Deposit Funds
- [POST /fund/receive-payment](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/receivePayment): Receive Payment
- [POST /fund/send-payment](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/sendPayment): Send Payment
- [POST /fund/transfer-funds](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/transferFunds): Transfer Funds
- [POST /fund/withdraw-funds](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/withdrawFunds): Withdraw Funds

### FundingRequests

- [GET /fund/requests](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/listFundingRequests): List Funding Requests
- [GET /fund/requests/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/getFundingRequest): View Funding Request
- [POST /fund/requests/{id}/approve](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/approveFundingRequest): Approve Funding Request
- [POST /fund/requests/{id}/cancel](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/cancelFundingRequest): Cancel Funding Request
- [POST /fund/requests/{id}/reject](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/rejectFundingRequest): Reject Funding Request

### FundingRules

- [GET /fund/users/{id}/rules](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/listFundingRules): List Funding Rules
- [POST /fund/users/{id}/rules](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/createFundingRule): Create Funding Rule
- [GET /fund/users/{userId}/rules/{ruleId}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/getFundingRule): Get Funding Rule
- [PUT /fund/users/{userId}/rules/{ruleId}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/editFundingRule): Edit Funding Rule
- [DELETE /fund/users/{userId}/rules/{ruleId}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/deleteFundingRule): Delete Funding Rule

### RFP

- [POST /fund/requests/{id}/authorize](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/authorizeFundingRequest): Authorize Request for Payment
- [POST /fund/requests/{id}/decline](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/operations/declineFundingRequest): Decline Request for Payment

## Schemas

- [Allocation](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/Allocation)
- [Amount](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/Amount)
- [BaseExceptionResponse](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/BaseExceptionResponse)
- [BasePageResponse](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/BasePageResponse)
- [Comment](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/Comment)
- [FinancialInstrument](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FinancialInstrument)
- [FinancialInstrumentType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FinancialInstrumentType)
- [FundingAccount](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingAccount)
- [FundingAccountType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingAccountType)
- [FundingCategoryType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingCategoryType)
- [FundingMetadata](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingMetadata)
- [FundingRequest](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingRequest)
- [FundingRequestState](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingRequestState)
- [FundingRequestType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingRequestType)
- [FundingRule](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingRule)
- [FundingRuleInput](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Fund%20Features%20API.json/schemas/FundingRuleInput)

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