# PoweredBy API - Earn Features 2.0.0

API to provide Greenlight Earn features (allowances and chores) to partners.

## Changelog

### v2.0.0
- Baselined at v1.10.6
- Updated resource paths to align with most recent GL style guidelines
- Changed `accountId` parameters to `childReference` to reduce confusion where child GLUIDs are expected
- Changed update operations from `PUT` to `PATCH` methods to match the intent of the operation
- Changed custom operations from `PUT` to `POST` to match GL style guidelines
- Standardized definitions of ledger accounts
- Example cleanup

## 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 `ExternalUser::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.

## Business Rules

### Allowances
The current version of the GL platform only supports one allowance per child.  GL may evolve the platform to support more than one allowance per child in a GL family.  The API specifications was constructed as if multiple allowances were possible, to prevent the need for structural changes in the future, if this product feature is added to the GL platform.  Additionally, the design of using plural resource paths is used consistently in other areas of the Earn API and in other GL APIs.

## Deprecation

* __Funding Request Types__:  The funding request types have evolved over time in v1 of the specification.  In v2, we expect to rebase the valid types to remove types that are no longer used in the application code.

## Servers

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

## Authentication

- `OAuth`: OAuth 2.0

## Operations

### Allowances

- [GET /earn/allowances](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/getAllowances): List Allowance Definitions for a child
- [POST /earn/allowances](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/createAllowance): Create Allowance Definition
- [POST /earn/allowances/history](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/searchAllowanceHistory): View Allowance History
- [GET /earn/allowances/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/getAllowance): View Allowance Definition
- [PATCH /earn/allowances/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/editAllowance): Update Allowance Definition
- [DELETE /earn/allowances/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/deleteAllowance): Delete Allowance Definition
- [POST /earn/allowances/{id}/pause](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/pauseAllowance): Pause Allowance Payments
- [POST /earn/allowances/{id}/resume](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/resumeAllowance): Resume Allowance Payments

### Chores

- [POST /earn/chore-instances](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/searchChoresInstances): Search chore instances for a child
- [POST /earn/chore-instances/{id}/approve](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/approveChoreInstance): Approve Chore Instance
- [POST /earn/chore-instances/{id}/complete](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/completeChoreInstance): Complete Chore Instance
- [POST /earn/chore-instances/{id}/reject](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/rejectChoreInstance): Reject Chore Instance
- [GET /earn/chores](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/getChores): List Chore Definitions for a child
- [POST /earn/chores-instances/summary](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/getSummaryOfChoresInstances): List summary of chore instances for a child
- [POST /earn/chores/instances/{id}/incomplete](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/incompleteChoreInstance): Move Chore Instance to Incomplete
- [GET /earn/chores/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/getChore): View Chore Definition
- [PATCH /earn/chores/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/updateChore): Update Chore Definition
- [DELETE /earn/chores/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/deleteChore): Delete Chore Definition
- [POST /earn/chores/{id}/pause](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/pauseChore): Pause a Chore Schedule
- [POST /earn/chores/{id}/resume](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/resumeChore): Resume a Chore Schedule

### Earn

- [POST /earn/chores](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/createChore): Create Chore Definition
- [POST /earn/statement](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/operations/getEarnStatement): View Earning Statement

## Schemas

- [Allowance](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/Allowance)
- [AllowanceAllocationInput](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowanceAllocationInput)
- [AllowanceAllocationOutput](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowanceAllocationOutput)
- [AllowanceCreateInput](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowanceCreateInput)
- [AllowanceEditInput](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowanceEditInput)
- [AllowanceHistoryPayload](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowanceHistoryPayload)
- [AllowancePayload](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowancePayload)
- [AllowanceTrigger](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/AllowanceTrigger)
- [Chore](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/Chore)
- [ChoreInstance](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoreInstance)
- [ChoreInstancePayload](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoreInstancePayload)
- [ChoreInstancePayout](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoreInstancePayout)
- [ChoreInstanceState](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoreInstanceState)
- [ChorePayload](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChorePayload)
- [ChorePayout](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChorePayout)
- [ChorePayoutInput](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChorePayoutInput)
- [ChoreTrigger](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoreTrigger)
- [ChoreTriggerFrequency](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoreTriggerFrequency)
- [ChoresSummary](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoresSummary)
- [ChoresSummaryState](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ChoresSummaryState)
- [Comment](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/Comment)
- [ExceptionPayload](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/ExceptionPayload)
- [FundingRequestOverview](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/FundingRequestOverview)
- [FundingRequestState](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/FundingRequestState)
- [FundingRequestType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/FundingRequestType)
- [LedgerAccount](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/LedgerAccount)
- [LedgerActivity](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/LedgerActivity)
- [StatementRecord](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/StatementRecord)
- [StatementRequestState](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/StatementRequestState)
- [StatementRequestType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/StatementRequestType)
- [StatementResponse](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/StatementResponse)
- [StatementSearch](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Earn%20Features%20API.json/schemas/StatementSearch)

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