openapi: 3.0.1
info:
  description: >-
    This is the OpenAPI spec for Xpansiv Connect API. Documentation:
    https://developer.xpansiv.com/developer-portal/
  title: Xpansiv Connect API
  version: 1.0.0-beta
servers:
  - url: https://sandbox.preprod.connect.xpansiv.com/app/api/v1
    description: SANDBOX
  - url: https://uat.preprod.connect.xpansiv.com/app/api/v1
    description: UAT
  - url: https://connect.xpansiv.com/app/api/v1
    description: PROD
tags:
  - name: Account
    description: >
      The Account API allows uses of Xpansiv Connect to pull a list of their
      registry sub-accounts. As related to the  retirement activity, the list
      reflects the retirement sub-accounts which are required when executing
      retirements  in specific registries or when searching retirement history.
      The registries with data to return for this call  are NEPOOL, M_RETS, NAR,
      MIRECS, NCRETS, NYGATS, TIGR, CAR, VCS, ACR, RMS AND TERCS.
  - name: Exchange
    description: >
      The Exchange APIs allow users to take various actions, both read and
      write, for their interactions with  execution venues, such as the CBL
      platform. The Get Accounts API allows the user to pull their active
      accounts,  and the programs associated with those accounts, linked with
      the execution venue.  The Search Deposits API allows the user to search
      the current deposits placed on execution venues.  The Deposit Creation API
      allows the user to place inventory on deposit on a target execution
      venue.  The Deposit Withdraw API allows the user to withdraw and place
      back into inventory deposits held on an execution venue.  The Deposit
      Withdraw and Create Retirements API allows the user to withdraw and retire
      deposits held on an  execution venue.  The Deposit Settlement API call
      would be used to settle executed trades on an execution venue by an
      execution  venue operator.
  - name: Forward Deals
    description: >
      The Forward Deals API allows the user to search The Forward Deals
      associated with their Xpansiv Connect account  and/or other Xpansiv
      Connect accounts that have granted their user that access. Forward Deal
      information is  returned based on a Deal's last updated date. Note that
      this call has a number of optional fields that the users  needs to include
      if desired in the output.
  - name: Issuances
    description: >
      The Issuance API allows the user to pull information on any Issuances
      associated with their account,  or permissioned account, for the various
      registries they are linked with. The Instrument details on the  Issuance
      will be returned in the format of a Carbon Instrument (type CARBON) or a
      REC Instrument (type REC)  as appropriate. Each of the types are returned
      with data specific to the Carbon or REC attributes.
  - name: Portfolio
    description: >
      The Portfolio API allows the user to search their credit inventory (tax
      lot) data on active positions  across all registry accounts linked to
      their Xpansiv Connect account and/or other Xpansiv Connect accounts  that
      have granted their user that access. Note that This call has a number of
      optional fields that the user  needs to include if desired in the output.
  - name: Projects
    description: >
      The Project API allows the user to pull publicly available information
      about carbon projects registered  in the registries that are integrated
      with Xpansiv Connect. Note - this call has a number of optional fields 
      that the user needs to include if desired in the output.
  - name: ReferenceData
    description: >-
      The Reference Data API enables discovering Xpansiv Connect reference data
      types and values.
  - name: Reports
    description: >
      The Reports API allows the user to retrieve a comprehensive credit
      inventory (aka Tax Lot by Program Report)  on all active positions with a
      single call across all registry accounts linked to their Xpansiv Connect
      account  or other Xpansiv Connect accounts that have granted their user
      that access. Note - this call has a number of  optional fields that the
      user needs to include if desired in the output.
  - name: Retirements
    description: >
      The Retirements APIs allow users to take various actions, both read and
      write, for their retirement  activity. The Create Retirements API allows
      users of Xpansiv Connect to retire one or more positions from  their
      linked registry accounts and/or other Xpansiv Connect accounts that have
      granted their API user with  that access. The Get Registry Rules API call
      provides the user with the information required to pass the  correct rule
      attributes specific to each registry with each retirement attempt. The
      Check Retirement Status  API allows users to query the status of their
      retirements. The Search retirements API allows users search their 
      retirement history. Note - this call has a number of optional fields that
      the user needs to include if  desired in the output.
  - name: Split Lots
    description: >
      The Split Lots API allows the user to search split lot data on their
      Xpansiv Connect account and/or other  Xpansiv Connect accounts that have
      granted your user that access.
  - name: Transfers
    description: >
      The Transfers APIs allow users to  take various actions, both read and
      write, for their bilateral transaction  activity. The Search Transfers API
      allows the user to search registry transfer data for their Xpansiv 
      Connect account and/or other Xpansiv Connect accounts that have granted
      your user that access. Note - this  call has a number of optional fields
      that the user needs to include if desired in the output.  The Create
      Transfers API allows the user to create new bilateral transfers. The
      Cancel Transfers API allows  the user to cancel/withdrawal any pending
      outgoing transfers. The Reject Transfers API allows the user to  reject
      any pending incoming transfer. The Accept Transfers API allows the user to
      accept any pending incoming transfer.
security:
  - bearerToken: []
