# Get Single Pocket Earnings

This endpoint returns pocket earnings for a single pocket for a specified datetime period.

- Optionally pre-defined ranges are defined as such:

  - ytd (Year-to-date) From January 1st of the current year
  - mtd (Month-to-date) From the 1st calendar day of the current month, or start of business that month
  - wtd (Week-to-date) From the most recent Monday, or start of business that week.
  - all-time (default) From Account start
  - All through to the current day if buisness day, or last buisness day.

When range is chosen, you need to specify date_from and date_to (inclusive).

Endpoint: GET /api/v2/pockets/{pocket_id}/earnings/
Version: Version: 2edadba5
Security: CodeBearer

## Path parameters:

  - `pocket_id` (string, required)

## Query parameters:

  - `period` (string)
    The period to fetch earnings for. Can be one of

 * ytd (Year-to-date)
 * mtd (Month-to-date)
 * wtd (Week-to-date)
 * all-time
 * range

When 'range' is chosen, you need to specify 'date_from' and 'date_to' (inclusive).
    Enum: "ytd", "mtd", "wtd", "all-time", "range"

  - `date_from` (any)

  - `date_to` (any)

## Response 200 fields (application/json):

  - `earnings` (object, required)

  - `earnings.value` (integer, required)
    USD values are always in cents.

  - `earnings.currency` (string, required)

  - `earnings.formatted` (string)

  - `date_from` (any, required)

  - `date_to` (string, required)

  - `pricing_timestamp` (any)

  - `appreciation_per_second` (any)

## Response 422 fields (application/json):

  - `detail` (array)

  - `detail.loc` (array, required)

  - `detail.msg` (string, required)

  - `detail.type` (string, required)

  - `detail.input` (any)

  - `detail.ctx` (object)