paths:
  /reference-data:
    get:
      tags:
        - ReferenceData
      operationId: getReferenceData
      summary: Retrieve list of reference data
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          code:
                            type: string
                          description:
                            type: string
                          order:
                            type: integer
                            format: int64
                          value:
                            type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /account/{AccountIdentifier}/program/{ProgramCode}/subaccounts:
    get:
      tags:
        - Account
      operationId: getSubAccountsByProgram
      summary: Get sub-accounts
      description: Get sub-accounts for a given account and program
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/ProgramCode'
      responses:
        '200':
          description: List of sub-accounts
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - code
                    - name
                    - subAccountType
                    - active
                    - public
                  properties:
                    code:
                      type: string
                      description: Unique identifier.
                    name:
                      type: string
                      description: Name of the Sub-Account in the registry.
                    subAccountType:
                      type: string
                      enum:
                        - NORMAL
                        - RETIREMENT
                        - RESERVE
                        - COMPLIANCE
                        - RETIREMENT_EDP
                      description: Type of registry sub-account.
                    active:
                      type: boolean
                      description: True/False.
                    public:
                      type: boolean
                      description: True/False.
                    complianceStatus:
                      type: string
                      enum:
                        - ACTIVE
                        - PENDING
                        - RETIRED
                      description: >-
                        Flag for whether sub-account is for compliance
                        retirement activity.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                  message:
                    type: string
                  field:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /account-holders/action/search:
    post:
      operationId: searchAccountHolders
      tags:
        - AccountHolders
      parameters:
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      summary: Account Holders search
      requestBody:
        description: Account Holders search endpoint
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                registryAccountId:
                  type: string
                  description: ID of the account on the registry.
                registryAccountName:
                  type: string
                program:
                  type: string
                  description: Program name. Ref.Data.REGISTRY_PROGRAM_REGI
                accountType:
                  type: string
                  description: Account type description.
                active:
                  type: boolean
                  description: True/False.
                generatorAccount:
                  type: boolean
                  description: True/False.
      responses:
        '200':
          description: Account Holders search successfully executed
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          $ref: '#/components/schemas/AccountHolder'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/accounts:
    parameters:
      - $ref: '#/components/parameters/ExchangeCode'
    get:
      summary: Get accounts
      description: List of accounts subscribed to an exchange
      tags:
        - Exchange
      operationId: getExchangeAccounts
      responses:
        '200':
          description: List of accounts details
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - identifier
                    - exchangeIdentifier
                  properties:
                    identifier:
                      type: string
                      description: The account id.
                      example: 098B0A25
                    exchangeIdentifier:
                      type: string
                      description: Exchange identifier.
                    executionVenueLinks:
                      type: array
                      items:
                        type: object
                        required:
                          - executionVenue
                          - programs
                        properties:
                          executionVenue:
                            type: string
                            description: The execution venue on the target exchange.
                          programs:
                            type: array
                            description: >-
                              The program or programs associated with the
                              execution venue.
                            items:
                              type: string
                    registryLinks:
                      type: array
                      items:
                        type: object
                        required:
                          - program
                          - registryAccountId
                        properties:
                          program:
                            type: string
                            description: >-
                              The registry or program associated with the
                              account.
                          registryAccountId:
                            type: string
                            description: The id for the registry account.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_EXCHANGE
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/accounts/{AccountIdentifier}/action/search-deposits:
    parameters:
      - $ref: '#/components/parameters/ExchangeCode'
      - $ref: '#/components/parameters/AccountIdentifier'
    post:
      summary: Search deposits
      description: Get list of deposits for an exchange
      tags:
        - Exchange
      operationId: searchDeposits
      responses:
        '200':
          description: List of deposits
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - depositIdentifier
                    - executionVenue
                    - taxLot
                    - instrument
                    - quantity
                    - availableQuantity
                    - settledQuantity
                    - status
                  properties:
                    depositIdentifier:
                      type: string
                      description: Unique identifier.
                    executionVenue:
                      type: object
                      required:
                        - code
                        - name
                      properties:
                        code:
                          type: string
                          description: Target execution venue code.
                        name:
                          type: string
                          description: Target execution venue code name.
                    depositMarket:
                      type: object
                      required:
                        - market
                        - marketModelInstrument
                      properties:
                        market:
                          type: object
                          required:
                            - name
                            - apiCode
                          properties:
                            name:
                              type: string
                              description: >-
                                Name of the target market on the execution
                                venue.
                            apiCode:
                              type: string
                              description: AIP code sent to the execution venue.
                        marketModelInstrument:
                          type: object
                          required:
                            - description
                            - price
                          properties:
                            description:
                              type: string
                              description: >-
                                Description of the Market Model Instrument for
                                the deposit.
                            price:
                              type: object
                              required:
                                - amount
                              properties:
                                amount:
                                  type: number
                                  format: double
                                  description: Price, if applicable, for the deposit.
                    taxLot:
                      type: object
                      required:
                        - name
                      properties:
                        name:
                          type: string
                          description: The name of the TaxLot associated with the deposit.
                    instrument:
                      type: object
                      required:
                        - ein
                        - description
                        - program
                        - vintage
                        - resource
                      properties:
                        ein:
                          type: string
                          description: The EIN code for the deposit.
                        description:
                          type: string
                          description: >-
                            The Xpansiv Connect description for the EIN on the
                            deposit.
                        type:
                          type: string
                          description: Denotes whether the deposit is for CARBON or REC.
                          enum:
                            - CARBON
                            - REC
                        program:
                          type: string
                          description: The program associated with the product on deposit.
                        vintage:
                          $ref: '#/components/schemas/Vintage'
                        resource:
                          type: object
                          required:
                            - name
                          properties:
                            name:
                              type: string
                              description: The registry name of the item on deposit.
                            registryAssignedId:
                              type: string
                              description: >-
                                The registry assigned id for the item on
                                deposit.
                    quantity:
                      type: integer
                      format: int64
                      description: The original quantity of the deposit.
                    availableQuantity:
                      type: integer
                      format: int64
                      description: The remaining quantity of the deposit.
                    settledQuantity:
                      type: integer
                      format: int64
                      description: >-
                        The quantity of the deposit settled as a result of
                        trading activity.
                    status:
                      $ref: '#/components/schemas/DepositStatus'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_EXCHANGE
                      - INVALID_ACCOUNT
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/execution-venues/{ExecutionVenueCode}/accounts/{AccountIdentifier}/action/deposit:
    parameters:
      - $ref: '#/components/parameters/ExchangeCode'
      - $ref: '#/components/parameters/ExecutionVenueCode'
      - $ref: '#/components/parameters/AccountIdentifier'
    post:
      summary: Deposits creation
      description: Deposits creation
      tags:
        - Exchange
      operationId: deposit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - market
                - deposits
              properties:
                market:
                  type: string
                deposits:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - taxLotId
                      - quantity
                    properties:
                      taxLotId:
                        type: integer
                        format: int64
                        description: >-
                          TaxLot id of the inventory selected for the deposit to
                          the execution venue.
                      quantity:
                        type: integer
                        format: int64
                        minimum: 1
                        description: Quantity to be deposited.
                      priority:
                        type: integer
                        format: int64
                        description: >-
                          Priority for the deposit to be used in the trade
                          settlement process.
      responses:
        '200':
          description: Deposits created
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - depositIdentifier
                    - status
                  properties:
                    depositIdentifier:
                      type: string
                    status:
                      $ref: '#/components/schemas/DepositStatus'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - TAX_LOT_NOT_FOUND
                      - INVALID_EXCHANGE
                      - INVALID_ACCOUNT
                      - INVALID_EXECUTION_VENUE
                      - NOT_ENOUGH_QUANTITY
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/accounts/{AccountIdentifier}/action/withdraw:
    parameters:
      - $ref: '#/components/parameters/ExchangeCode'
      - $ref: '#/components/parameters/AccountIdentifier'
    post:
      summary: Deposits withdraw
      description: Deposits withdraw
      tags:
        - Exchange
      operationId: withdraw
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - withdrawals
              properties:
                withdrawals:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - depositIdentifier
                      - quantity
                    properties:
                      depositIdentifier:
                        type: string
                        description: The depositIdentifier of the deposit to withdraw.
                      quantity:
                        type: integer
                        format: int64
                        description: Quantity of the amount on deposit to be withdrawn.
                        minimum: 1
      responses:
        '200':
          description: Deposits withdrawn
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - depositIdentifier
                    - status
                  properties:
                    depositIdentifier:
                      type: string
                      description: >-
                        The depositIdentifier with which the withdraw request
                        was made.
                    status:
                      type: string
                      description: Status of the deposit withdrawal request.
                      enum:
                        - WITHDRAWN
                        - FAILED
                        - REJECTED
                        - NO_AVAILABLE_QUANTITY
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - DEPOSIT_NOT_FOUND
                      - NOT_ENOUGH_QUANTITY
                      - INVALID_EXCHANGE
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/account/{AccountIdentifier}/program/{RetirementProgramCode}/action/withdraw-and-retire:
    post:
      tags:
        - Exchange
      operationId: withdrawAndRetire
      parameters:
        - $ref: '#/components/parameters/ExchangeCode'
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/RetirementProgramCode'
      summary: Withdraw credits and create retirements
      description: >-
        Allows the combination of withdrawal of credits and creation of
        retirements in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - dryRun
                - retirements
              properties:
                dryRun:
                  description: >-
                    If true it will only do the validation of the request but
                    not to create the retirements
                  type: boolean
                retirements:
                  type: array
                  items:
                    type: object
                    required:
                      - ein
                      - quantity
                    properties:
                      ein:
                        type: string
                      quantity:
                        type: integer
                        format: int64
                      externalIdentifier:
                        type: string
                attributes:
                  type: object
                  additionalProperties: true
        required: true
      responses:
        '200':
          description: Retirements
          content:
            application/json:
              schema:
                type: object
                required:
                  - retirements
                  - batchIdentifier
                properties:
                  retirements:
                    type: array
                    items:
                      $ref: '#/components/schemas/Retirement'
                  batchIdentifier:
                    type: string
                    description: EMA retirement batch identifier
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - INVALID_ATTRIBUTES
                      - INVALID_RETIREMENTS
                      - INVALID_EXCHANGE
                      - INVALID_ACCOUNT
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                        message:
                          type: string
                  attributeErrors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_VALUE
                            - UNEXPECTED_FIELD
                            - UNAVAILABLE_FIELD
                            - REQUIRED_FIELD
                            - INVALID_SUB_ACCOUNT
                            - INVALID_BENEFICIAL_OWNER_NAME
                        message:
                          type: string
                        field:
                          type: string
                        value:
                          type: string
                  retirementErrors:
                    type: array
                    items:
                      type: array
                      items:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - INVALID_VALUE
                              - QUARANTINED_POSITION
                              - INSUFFICIENT_QUANTITY
                              - INVALID_EIN
                              - DUPLICATE_EIN
                              - INVALID_TAX_LOT_ALLOCATION_STRATEGY
                              - INVALID_TAX_LOT_ALLOCATION
                              - UNEXPECTED_QUANTITY_PER_TAX_LOT
                              - ZERO_QUANTITY_TAX_LOTS
                              - DUPLICATE_TAX_LOTS
                              - ZERO_QUANTITY
                              - INVALID_QUANTITY_SUM
                              - EIN_CURRENTLY_LOCKED
                          message:
                            type: string
                          field:
                            type: string
                          value:
                            type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/account/{AccountIdentifier}/program/{ProgramCode}/action/withdraw-and-export:
    post:
      tags:
        - Exchange
      operationId: withdrawAndExport
      parameters:
        - $ref: '#/components/parameters/ExchangeCode'
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/ProgramCode'
      summary: Withdraw credits and create exports
      description: >-
        Allows the combination of withdrawal of credits and creation of export
        in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - exports
              properties:
                dryRun:
                  description: >-
                    If true it will only do the validation of the request but
                    not withdraw nor export
                  type: boolean
                exports:
                  type: array
                  items:
                    type: object
                    required:
                      - ein
                      - quantity
                    properties:
                      ein:
                        type: string
                      quantity:
                        type: integer
                        format: int64
                      externalIdentifier:
                        type: string
        required: true
      responses:
        '200':
          description: Successful withdraw and export
          content:
            application/json:
              schema:
                type: object
                required:
                  - batchIdentifier
                  - exports
                properties:
                  batchIdentifier:
                    type: string
                    description: EMA export batch identifier
                  exports:
                    type: array
                    items:
                      type: object
                      required:
                        - transferIdentifier
                      properties:
                        transferIdentifier:
                          type: string
                        externalIdentifier:
                          type: string
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - INVALID_EXPORTS
                      - INVALID_ACCOUNT
                      - INVALID_EXCHANGE
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - INVALID_VALUE
                            - QUARANTINED_POSITION
                            - INSUFFICIENT_QUANTITY
                            - INVALID_EIN
                            - DUPLICATE_EIN
                            - ZERO_QUANTITY
                            - EIN_CURRENTLY_LOCKED
                            - INVALID_ACCOUNT
                            - INVALID_QUANTITY
                        message:
                          type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /exchanges/{ExchangeCode}/execution-venues/{ExecutionVenueCode}/action/settle:
    parameters:
      - $ref: '#/components/parameters/ExchangeCode'
      - $ref: '#/components/parameters/ExecutionVenueCode'
    post:
      summary: Deposits settlement
      description: Deposits settlement
      tags:
        - Exchange
      operationId: settle
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - tradeIdentifier
                - sellerIdentifier
                - buyerIdentifier
                - productCode
                - quantity
                - price
                - currency
              properties:
                tradeIdentifier:
                  type: string
                  minLength: 1
                sellerIdentifier:
                  type: string
                  minLength: 8
                  example: 098B0A25
                buyerIdentifier:
                  type: string
                  minLength: 8
                  example: 098B0A25
                productCode:
                  type: string
                  minLength: 3
                quantity:
                  type: integer
                  format: int64
                  minimum: 0
                  exclusiveMinimum: true
                  example: 100
                price:
                  type: number
                  format: double
                  minimum: 0
                  exclusiveMinimum: true
                  example: 3.12
                currency:
                  type: string
                  minLength: 3
                  example: USD
      responses:
        '201':
          description: Settlement created
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - DUPLICATED_REQUEST
                      - INVALID_EXCHANGE
                      - INVALID_EXECUTION_VENUE
                      - ACCOUNT_NOT_FOUND
                      - NOT_ENOUGH_QUANTITY
                      - DEPOSIT_NOT_FOUND
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /portfolio/account/{AccountIdentifier}/position/action/search:
    post:
      tags:
        - Portfolio
      operationId: searchAccountPositions
      summary: Search account positions
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Include'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                programs:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProgramCode'
                resourceName:
                  type: string
                registryAssignedId:
                  type: string
                vintagePeriod:
                  type: object
                  properties:
                    start:
                      $ref: '#/components/schemas/Vintage'
                    end:
                      $ref: '#/components/schemas/Vintage'
                upns:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: List of positions
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          $ref: '#/components/schemas/Position'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_VINTAGE_PERIOD
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /portfolio/account/{AccountIdentifier}/actions:
    get:
      tags:
        - Portfolio
      operationId: getPortfolioAccountActions
      summary: Get portfolio account actions
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
      responses:
        '200':
          description: Portfolio account actions
          content:
            application/json:
              schema:
                type: object
                properties:
                  actions:
                    type: array
                    items:
                      $ref: '#/components/schemas/PortfolioAction'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /reports/account/{AccountIdentifier}/type/tax-lots-by-program:
    get:
      operationId: taxLotsByProgramReport
      summary: Get tax lots by program report
      tags:
        - Reports
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/Include'
      responses:
        '200':
          description: Tax lots by program report
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountIdentifier:
                    type: string
                  accountName:
                    type: string
                  content:
                    type: array
                    items:
                      $ref: '#/components/schemas/Position'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /retirements/account/{AccountIdentifier}/action/check-status:
    post:
      tags:
        - Retirements
      operationId: checkStatus
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
      summary: Check retirements status
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                retirementIdentifiers:
                  type: array
                  items:
                    type: string
        required: true
      responses:
        '200':
          description: Retirements
          content:
            application/json:
              schema:
                type: object
                properties:
                  retirementStatuses:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          $ref: '#/components/schemas/RetirementStatus'
                        identifier:
                          type: string
                          description: The retirement identifier.
                        externalIdentifier:
                          type: string
                          description: External retirement identifier, if provided.
                        registryTransferIdentifier:
                          type: string
                          description: Retirement identifier supplied by the registry.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /retirements/account/{AccountIdentifier}/action/search:
    post:
      tags:
        - Retirements
      operationId: searchRetirements
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/Include'
      summary: Search retirements
      description: >-
        Searches for all retirements for given program and/or between given date
        range
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                program:
                  $ref: '#/components/schemas/ProgramCode'
                lastUpdatedDateFrom:
                  type: string
                  format: date-time
                lastUpdatedDateTo:
                  type: string
                  format: date-time
                externalIdentifier:
                  type: string
        required: true
      responses:
        '200':
          description: Retirements
          content:
            application/json:
              schema:
                type: object
                required:
                  - retirements
                properties:
                  retirements:
                    type: array
                    items:
                      $ref: '#/components/schemas/Retirement'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - INVALID_DATES
        '401':
          $ref: '#/components/responses/401'
        '404':
          description: Not found
        '500':
          $ref: '#/components/responses/500'
  /retirements/account/{AccountIdentifier}/program/{RetirementProgramCode}/action/create:
    post:
      tags:
        - Retirements
      operationId: createRetirement
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/RetirementProgramCode'
      summary: Create retirements
      description: Allows creation retirements in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dryRun:
                  description: >-
                    If true it will only do the validation of the request but
                    not to create the retirements
                  type: boolean
                retirements:
                  type: array
                  items:
                    type: object
                    required:
                      - ein
                      - quantity
                    properties:
                      ein:
                        type: string
                      quantity:
                        type: integer
                        format: int64
                      taxLotSelectionStrategy:
                        type: string
                        enum:
                          - NEWEST_TAX_LOT_FIRST
                          - OLDEST_TAX_LOT_FIRST
                          - LARGEST_TAX_LOT_FIRST
                          - SMALLEST_TAX_LOT_FIRST
                      quantityPerTaxLot:
                        type: array
                        items:
                          type: object
                          required:
                            - taxLotId
                            - quantity
                          properties:
                            taxLotId:
                              type: integer
                              format: int64
                            quantity:
                              type: integer
                              format: int64
                      externalIdentifier:
                        type: string
                attributes:
                  type: object
                  additionalProperties: true
        required: true
      responses:
        '200':
          description: Retirements
          content:
            application/json:
              schema:
                type: object
                properties:
                  retirementIdentifiers:
                    type: array
                    items:
                      type: string
                  batchIdentifier:
                    type: string
                    description: EMA retirement batch identifier
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - INVALID_ATTRIBUTES
                      - INVALID_RETIREMENTS
                  attributeErrors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_VALUE
                            - UNEXPECTED_FIELD
                            - UNAVAILABLE_FIELD
                            - REQUIRED_FIELD
                            - INVALID_SUB_ACCOUNT
                            - INVALID_BENEFICIAL_OWNER_NAME
                        message:
                          type: string
                        field:
                          type: string
                        value:
                          type: string
                  retirementErrors:
                    type: array
                    items:
                      type: array
                      items:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - INVALID_VALUE
                              - QUARANTINED_POSITION
                              - INSUFFICIENT_QUANTITY
                              - INVALID_EIN
                              - DUPLICATE_EIN
                              - INVALID_TAX_LOT_ALLOCATION_STRATEGY
                              - INVALID_TAX_LOT_ALLOCATION
                              - UNEXPECTED_QUANTITY_PER_TAX_LOT
                              - ZERO_QUANTITY_TAX_LOTS
                              - DUPLICATE_TAX_LOTS
                              - ZERO_QUANTITY
                              - INVALID_QUANTITY_SUM
                              - EIN_CURRENTLY_LOCKED
                          message:
                            type: string
                          field:
                            type: string
                          value:
                            type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /retirements/program/{RetirementProgramCode}/rules:
    get:
      tags:
        - Retirements
      operationId: getRegistryRules
      parameters:
        - $ref: '#/components/parameters/RetirementProgramCode'
      summary: Get registry rules
      responses:
        '200':
          description: Retirement Rule
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          $ref: '#/components/responses/401'
        '404':
          description: Not found
        '500':
          $ref: '#/components/responses/500'
  /generators/action/search:
    post:
      operationId: searchGenerators
      parameters:
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      summary: Generators search
      requestBody:
        description: Generators search endpoint
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                upn:
                  type: string
                name:
                  type: string
                program:
                  $ref: '#/components/schemas/RECProgramCode'
                registryAssignedId:
                  type: string
                  deprecated: true
                registryAssignedIds:
                  type: array
                  items:
                    type: string
                hostCountry:
                  type: string
                fuelType:
                  type: string
                state:
                  type: string
      responses:
        '200':
          description: Generators search successfully executed
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          $ref: '#/components/schemas/Generator'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_MARKET_SEARCH_TYPE
                      - INVALID_FUEL_TYPE
                      - INVALID_STATE
                      - INVALID_COUNTRY
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      tags:
        - Generators
  /projects/action/search:
    post:
      operationId: searchProjects
      parameters:
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      summary: Projects search
      requestBody:
        description: Projects search endpoint
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                upn:
                  type: string
                name:
                  type: string
                country:
                  type: string
                status:
                  $ref: '#/components/schemas/ProjectStatus'
                program:
                  $ref: '#/components/schemas/CarbonProgramCode'
                registryAssignedId:
                  type: string
                certification:
                  type: string
      responses:
        '200':
          description: Projects search successfully executed
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          $ref: '#/components/schemas/Project'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROJECT_STATUS
                      - INVALID_PROGRAM
                      - INVALID_COUNTRY
                      - INVALID_CERTIFICATION
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      tags:
        - Projects
  /instruments/action/search:
    post:
      operationId: searchInstruments
      parameters:
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Include'
      summary: Instruments search
      requestBody:
        description: Instruments search endpoint
        required: true
        content:
          application/json:
            schema:
              description: Program is mandatory when EIN is not provided
              type: object
              properties:
                ein:
                  type: string
                program:
                  $ref: '#/components/schemas/ProgramCode'
                registryAssignedId:
                  type: string
                upn:
                  type: string
                id:
                  type: integer
                  format: int64
      responses:
        '200':
          description: Instruments search successfully executed
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    required:
                      - content
                    properties:
                      content:
                        type: array
                        items:
                          $ref: '#/components/schemas/Instrument'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      tags:
        - Instruments
  /transfers/account/{AccountIdentifier}/action/search:
    post:
      tags:
        - Transfers
      operationId: searchTransfers
      summary: Search transfers
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Include'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                transferIdentifier:
                  type: string
                type:
                  $ref: '#/components/schemas/TransferType'
                statuses:
                  type: array
                  items:
                    $ref: '#/components/schemas/TransferStatus'
                registryStatuses:
                  type: array
                  items:
                    $ref: '#/components/schemas/RegistryTransferStatus'
                lastUpdatedDateFrom:
                  type: string
                  format: date-time
                lastUpdatedDateTo:
                  type: string
                  format: date-time
                counterpartyName:
                  type: string
                programs:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProgramCode'
      responses:
        '200':
          description: List of transfers
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          type: object
                          properties:
                            identifier:
                              type: string
                              description: Unique identifier.
                            counterparty:
                              type: string
                              description: Counterparty name.
                            type:
                              allOf:
                                - $ref: '#/components/schemas/TransferType'
                              description: Transfer type Buy or Sell.
                            status:
                              allOf:
                                - $ref: '#/components/schemas/TransferStatus'
                              description: Xpansiv Connect status for the transfer.
                            registryStatus:
                              allOf:
                                - $ref: '#/components/schemas/RegistryTransferStatus'
                              description: Status of the transfer in the registry.
                            quantity:
                              type: integer
                              format: int64
                              description: Transfer quantity.
                            dealIds:
                              type: array
                              description: Deal id's associated with the transfer.
                              items:
                                type: string
                            externalTransferIdentifier:
                              type: string
                              description: >-
                                External identifier if provided by the Xpansiv
                                Connect client.
                            createdDate:
                              type: string
                              format: date-time
                              description: Transfer created date.
                            transferDate:
                              type: string
                              format: date-time
                              description: Transfer date.
                            lastUpdatedDate:
                              type: string
                              format: date-time
                              description: Last updated date.
                            expectedSettlementDate:
                              type: string
                              format: date-time
                              description: Expected settle date.
                            actualSettlementDate:
                              type: string
                              format: date-time
                              description: Actual settle date.
                            registryTransferIdentifier:
                              type: string
                              description: Registry identifier if provided.
                            unitPrice:
                              $ref: '#/components/schemas/Price'
                            showPriceInRegistry:
                              type: boolean
                              description: PJM and NEPOOL registries only.
                            registryTransferPurpose:
                              $ref: '#/components/schemas/RegistryTransferPurpose'
                            instrument:
                              $ref: '#/components/schemas/Instrument'
                            batchIdentifier:
                              type: string
                              description: >-
                                Tha batch identifier for the transfer
                                transaction.
                            transferTaxLots:
                              description: Optional property. Use `include` param.
                              type: array
                              items:
                                type: object
                                required:
                                  - taxLot
                                properties:
                                  taxLot:
                                    $ref: '#/components/schemas/TaxLot'
                                  quantity:
                                    type: integer
                                    format: int64
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_TRANSFER_TYPE
                      - INVALID_TRANSFER_STATUS
                      - INVALID_REGISTRY_TRANSFER_STATUS
                      - INVALID_DATE_RANGE
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /transfers/account/{AccountIdentifier}/program/{ProgramCode}/action/create:
    post:
      tags:
        - Transfers
      operationId: createTransfers
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/ProgramCode'
      summary: Create transfers
      description: Allows creation transfers in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Registry transfer purpose is required for PJM
              required:
                - counterpartyRegistryName
                - settlementDate
                - transfers
              properties:
                dryRun:
                  description: >-
                    If true it will only do the validation of the request but
                    not to create the transfers
                  type: boolean
                counterpartyRegistryName:
                  type: string
                registryTransferPurpose:
                  $ref: '#/components/schemas/RegistryTransferPurpose'
                settlementDate:
                  type: string
                  format: date
                  description: Date when transfers should be settled in EST time zone
                showPriceInRegistry:
                  type: boolean
                  description: >-
                    Required for PJM and NEPOOL. Price will be communicated to
                    registry on placement.
                notes:
                  type: string
                transfers:
                  type: array
                  items:
                    type: object
                    required:
                      - price
                      - ein
                      - transferData
                    properties:
                      externalTransferIdentifier:
                        type: string
                      ein:
                        type: string
                      unitPrice:
                        $ref: '#/components/schemas/Price'
                      transferData:
                        discriminator:
                          propertyName: transferDataType
                          mapping:
                            STRATEGY: '#/components/schemas/TransferDataStrategy'
                            TAX_LOTS: '#/components/schemas/TransferDataTaxLots'
                        oneOf:
                          - $ref: '#/components/schemas/TransferDataStrategy'
                          - $ref: '#/components/schemas/TransferDataTaxLots'
      responses:
        '200':
          description: Transfers
          content:
            application/json:
              schema:
                type: object
                properties:
                  transfers:
                    type: array
                    items:
                      type: object
                      properties:
                        externalTransferIdentifier:
                          type: string
                        transferIdentifier:
                          type: string
                  batchIdentifier:
                    type: string
                    description: EMA transfer batch identifier
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - REQUEST_TOO_LARGE
                      - SETTLEMENT_DATE_IN_PAST
                      - SETTLEMENT_DATE_HOLIDAY
                      - SETTLEMENT_DATE_OUTSIDE_TRADING_WINDOW
                      - INVALID_COUNTERPARTY_NAME
                      - INVALID_REGISTRY_TRANSFER_PURPOSE
                      - INVALID_SHOW_PRICE_IN_REGISTRY
                      - INVALID_TRANSFERS
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - INVALID_TRANSFER_DATA
                            - INVALID_TAX_LOT_SELECTION_STRATEGY
                            - DUPLICATE_TAX_LOT
                            - DUPLICATE_EIN
                            - INVALID_EIN
                            - QUARANTINED_POSITION
                            - INVALID_TAX_LOT
                            - INVALID_QUANTITY
                            - INVALID_PRICE
                            - UNAVAILABLE_QUANTITY
                        message:
                          type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /transfers/account/{AccountIdentifier}/program/{ProgramCode}/action/cancel:
    post:
      tags:
        - Transfers
      operationId: cancelTransfers
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/ProgramCode'
      summary: Cancel transfers
      description: Allows cancellation transfers in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dryRun:
                  type: boolean
                notes:
                  type: string
                batchIdentifier:
                  type: string
                transfers:
                  description: Transfer identifiers
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: Transfers cancelled successfully
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - REQUEST_TOO_LARGE
                      - TRANSFERS_OR_BATCH
                      - BATCH_REQUIRED_M_RETS
                      - INVALID_TRANSFERS
                      - INVALID_BATCH
                      - INVALID_BATCH_TRANSFERS
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - DUPLICATE_TRANSFER
                            - INVALID_TRANSFER
                            - INVALID_TRANSFER_PROGRAM
                            - INVALID_TRANSFER_STATUS
                            - INVALID_TRANSFER_REGISTRY_STATUS
                        message:
                          type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /transfers/account/{AccountIdentifier}/program/{ProgramCode}/action/reject:
    post:
      tags:
        - Transfers
      operationId: rejectTransfers
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/ProgramCode'
      summary: Reject transfers
      description: Allows rejection transfers in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dryRun:
                  type: boolean
                notes:
                  type: string
                transfers:
                  description: Transfer identifiers
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: Transfers rejected successfully
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - REQUEST_TOO_LARGE
                      - INCOMPLETE_M_RETS_BATCH
                      - INVALID_TRANSFERS
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - DUPLICATE_TRANSFER
                            - INVALID_TRANSFER
                            - INVALID_TRANSFER_PROGRAM
                            - INVALID_TRANSFER_STATUS
                            - INVALID_TRANSFER_REGISTRY_STATUS
                        message:
                          type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /transfers/account/{AccountIdentifier}/program/{ProgramCode}/action/accept:
    post:
      tags:
        - Transfers
      operationId: acceptTransfers
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/ProgramCode'
      summary: Accept transfers
      description: Allows acceptance transfers in bulk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - transfers
              properties:
                dryRun:
                  type: boolean
                notes:
                  type: string
                transfers:
                  description: Transfer identifiers
                  type: array
                  items:
                    type: object
                    required:
                      - transferIdentifier
                      - price
                    properties:
                      transferIdentifier:
                        type: string
                      externalTransferIdentifier:
                        type: string
                      price:
                        $ref: '#/components/schemas/Price'
      responses:
        '200':
          description: Transfers accepted successfully
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_PROGRAM
                      - INVALID_REQUEST
                      - EMPTY_REQUEST
                      - REQUEST_TOO_LARGE
                      - SETTLEMENT_DATE_IN_PAST
                      - SETTLEMENT_DATE_HOLIDAY
                      - SETTLEMENT_DATE_OUTSIDE_TRADING_WINDOW
                      - INCOMPLETE_M_RETS_BATCH
                      - INVALID_TRANSFERS
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - DUPLICATE_TRANSFER
                            - INVALID_TRANSFER
                            - INVALID_TRANSFER_PROGRAM
                            - INVALID_PRICE
                            - INVALID_TRANSFER_STATUS
                            - INVALID_TRANSFER_REGISTRY_STATUS
                        message:
                          type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /issuances/account/{AccountIdentifier}/action/search:
    post:
      tags:
        - Issuances
      operationId: searchIssuances
      summary: Search issuances
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Include'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifier:
                  type: string
                createdDateFrom:
                  type: string
                  format: date-time
                createdDateTo:
                  type: string
                  format: date-time
                programs:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProgramCode'
      responses:
        '200':
          description: List of issuances
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          type: object
                          properties:
                            identifier:
                              type: string
                              description: Unique identifier.
                            type:
                              type: string
                              description: Issuance type.
                              default: ISSUANCE
                            status:
                              type: string
                              description: Issuance status.
                              default: Issued
                            quantity:
                              type: integer
                              format: int64
                              description: Issuance quantity.
                            unitPrice:
                              allOf:
                                - $ref: '#/components/schemas/Price'
                              description: Issuance price.
                            createdDate:
                              type: string
                              format: date-time
                              description: Issuance created date.
                            lastUpdatedDate:
                              type: string
                              format: date-time
                              description: Issuance last updated date.
                            externalTransferIdentifier:
                              type: string
                              description: Issuance external transfer identifier.
                            taxLot:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  format: int64
                                  description: TaxLot identifier.
                                name:
                                  type: string
                                  description: TaxLot name.
                            instrument:
                              $ref: '#/components/schemas/Instrument'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_DATE_RANGE
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /split-lots/account/{AccountIdentifier}/action/search:
    post:
      tags:
        - Split Lots
      operationId: searchSplitLots
      summary: Search split lots
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                programs:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProgramCode'
                createdDateFrom:
                  type: string
                  format: date-time
                createdDateTo:
                  type: string
                  format: date-time
                counterpartyName:
                  type: string
      responses:
        '200':
          description: List of split lots
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          type: object
                          properties:
                            identifier:
                              type: string
                              description: Unique identifier.
                            counterpartyName:
                              type: string
                              description: Counterparty name.
                            type:
                              type: string
                              default: SPLIT
                              description: Type of the split lot.
                            status:
                              type: string
                              default: Success
                              description: Status of the split lot.
                            quantity:
                              type: integer
                              format: int64
                              description: Quantity for the split lot.
                            taxLotId:
                              type: integer
                              format: int64
                              description: TaxLot id for the split lot.
                            taxLotName:
                              type: string
                              description: TaxLot id for the split lot.
                            sourceTaxLotId:
                              type: integer
                              format: int64
                              description: The identifier of the source TaxLot.
                            sourceTaxLotName:
                              type: string
                              description: The name of the source TaxLot.
                            externalTransferIdentifier:
                              type: string
                              description: >-
                                the external transfer identifier for the split
                                lot.
                            createdDate:
                              type: string
                              format: date-time
                              description: Split lot created date.
                            lastUpdatedDate:
                              type: string
                              format: date-time
                              description: Split lot last updated date.
                            unitPrice:
                              $ref: '#/components/schemas/Price'
                            ein:
                              type: string
                              description: >
                                Environment Instrument Number. Unique identifier
                                associated with an issuance of credits from a
                                given project,  vintage, technology/fuel type
                                and associated certification(s)/eligibility(s).
                                An EIN is associated with a  position and a
                                position will never be associated with more than
                                1 EIN.
                            program:
                              $ref: '#/components/schemas/ProgramCode'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_DATE_RANGE
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /forward-deals/account/{AccountIdentifier}/action/search:
    post:
      tags:
        - Forward Deals
      operationId: searchForwardDeals
      summary: Search forward deals
      parameters:
        - $ref: '#/components/parameters/AccountIdentifier'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Include'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                programs:
                  type: array
                  items:
                    type: string
                    description: Ref.Data.REGISTRY_PROGRAM_REGI
                lastUpdatedDateFrom:
                  type: string
                  format: date-time
                lastUpdatedDateTo:
                  type: string
                  format: date-time
                counterpartyName:
                  type: string
                  description: >-
                    If this search parameter is passed as ““  then deals with no
                    counterparty identifier specified will be returned.
                dealName:
                  type: string
      responses:
        '200':
          description: List of forward deals
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              description: Name of the forward deal.
                            memo:
                              type: string
                              description: Memo if provided by the XC user.
                            executionDate:
                              type: string
                              format: date-time
                              description: Execution date.
                            externalDealId:
                              type: string
                              description: Optional external ID.
                            type:
                              type: string
                              default: PHYSICAL
                              description: >-
                                Type of deal as either Market or Project
                                Specific.
                            status:
                              type: string
                              enum:
                                - PENDING
                                - EXECUTED
                                - COMPLETED
                              description: Status of the deal.
                            transactionSideType:
                              type: string
                              enum:
                                - BUY
                                - SELL
                              description: Buy or Sell
                            program:
                              type: string
                              description: >-
                                Program/Registry associated with the deal.
                                Ref.Data.REGISTRY_PROGRAM_REGI
                            vintageType:
                              type: string
                              enum:
                                - COMPLIANCE_YEAR
                                - GENERATION_YEAR
                                - CALENDAR
                              description: >-
                                The type of vintage range used to define what
                                vintage(s) of credits will be deliverable with
                                each delivery Longitude.
                            createdBy:
                              type: string
                              description: Created by id.
                            trader:
                              type: string
                              description: Trader name associated with the deal.
                            privateCounterpartyDetails:
                              type: object
                              properties:
                                contactName:
                                  type: string
                                  description: Optional contact name.
                                name:
                                  type: string
                                  description: Optional counterparty name.
                                tradeDate:
                                  type: string
                                  format: date-time
                                  description: Optional trade date.
                                contractNumber:
                                  type: string
                                  description: Optional contract number.
                            unitOfMeasure:
                              type: string
                              enum:
                                - ALLOW
                                - MWh
                                - lb
                                - ton
                                - t
                              description: Unit of measure.
                            counterpartyName:
                              type: string
                              description: >-
                                Name of the counterparty in the registry for
                                this deal.
                            brokerDetails:
                              type: object
                              properties:
                                identifier:
                                  type: string
                                  description: Broker id.
                                name:
                                  type: string
                                  description: Broker name.
                                fee:
                                  allOf:
                                    - $ref: '#/components/schemas/Price'
                                  description: Broker fee.
                            lastUpdatedDate:
                              type: string
                              format: date-time
                              description: Last updated date.
                            forwardPortfolio:
                              type: object
                              properties:
                                identifier:
                                  type: string
                                name:
                                  type: string
                            confirmDetails:
                              type: object
                              properties:
                                comments:
                                  type: string
                                  description: >-
                                    Comments associated with the confirm action
                                    if provided by the XC client.
                                brokerInWriting:
                                  type: boolean
                                  description: >-
                                    Flag for if confirm was agreed with broker
                                    in writing.
                                receivedDate:
                                  type: string
                                  format: date-time
                                  description: Date the confirm was received.
                                executionDate:
                                  type: string
                                  format: date-time
                                  description: >-
                                    Date of deal execution related to this
                                    confirm action.
                            statusEvents:
                              type: array
                              items:
                                type: object
                                allOf:
                                  - $ref: '#/components/schemas/ForwardStatusEvent'
                                properties:
                                  type:
                                    enum:
                                      - PENDING
                                      - EXECUTED
                                      - COMPLETED
                              description: Optional property. Use `include` param.
                            forwardTransactions:
                              type: array
                              items:
                                type: object
                                properties:
                                  identifier:
                                    type: string
                                    description: Unique identifier.
                                  deliveryDate:
                                    type: string
                                    format: date-time
                                    description: Schedule delivery date.
                                  quantity:
                                    type: integer
                                    format: int64
                                    description: Scheduled delivery quantity.
                                  quantityType:
                                    type: string
                                    enum:
                                      - PERCENT
                                      - UNIT
                                    description: Quantity type.
                                  status:
                                    type: string
                                    enum:
                                      - INACTIVE
                                      - ACTIVE
                                      - DELIVERY_STARTED
                                      - DELIVERY_COMPLETED
                                      - DELIVERY_CANCELLED
                                      - MATCHED
                                    description: Delivery status.
                                  deliveryScheduleType:
                                    type: string
                                    enum:
                                      - ON_ISSUANCE
                                      - ON_DATE
                                      - ON_OR_BEFORE_DATE
                                      - ON_CONFIRM_EXEC
                                      - DATE_RANGE
                                    description: Delivery schedule type.
                                  contractedDetails:
                                    $ref: '#/components/schemas/ForwardContract'
                                  deliveredDetails:
                                    $ref: '#/components/schemas/ForwardContract'
                                  netOpenVolume:
                                    type: integer
                                    format: int64
                                    description: Remaining open volume.
                                  createdDate:
                                    type: string
                                    format: date-time
                                    description: Delivery created date.
                                  lastUpdatedDate:
                                    type: string
                                    format: date-time
                                    description: Delivery last updated date.
                                  forwardInstrument:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                      deliveryDateRange:
                                        $ref: '#/components/schemas/ForwardDateRange'
                                    discriminator:
                                      propertyName: type
                                      mapping:
                                        BUNDLE: >-
                                          #/components/schemas/ForwardInstrumentAttributeBundle
                                        MMI: >-
                                          #/components/schemas/ForwardInstrumentMarketModelInstrument
                                    oneOf:
                                      - $ref: >-
                                          #/components/schemas/ForwardInstrumentAttributeBundle
                                      - $ref: >-
                                          #/components/schemas/ForwardInstrumentMarketModelInstrument
                                  deliveryNotes:
                                    type: string
                                  statusEvents:
                                    type: array
                                    items:
                                      type: object
                                      allOf:
                                        - $ref: '#/components/schemas/ForwardStatusEvent'
                                      properties:
                                        type:
                                          enum:
                                            - INACTIVE
                                            - ACTIVE
                                            - DELIVERY_STARTED
                                            - DELIVERY_COMPLETED
                                            - DELIVERY_CANCELLED
                                            - MATCHED
                                    description: >-
                                      Optional property. Use `include` param.
                                      Status event types.
                                  linkedTransfers:
                                    type: array
                                    items:
                                      type: string
                                    description: >
                                      Optional property. Use `include` param.
                                      Each value represents a transaction ID for
                                      the linked  transfer.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                      - INVALID_PROGRAM
                      - INVALID_DATE_RANGE
                      - INVALID_PAGE_SIZE
                      - INVALID_PAGE_NUMBER
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    NotAuthorizedError:
      type: object
      properties:
        message:
          type: string
    NotFoundError:
      type: object
      properties:
        message:
          type: string
    InternalServerError:
      type: object
      properties:
        message:
          type: string
    CarbonProgramCode:
      type: string
      description: Ref.Data.PROGRAM_PROG
    ProgramCode:
      type: string
      description: Ref.Data.REGISTRY_PROGRAM_REGI
    RECProgramCode:
      type: string
      description: Ref.Data.REC_PROGRAM_TYPE
    Page:
      type: object
      required:
        - page
        - size
        - totalPages
        - totalElements
      properties:
        page:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int64
    Location:
      title: Resource location
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: Latitude.
        longitude:
          type: number
          format: double
          description: Longitude.
    Price:
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          description: Currency (USD etc...)
        amount:
          type: number
          description: The numeric value of the price
          minimum: 0
    Vintage:
      type: object
      required:
        - year
      properties:
        year:
          type: integer
          format: int32
          description: Vintage year.
        month:
          type: integer
          format: int32
          description: Vintage month.
    Position:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: >-
            The unique identifier for the position in the portfolio. A postion
            is made up of 1 or more Tax Lots.
        tags:
          type: array
          description: >-
            The name of the tag(s), if used, that are associated with the
            position.
          items:
            type: string
        taxLots:
          type: array
          items:
            $ref: '#/components/schemas/TaxLot'
        instrument:
          $ref: '#/components/schemas/Instrument'
    TaxLot:
      type: object
      description: >-
        A Tax Lot represents the incoming activity that resulted in the creation
        or increase of a position against an EIN. The types of activities
        represented by Tax Lots are; imported positions (at account linking);
        incoming settled bilateral transfers; or credit issuance. Tax Lot is
        associated with a Position, where 1 or more Tax Lots make up the
        available quantity for a single Position
      properties:
        id:
          type: integer
          format: int64
          description: The unique identifier for the tax lot
        name:
          type: string
          description: >-
            The name of the tax lot, normally made up of tax lot type and
            established date
        establishedDate:
          type: string
          format: date-time
          description: >-
            The timestamp for when the tax lot was established, meaning when the
            transaction that created the tax lot was accepted in XC
        establishQuantity:
          type: integer
          format: int64
          description: >-
            The original quantity of credits that created the tax lot. This
            value is optional and must be specifically requested when using this
            call.
        pricePaid:
          $ref: '#/components/schemas/Price'
        availableQuantity:
          type: integer
          format: int64
          description: The quantity available of the tax lot for transfer or retirement
        encumberedQuantity:
          type: integer
          format: int64
          description: >-
            The quantity encumbered of the tax lot on an execution venue
            integrated with XC
        unsettledQuantity:
          type: integer
          format: int64
          description: >-
            The quantity unsettled of the tax lot. This can represent a quantity
            that is in a bilateral transaction, buy or sell, that is pending and
            not yet settled in the registry.
        estimatedMarketPrice:
          type: number
          description: >-
            The estimated price associated with the highest value market this
            tax lot has a certification with  where prices have been uploaded
            from the CBL Exchange. Optional property. Use `include` param.
        estimatedMarketValue:
          type: number
          description: >-
            Using the Estimated Market Price, this represents the estimated
            market value of the tax lot based on the tax lot position quantity.
            Optional property. Use `include` param.
        estimatedGainLoss:
          type: number
          description: >-
            Utilizing both Price Paid and Estimated Market Price against tax lot
            quantity to determine if there was a financial gain or loss for this
            tax lot. Optional property. Use `include` param.
        previousCounterparty:
          type: string
          description: >-
            The registry name of the counterparty that transferred the credits
            of this tax lot to the XC client. This value is optional and must be
            specifically requested when using this call.
        externalTradeId:
          type: string
          description: >-
            An external trade/transaction identifier as provided by the XC
            client for this position. This value is optional and must be
            specifically requested when using this call.
        dealId:
          type: string
          description: >-
            A deal Identifier as provided by the XC client for this position if
            associated with a forward deal delivery. This value is optional and
            must be specifically requested when using this call.
    Retirement:
      type: object
      required:
        - instrument
        - lastUpdatedDate
        - createdDate
        - quantity
        - status
        - batchIdentifier
        - identifier
      properties:
        instrument:
          $ref: '#/components/schemas/Instrument'
        lastUpdatedDate:
          type: string
          format: date-time
          description: Last updated date.
        createdDate:
          type: string
          format: date-time
          description: Creation date.
        quantity:
          type: integer
          description: Retirement quantity.
        status:
          $ref: '#/components/schemas/RetirementStatus'
        batchIdentifier:
          type: string
          description: XPC Retirement batch identifier
        identifier:
          type: string
          description: XPC Retirement identifier
        externalIdentifier:
          type: string
          description: >-
            Retirement identifier provided by API client when creating the
            retirement
        registryTransferIdentifier:
          type: string
          description: Retirement identifier generated by the program
        registryPositionId:
          type: string
          description: Id of the retired registry credits
        attributes:
          type: object
          additionalProperties: true
    RetirementProgramCode:
      type: string
      enum:
        - ACR
        - CAR
        - VCS
        - NEPOOL
        - NAR
        - NYGATS
        - M_RETS
        - MIRECS
        - NCRETS
    RetirementStatus:
      type: string
      description: Status of the retirement.
      enum:
        - NEW
        - PENDING_RETIREMENT
        - PENDING_CUSTODIAN_RETIREMENT
        - RETIRED
        - FAILED
        - CANCELLED
        - REJECTED
        - NOT_FOUND
    Resource:
      type: object
      required:
        - name
      properties:
        id:
          type: integer
          format: int64
          description: The unique XC db identifier for the project or generator.
        upn:
          type: string
          description: >
            Universal Project Identifier. The unique identifier assigned by
            Xpansiv Connect to every resource across all registries that  have
            integrated with the Xpansiv Connect platform.
        name:
          type: string
          description: The registry assigned name of the project or generator.
    AccountHolder:
      type: object
      required:
        - registryAccountId
        - registryAccountName
        - program
        - active
      properties:
        registryAccountId:
          type: string
          description: ID of the account on the registry.
        registryAccountName:
          type: string
          description: Name of the account on the registry.
        program:
          type: string
          description: Program name. Ref.Data.REGISTRY_PROGRAM_REGI
        accountType:
          type: string
          description: Account type description.
        managerName:
          type: string
          description: Name of the manager.
        active:
          type: boolean
          description: True/False.
        generatorAccount:
          type: boolean
          description: True/False.
    Generator:
      allOf:
        - $ref: '#/components/schemas/Resource'
        - type: object
          properties:
            program:
              allOf:
                - $ref: '#/components/schemas/RECProgramCode'
              description: The registry the generator is registered on.
            registryAssignedId:
              type: string
              description: The registry assigned identifier for the generator.
            status:
              type: string
              enum:
                - ACTIVE
                - INACTIVE
              description: The status of the generator in the registry.
            siteCode:
              type: string
              description: The Site Code of the generator if provided by the registry.
            unitName:
              type: string
              description: The Unit Name of the generator in the registry.
            controlArea:
              type: string
              description: The Control Area that the generator is located in.
            parentCompanyName:
              type: string
              description: >-
                The Parent Company Name of the generator if provided by the
                registry.
            powerCompanyName:
              type: string
              description: >-
                The Power Company Name of the generator if provided by the
                registry.
            powerCompanyCode:
              type: string
              description: >-
                The Power Company Code of the generator if provided by the
                registry.
            ownerName:
              type: string
              description: The Owner Name of the generator if provided by the registry
            ownershipType:
              type: string
              description: The Ownership Type of the generator if provided by the registry.
            countyName:
              type: string
              description: >-
                The County Name locatio of the generator if provided by the
                registry.
            stateProvince:
              type: string
              description: The State or Province location of the generator.
            country:
              type: string
              description: The Country location of the generator.
            contactInfo:
              type: string
              description: >-
                Contact Information for the generator if provided by the
                registry.
            registryAcctHolderName:
              type: string
              description: >-
                The Registry Account Holder name of the generator if provided by
                the registry.
            commencedDt:
              type: string
              format: date-time
              description: >-
                The Commenced Operation Date of the generator if provided by the
                registry.
            nameplateCapacity:
              type: number
              format: double
              description: >-
                The Nameplate Capacity of the generator if provided by the
                registry.
            facNoncompetitiveCertData:
              type: string
            fuelTypes:
              type: array
              description: >-
                Additional information about a generator if it is multi-fuel.
                Optional property. Use `include` param.
              items:
                title: Fuel Type Eligibility aggregation
                type: object
                required:
                  - fuelType
                properties:
                  fuelType:
                    $ref: '#/components/schemas/FuelType'
                  stateEligibilities:
                    type: array
                    items:
                      $ref: '#/components/schemas/StateEligibility'
                  voluntaryEligibilities:
                    type: array
                    items:
                      $ref: '#/components/schemas/VoluntaryEligibility'
    FuelType:
      type: object
      properties:
        name:
          type: string
          description: The fuel type associated with the underlying asset.
        type:
          type: string
          description: The registry fuel type.
        fuelSource:
          type: string
          description: >-
            The registry fuel source associated with the fuel type
            (registry-dependent).
    StateEligibility:
      type: object
      description: >-
        Object to hold full state eligibility information - type of eligibility,
        extendable with other information
      properties:
        name:
          type: string
          description: Name of the state eligibility.
        type:
          allOf:
            - $ref: '#/components/schemas/StateEligibilityType'
          description: The state eligibilities associated with the additional fuel types.
        stateIdentifier:
          type: string
          description: This is the identifier of the eligibility from the registry
    VoluntaryEligibility:
      type: object
      description: >-
        Object to hold full voluntary eligibility information - type of
        eligibility, effective date, expiration, extendable with other
        information
      properties:
        name:
          type: string
          description: The name of the registry voluntary eligibility.
        type:
          allOf:
            - $ref: '#/components/schemas/VoluntaryEligibilityType'
          description: The type, as compliance or voluntary.
        effectiveDate:
          type: string
          format: date-time
          description: The effective date of the eligibility.
        expirationDate:
          type: string
          format: date-time
          description: the expiration date of the eligibility.
    StateEligibilityType:
      type: string
      enum:
        - ALBERTA
        - ARIZONA
        - BRITISH_COLUMBIA
        - CALIFORNIA
        - COLORADO
        - NEW_MEXICO
        - NEVADA
        - OREGON
        - TEXAS
        - UTAH
        - WASHINGTON
        - CONNECTICUT_CEO
        - CONNECTICUT_CLASS_I
        - CONNECTICUT_CLASS_II
        - CONNECTICUT_CLASS_III
        - ELIGIBLE_MASSACHUSETTS_NOX_ALLOWANCES
        - MA_SOLAR_CARVE-OUT_UNIT
        - MA_SOLAR_CARVE-OUT_UNIT_II
        - MA_AUCTION_SOLAR_CARVE-OUT_UNIT
        - MA_AUCTION_SOLAR_CARVE-OUT_UNIT_II
        - MASSACHUSETTS_APS_ALTERNATIVE_GENERATION_UNIT
        - MASSACHUSETTS_RPS_CLASS_I_RENEWABLE_GENERATION_UNIT
        - MASSACHUSETTS_RPS_CLASS_II_RENEWABLE_GENERATION_UNIT
        - MASSACHUSETTS_RPS_CLASS_II_WASTE_ENERGY_GENERATION_UNIT
        - ME_COMMUNITY-BASED_RENEW_ENERGY
        - ME_TREC
        - MAINE_CLASS_I
        - MAINE_CLASS_IA
        - MAINE_CLASS_II
        - MAINE_CO2_NETTING
        - MAINE_REN/EFF_ENERGY_SOURCE
        - NEW_HAMPSHIRE_CLASS_I
        - NEW_HAMPSHIRE_CLASS_II
        - NEW_HAMPSHIRE_CLASS_III
        - NEW_HAMPSHIRE_CLASS_IV
        - NH_CLASS_I_THERMAL
        - RHODE_ISLAND_EXISTING_RENEWABLE_RESOURCE
        - RHODE_ISLAND_NEW_RENEWABLE_RESOURCE
        - IOWA
        - ILLINOIS
        - ILLINOIS_SOLAR
        - ILLINOIS_ARES
        - MANITOBA
        - MINNESOTA
        - MONTANA
        - NORTH_DAKOTA
        - SOUTH_DAKOTA
        - MICHIGAN
        - NEW_JERSEY
        - MARYLAND
        - DISTRICT_OF_COLUMBIA
        - PENNSYLVANIA
        - DELAWARE
        - OHIO
        - WISCONSIN_RPS
        - WISCONSIN_RRC
        - IOWA_AEP
        - MINNESOTA_SES_SMALL_SOLAR
        - MINNESOTA_CBED
        - NEWJERSEY_CLASS1
        - NEWJERSEY_CLASS2
        - NEWJERSEY_SOLAR
        - NEWJERSEY_TRANSITION
        - NEWJERSEY_SREC2
        - PENNSYLVANIA_CLASS1
        - PENNSYLVANIA_CLASS2
        - PENNSYLVANIA_SOLAR
        - MARYLAND_TIER1
        - MARYLAND_TIER2
        - MARYLAND_SOLAR
        - MARYLAND_GEO
        - MARYLAND_GEO_LI
        - MARYLAND_BT
        - DC_TIER1
        - DC_TIER2
        - DC_SOLAR
        - DELAWARE_NEW
        - OHIO_RES
        - OHIO_SOLAR_RES
        - CONNECTICUT_CLM
        - CONNECTICUT_CHP
        - MISSOURI
        - DELAWARE_SOLAR
        - NORTH_CAROLINA
        - NC_IN-STATE
        - NC_NEW
        - NC_S886_10
        - NC_S886_20
        - NC_S886_N
        - NEW_YORK
        - KANSAS
        - WV_RENEWABLE_ENERGY_RESOURCE
        - WV_ALTERNATIVE_ENERGY_RESOURCE
        - VIRGINIA
        - VIRGINIA_DISTRIBUTED
        - NYGATS_ZEC
        - NYGATS_TIER_1
        - NYGATS_IMPORT_TYPE_EDD
        - NYGATS_IMPORT_TYPE_NA
        - NYGATS_IMPORT_TYPE_BUN
        - NYGATS_IMPORT_TYPE_UNB
        - VERMONT_TIER1
        - VERMONT_TIER2
        - VERMONT_TIER4
        - CT_CLASS_I_FERC
        - MA_CES
        - MA_CES_E
        - NH_CLASS_I_BIODIESEL_PRODUCER
    VoluntaryEligibilityType:
      type: string
      enum:
        - GREEN_E_CLIMATE
        - GREEN_E_ENERGY_ELIGIBLE
        - ECOLOGO_CERTIFIED
        - LOW_IMPACT_HYDRO_INSTITUTE_CERTIFIED
        - SMUD_ELIGIBLE
        - US_EPA_GPP_ELIGIBLE
        - EFEC_ELIGIBLE
        - IOWA_VOLUNTARY_GREEN
        - ZEC
        - FEED_IN_TARIFF
    ProjectStatus:
      type: string
      enum:
        - IMPORTED
        - INACTIVE
        - PENDING_IMPORT
        - REJECTED
    Project:
      allOf:
        - $ref: '#/components/schemas/Resource'
        - type: object
          required:
            - programs
          properties:
            programs:
              type: array
              items:
                type: object
                title: ProjectProgram
                required:
                  - program
                  - registryAssignedId
                  - status
                  - creditType
                  - projectType
                properties:
                  program:
                    $ref: '#/components/schemas/CarbonProgramCode'
                  programName:
                    type: string
                    description: Registry name.
                  registryAssignedId:
                    type: string
                    description: ID assigned by the registry.
                  registryAccountHolderName:
                    type: string
                    description: Name of the registry account holder.
                  status:
                    type: string
                    description: The status of the project.
                  creditType:
                    type: string
                    description: The type of the credit
                  projectType:
                    type: string
                    description: The project type.
                  baselineMethodologies:
                    type: array
                    items:
                      type: string
                      description: Ref.Data.OPTION
                  creditingPeriodBegin:
                    type: string
                    format: date-time
                    description: Begin date for credit reporting.
                  creditingPeriodEnd:
                    type: string
                    format: date-time
                    description: End date for credit reporting.
            description:
              type: string
              description: The full description from the registry.
            status:
              $ref: '#/components/schemas/ProjectStatus'
            country:
              type: string
              description: Country.
            stateProvince:
              type: string
              description: State or Province
            city:
              type: string
              description: City.
            location:
              $ref: '#/components/schemas/Location'
            annualAverageOffsetQty:
              type: integer
              format: int64
              description: Annual average offset quantity.
            projectCertifications:
              type: array
              description: Optional property. Use `include` param.
              items:
                $ref: '#/components/schemas/ProjectCertification'
            issuanceCertifications:
              type: array
              description: Optional property. Use `include` param.
              items:
                $ref: '#/components/schemas/IssuanceCertification'
    ProjectCertification:
      type: object
      properties:
        code:
          type: string
          description: Certification code.
        projectCertificationDateRanges:
          type: array
          items:
            type: object
            properties:
              certificationStart:
                type: string
                format: date-time
                description: The project certification start date.
              certificationEnd:
                type: string
                format: date-time
                description: The project certification end date.
    IssuanceCertification:
      type: object
      properties:
        code:
          type: string
          description: Certification code.
        vintageYears:
          type: array
          description: Vintage years.
          items:
            type: integer
            format: int32
    ResourceProject:
      allOf:
        - $ref: '#/components/schemas/Resource'
        - type: object
          required:
            - programs
          properties:
            programs:
              type: array
              items:
                type: object
                title: ResourceProjectProgram
                required:
                  - program
                  - registryAssignedId
                properties:
                  program:
                    type: string
                    description: Ref.Data.RESOURCE_PROGRAM_TYPE
                  programName:
                    type: string
                  registryAssignedId:
                    type: string
            status:
              type: string
              description: Ref.Data.RESOURCE_PROJECT_STATUS
            country:
              type: string
            accountName:
              type: string
            classification1:
              type: string
            classification2:
              type: string
            classification3:
              type: string
            childResourceProject:
              $ref: '#/components/schemas/ChildResourceProject'
            inOutTypes:
              type: array
              items:
                type: object
                required:
                  - inType
                  - outType
                properties:
                  inType:
                    type: string
                    description: Ref.Data.RESOURCE_IN_TYPE
                  outType:
                    type: string
                    description: Ref.Data.RESOURCE_OUT_TYPE
            typeName:
              type: string
    ChildResourceProject:
      allOf:
        - $ref: '#/components/schemas/Resource'
        - type: object
          properties:
            accountName:
              type: string
            inOutTypes:
              type: array
              items:
                type: object
                required:
                  - inType
                  - outType
                properties:
                  inType:
                    type: string
                  outType:
                    type: string
            programs:
              type: array
              items:
                type: object
                title: ChildResourceProjectProgram
                required:
                  - program
                  - registryAssignedId
                properties:
                  program:
                    type: string
                    description: Ref.Data.RESOURCE_PROGRAM_TYPE
                  programName:
                    type: string
                  registryAssignedId:
                    type: string
    BaseInstrument:
      type: object
      required:
        - type
        - ein
        - program
        - vintage
        - creditType
      properties:
        type:
          type: string
          description: REC or CARBON
        id:
          type: integer
          format: int64
          description: Unique Xpansiv Connect identifier.
        ein:
          type: string
          description: >
            Environment Instrument Number. Unique identifier associated with an
            issuance of credits from a given project,  vintage, technology/fuel
            type and associated certification(s)/eligibility(s). An EIN is
            associated with a  position and a position will never be associated
            with more than 1 EIN.
        description:
          type: string
          description: >
            The Xpansiv Connect description associated with the instrument
            providing information regarding location,  vintage, fuel type and
            certifications.
        program:
          allOf:
            - $ref: '#/components/schemas/ProgramCode'
          description: Registry name.
        vintage:
          $ref: '#/components/schemas/Vintage'
        markets:
          type: array
          description: Optional property. Use `include` param.
          items:
            $ref: '#/components/schemas/InstrumentMarket'
        creditType:
          type: string
          description: The type of the credit.
      discriminator:
        propertyName: type
        mapping:
          CARBON: '#/components/schemas/CarbonInstrument'
          REC: '#/components/schemas/RecInstrument'
          RESOURCE_PROJECT: '#/components/schemas/ResourceInstrument'
    CarbonInstrument:
      allOf:
        - $ref: '#/components/schemas/BaseInstrument'
        - type: object
          required:
            - project
          properties:
            serialNumber:
              type: string
            issuanceCertifications:
              type: array
              description: Optional property. Use `include` param.
              items:
                $ref: '#/components/schemas/IssuanceCertification'
            projectCertifications:
              type: array
              description: Optional property. Use `include` param.
              items:
                $ref: '#/components/schemas/ProjectCertification'
            reportingPeriodStart:
              type: string
              format: date-time
              description: Reporting period start date.
            reportingPeriodEnd:
              type: string
              format: date-time
              description: Reporting period end date.
            project:
              $ref: '#/components/schemas/Project'
    RecInstrument:
      allOf:
        - $ref: '#/components/schemas/BaseInstrument'
        - type: object
          required:
            - generator
          properties:
            fuelType:
              $ref: '#/components/schemas/FuelType'
            stateEligibilities:
              type: array
              description: Optional property. Use `include` param.
              items:
                type: object
                description: >-
                  Object to hold full state eligibility information - type of
                  eligibility and name
                properties:
                  name:
                    type: string
                    description: Name of the state eligibility.
                  type:
                    allOf:
                      - $ref: '#/components/schemas/StateEligibilityType'
                    description: >-
                      The state eligibilities associated with the additional
                      fuel types.
            voluntaryEligibilities:
              type: array
              description: Optional property. Use `include` param.
              items:
                $ref: '#/components/schemas/VoluntaryEligibility'
            generator:
              $ref: '#/components/schemas/Generator'
    ResourceInstrument:
      allOf:
        - $ref: '#/components/schemas/BaseInstrument'
        - type: object
          required:
            - resourceProject
          properties:
            serialNumber:
              type: string
            inType:
              type: string
              description: Ref.Data.RESOURCE_IN_TYPE
            outType:
              type: string
              description: Ref.Data.RESOURCE_OUT_TYPE
            resourceProject:
              $ref: '#/components/schemas/ResourceProject'
    Instrument:
      oneOf:
        - $ref: '#/components/schemas/CarbonInstrument'
        - $ref: '#/components/schemas/RecInstrument'
        - $ref: '#/components/schemas/ResourceInstrument'
    MarketModelInstrumentPrice:
      properties:
        amount:
          type: number
          format: double
          description: Amount.
        currency:
          type: string
          description: Currency (USD etc...).
        lastUpdatedDate:
          type: string
          format: date-time
          description: Last updated date-time.
    MarketModelInstrument:
      properties:
        ein:
          type: string
          description: >
            Environment Instrument Number. Unique identifier associated with an
            issuance of credits from a given project,  vintage, technology/fuel
            type and associated certification(s)/eligibility(s).  An EIN is
            associated with a position and a position will never be associated
            with more than 1 EIN.
        description:
          type: string
          description: Description.
        price:
          $ref: '#/components/schemas/MarketModelInstrumentPrice'
    InstrumentMarket:
      properties:
        market:
          $ref: '#/components/schemas/Market'
        marketModelInstrument:
          $ref: '#/components/schemas/MarketModelInstrument'
    Market:
      properties:
        name:
          type: string
          description: Name of the market.
        apiCode:
          type: string
          description: API code for market execution venue.
        applicableExecutionVenues:
          type: array
          items:
            type: string
            description: Code for applicable venue.
        applicablePrograms:
          type: array
          items:
            $ref: '#/components/schemas/ProgramCode'
    DepositStatus:
      type: string
      description: The current status of the deposit in relation to the execution venue.
      enum:
        - PENDING
        - DEPOSITED
        - REJECTED
    TransferStatus:
      type: string
      enum:
        - NEW
        - INCOMING
        - PENDING_APPROVAL
        - APPROVED
        - REJECTED
        - SETTLED
        - SETTLEMENT_FAILURE
        - CANCELLED
        - WITHDRAWN
        - SETTLED_AS_FORWARD_TRANSFER
        - PENDING_CANCELLATION
        - EXPIRED
        - PENDING_SETTLEMENT
        - PENDING_CUSTODIAN_TRANSFER
    RegistryTransferStatus:
      type: string
      enum:
        - NEW
        - PENDING_CONFIRMATION
        - CONFIRMED
        - REJECTED
        - WITHDRAWN
        - EXPIRED
        - FAILED
        - PLACE_READY
        - CONFIRM_READY
        - REJECT_READY
        - WITHDRAW_READY
        - PLACE_ERROR
        - CONFIRM_ERROR
        - REJECT_ERROR
        - WITHDRAW_ERROR
    TransferType:
      type: string
      enum:
        - BUY
        - SELL
    RegistryTransferPurpose:
      type: string
      enum:
        - SPOT
        - LONG
        - REPORTING
    TransferDataStrategy:
      type: object
      required:
        - transferDataType
        - taxLotSelectionStrategy
        - quantity
      properties:
        transferDataType:
          type: string
          default: STRATEGY
        taxLotSelectionStrategy:
          type: string
          enum:
            - NEWEST_TAX_LOT_FIRST
            - OLDEST_TAX_LOT_FIRST
            - LARGEST_TAX_LOT_FIRST
            - SMALLEST_TAX_LOT_FIRST
        quantity:
          type: integer
          format: int64
          minimum: 1
    TransferDataTaxLots:
      type: object
      title: TransferDataTaxLots
      required:
        - transferDataType
        - taxLots
      properties:
        transferDataType:
          type: string
          default: TAX_LOTS
        taxLots:
          type: array
          items:
            type: object
            required:
              - taxLotId
              - quantity
            properties:
              taxLotId:
                type: integer
                format: int64
              quantity:
                type: integer
                format: int64
                minimum: 1
    PortfolioAction:
      type: object
      properties:
        fieldName:
          type: string
          description: Denotes how the transaction was initiated.
          example: batchType
        label:
          type: string
          description: Description of the fieldName.
          example: Batch type
        defaultValue:
          type: string
          description: Denotes the type of transaction.
          example: CBL SIP Deposit
        required:
          type: boolean
          example: true
        values:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
                description: Value associated with the transaction.
                example: '100'
              name:
                type: string
                description: Description of the transaction type.
                example: CBL SIP Deposit
              dependencies:
                type: array
                example: project, market etc.
                items:
                  $ref: '#/components/schemas/PortfolioAction'
    ForwardContract:
      type: object
      properties:
        volume:
          type: integer
          format: int64
          description: Delivered volume.
        unitPrice:
          allOf:
            - $ref: '#/components/schemas/Price'
          description: Delivered price.
        value:
          allOf:
            - $ref: '#/components/schemas/Price'
          description: Delivered value.
    ForwardInstrumentAttributeBundle:
      type: object
      properties:
        type:
          type: string
          default: BUNDLE
        attributeBundle:
          type: object
          properties:
            name:
              type: string
              description: Bundle name.
            dateRange:
              $ref: '#/components/schemas/ForwardDateRange'
            market:
              $ref: '#/components/schemas/ForwardMarket'
            projects:
              type: array
              items:
                type: object
                properties:
                  upn:
                    type: string
                    description: >
                      Universal Project Identifier. The unique identifier
                      assigned to every resource across all registries that 
                      have integrated with Xpansiv Connect.
                  fuelType:
                    $ref: '#/components/schemas/ForwardFuelType'
    ForwardInstrumentMarketModelInstrument:
      type: object
      properties:
        type:
          type: string
          default: MMI
        marketModelInstrument:
          type: object
          properties:
            dateRange:
              $ref: '#/components/schemas/ForwardDateRange'
            market:
              $ref: '#/components/schemas/ForwardMarket'
    ForwardDateRange:
      type: object
      properties:
        startMonth:
          type: integer
          format: int32
          description: Month of delivery start.
        startYear:
          type: integer
          format: int32
          description: Year of delivery start.
        endMonth:
          type: integer
          format: int32
          description: Month of delivery end.
        endYear:
          type: integer
          format: int32
          description: Year of delivery end.
    ForwardMarket:
      type: object
      properties:
        code:
          type: string
          description: Instrument code.
        name:
          type: string
          description: Instrument name.
    ForwardFuelType:
      type: object
      properties:
        code:
          type: string
          description: Fuel type code.
        registryCode:
          type: string
          description: Registry fuel type code.
    ForwardStatusEvent:
      type: object
      properties:
        action:
          type: string
          description: Action for the statusEvent.
        notes:
          type: string
          description: Notes for the statusEvent.
        timestamp:
          type: string
          format: date-time
          description: Timestamp for the statusEvent.
        user:
          type: string
          description: User for the statusEvent.
  parameters:
    AccountIdentifier:
      description: Account identifier
      name: AccountIdentifier
      example: 098B0A25
      in: path
      required: true
      schema:
        type: string
    ExchangeCode:
      name: ExchangeCode
      description: Exchange code
      in: path
      required: true
      schema:
        type: string
        example: CBL , RVCMC
    ExecutionVenueCode:
      name: ExecutionVenueCode
      description: Ref.Data.EXECUTION_VENUE
      in: path
      required: true
      schema:
        type: string
    PageNumber:
      name: page
      in: query
      required: false
      schema:
        type: integer
        format: int32
    PageSize:
      name: size
      in: query
      required: false
      schema:
        type: integer
        format: int32
    Include:
      name: include
      description: Comma-separated values from optional response fields
      in: query
      required: false
      schema:
        type: string
    ProgramCode:
      name: ProgramCode
      description: Any program code. Ref.Data.REGISTRY_PROGRAM_REGI
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ProgramCode'
    RetirementProgramCode:
      description: Program code allowed for retirements
      name: RetirementProgramCode
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/RetirementProgramCode'
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
  responses:
    '401':
      description: Not authorized error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotAuthorizedError'
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundError'
    '500':
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'
