swagger: '2.0'
info:
  title: Cards
  description: |
    Monitor and manage debit cards associated with a bank account.

    This API defines models and operations for the following resources:

      * ***Card Requests*** represent customer-initiated requests for new
        cards or for replacements for lost, stolen, or damaged cards.
      * ***Cards*** represent physical debit cards issued by the
        financial institution (FI)
        to the bank customer. A card is associated with a deposit account.

    This API provides the following features to customers (the card holder):

      * List their cards and other cards on accounts, optionally filtered by account
      * View the details of each card, including its state and associated banking account number
      * Request a new card for an account
      * Lock a card so that it may not be used until the customer unlocks it
      * Unlock a card
      * Report a card as lost, stolen, or damaged
      * Close (cancel) a card
      * Request a replacement card for a lost, stolen, or damaged card
      * Review the status of their new or replacement card requests

    Only the card holder (the individual the card is issued to) may
    access the card control and card replacement operations.

    This API provides the following features to financial institution
    administrative users:

      * Reject a user's card request

    Addirtionally, administrative users may perform the following operations
    on behalf of the customer:

      * Create new or replacement cards
      * Activate a new or replacement card
      * Lock or unlock cards
      * Close (cancel) a card

    # Error Types

        Error responses in this API may have one of the following `type` values.

        

    <h2 class='errorType' id="err-cardRequestRefNotFound">cardRequestRefNotFound</h2>

    Description: The request card request resource ID does not identify a card.

    Remediation: Pass the ID of an existing card request resource.


    <h2 class='errorType' id="err-cardRefNotFound">cardRefNotFound</h2>

    Description: The request card resource ID does not identify a card.

    Remediation: Pass the ID of an existing card resource.


    <h2 class='errorType' id="err-invalidUserRef">invalidUserRef</h2>

    Description: The request user resource ID does not identify a user.

    Remediation: Pass the ID of an existing user resource.


    <h2 class='errorType' id="err-invalidAccountRef">invalidAccountRef</h2>

    Description: The request account resource ID does not identify an account.

    Remediation: Pass the ID of an existing account resource.
  version: 0.12.0
  contact:
    name: Apiture
    url: 'https://developer.apiture.com'
    email: api@apiture.com
  termsOfService: 'https://developer.apiture.com/docs/Apiture-Open-API-License-Agreement.pdf'
schemes:
  - https
basePath: /cards
consumes:
  - application/hal+json
  - application/json
produces:
  - application/hal+json
  - application/json
securityDefinitions:
  apiKey:
    type: apiKey
    name: API-Key
    in: header
    description: >-
      API Key based authentication. Each client application must pass its private, unique API key, allocated in the developer portal, via the
      `API-Key: {api-key}` request header.
  accessToken:
    type: oauth2
    flow: accessCode
    description: >-
      OAuth2 client access token authentication. The client authenticates against the server at `authorizationUrl`, passing the client's private
      `clientId` (and optional `clientSecret`) as part of this flow. The client obtains an access token from the server at `tokenUrl`. It then passes
      the received access token via the `Authorization: Bearer {access-token}` header in subsequent API calls. The authorization process also returns
      a refresh token which the client should use to renew the access token before it expires.
    authorizationUrl: 'https://auth.apiture.com/oauth2/authorize'
    tokenUrl: 'http://auth.apiture.com/auth/oauth2/token'
    scopes:
      card/read: Read access to cards and card replacements.
      card/write: Write (update) access to cards and card replacements.
      card/delete: Delete access to cards and card replacements.
      card/full: Full access to cards and card replacements.
      admin/write: Administrative write (update) access to cards and card replacements.
tags:
  - name: Card Requests
    description: Requests to Issue New or Replacement Cards
  - name: Card Request Actions
    description: Actions on Card Requests
  - name: Cards
    description: Debit Cards Issued by the Financial Institution
  - name: Card Actions
    description: Actions on Debit cards
  - name: API
    description: The Cards API
paths:
  /cardRequests:
    get:
      summary: Return a collection of card requests
      description: |-
        Return a
        [paginated](http://developer.apiture.com/docs/concepts/pagination)
        [sortable](http://developer.apiture.com/docs/concepts/sorting)
        [filterable](http://developer.apiture.com/docs/concepts/filtering)
        [searchable](http://developer.apiture.com/docs/concepts/searching)
        collection of requests for new or replacement card. The
        [links](http://developer.apiture.com/docs/concepts/links) in the
        response include pagination links.


        For financial institution customers, this collection only returns card requests
        that the customer has created or which apply to their cards.
      operationId: getCardRequests
      tags:
        - Card Requests
      x-apiture-traits:
        sortBy:
          - state
          - submittedAt
          - resolvedAt
          - updatedAt
        filters:
          description:
            filter:
              - contains
              - search
          resolutionReason:
            filter:
              - contains
              - search
          state:
            filter:
              - eq
              - ne
              - in
          submittedOn:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - in
            as: date(submittedAt)
          resolvedOn:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - in
            as: date(resolveAt)
          modifiedOn:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - in
            as: date(updatedAt)
          updatedAt:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
            multiMatch: false
          updatedBy:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first card request item to include in this page. The default 0 denotes the beginning of the collection.
          type: integer
          format: int64
          default: 0
        - name: limit
          in: query
          description: The maximum number of card request representations to return in this page.
          type: integer
          format: int32
          default: 100
        - name: sortBy
          in: query
          type: string
          description: 'Optional sort criteria. See [sort criteria format](http://developer.apiture.com/docs/concepts/sorting), such as `?sortBy=field1,-field2`.'
        - $ref: '#/parameters/filterQueryParam'
        - $ref: '#/parameters/qQueryParam'
        - name: state
          in: query
          type: string
          enum:
            - pending
            - submitted
            - canceled
            - rejected
            - completed
          description: >-
            Filter responses to list only cards in the listed `state` or `|`-separated set of states. Examples: `?state=submitted` ,
            `?state=canceled|completed|rejected`
        - name: submittedOn
          in: query
          type: string
          format: date
          description: >-
            Filter the response to card requests submitted on this date or set of `|`-separated dates. Dates are in [RFC
            3339](https://tools.ietf.org/html/rfc3339) YYYY-MM-DD format. Examples: `?submittedDate=2019-06-10` or
            `?submittedDate=2019-06-10|2019-06-08|2019-06-07`
        - name: modifiedOn
          in: query
          type: string
          format: date
          description: >-
            Filter the response to card requests last modified on this date or set of `|`-separated dates. Dates are in [RFC
            3339](https://tools.ietf.org/html/rfc3339) YYYY-MM-DD format. Examples: `?modifiedOn=2019-06-10` or
            `?modifiedOn=2019-06-10|2019-06-08|2019-06-07`
        - name: resolvedOn
          in: query
          type: string
          format: date
          description: >-
            Filter the response to card requests resolved on this date or set of `|`-separated dates. Dates are in [RFC
            3339](https://tools.ietf.org/html/rfc3339) YYYY-MM-DD format. Examples: `?resolvedOn=2019-06-10` or
            `?resolvedOn=2019-06-10|2019-06-08|2019-06-07`
        - name: updatedBy
          in: query
          type: string
          description: Filter the response to card requests created by the user named by this user ID.
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/cardRequests'
        '400':
          $ref: '#/responses/400'
        '422':
          $ref: '#/responses/422'
      security:
        - apiKey: []
          accessToken:
            - card/read
    post:
      summary: Request a new or replacement card
      description: 'Request a new or replacement card by creating a new card request resource,  adding it to the `cardRequests` collection.'
      operationId: createCardRequest
      tags:
        - Card Requests
      parameters:
        - name: cardRequest
          in: body
          description: The data necessary to create a new card request resource.
          required: true
          schema:
            $ref: '#/definitions/createCardRequest'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/cardRequest'
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              type: string
              format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400'
      security:
        - apiKey: []
          accessToken:
            - card/write
  '/cardRequests/{cardRequestId}':
    get:
      summary: Fetch a representation of this card request
      description: 'Return a [HAL](http://developer.apiture.com/docs/concepts/hal) representation of this card request resource.'
      operationId: getCardRequest
      tags:
        - Card Requests
      parameters:
        - $ref: '#/parameters/cardRequestIdPathParam'
        - $ref: '#/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/cardRequest'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this card request resource.
              type: string
        '304':
          $ref: '#/responses/304'
        '404':
          $ref: '#/responses/404CardRequest'
      security:
        - apiKey: []
          accessToken:
            - card/read
    delete:
      summary: Delete this card request resource
      description: >-
        Delete this card request resource and any resources that are owned by it. This effectively cancels the card request request if the request has
        not been processed.
      operationId: deleteCardRequest
      x-apiture-implemented: false
      tags:
        - Card Requests
      parameters:
        - $ref: '#/parameters/cardRequestIdPathParam'
      responses:
        '204':
          $ref: '#/responses/204Deleted'
      security:
        - apiKey: []
          accessToken:
            - card/delete
  /completedCardRequests:
    post:
      operationId: completeCardRequest
      summary: Complete a card request
      description: >-
        Mark a card request as completed when the card has been issued. This changes the `state` property of the card request to `completed`. This
        operation is available via the `apiture:complete` link on the card request resource, if and only if the card request is eligible for the
        complete operation. Only the FI admin may invoke this operation. The response is the updated representation of the card request. The
        `If-Match` request header value must match the current entity tag value of the card request.
      tags:
        - Card Requests Actions
      parameters:
        - $ref: '#/parameters/cardRequestQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card request was updated and its `state` changed to `completed`.
          schema:
            $ref: '#/definitions/cardRequest'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400CompleteCardRequest'
        '409':
          $ref: '#/responses/409CompleteCardRequestConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - admin/write
  /rejectedCardRequests:
    post:
      operationId: rejectCardRequest
      summary: Reject a card request
      description: |-
        Mark a card request as _rejected_.
        This changes the `state` property of the card request to `rejected`.
        Only the FI admin may invoke this operation.


        This operation is available via the `apiture:reject` link on the card
        request resource, if and only if the card request is eligible for the
        reject operation. The response is the updated representation of the
        card request. The `If-Match` request header value, if passed, must match the current
        entity tag value of the card request.
      tags:
        - Card Requests Actions
      parameters:
        - $ref: '#/parameters/cardRequestQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card request was updated and its `state` changed to `rejected`.
          schema:
            $ref: '#/definitions/cardRequest'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400RejectCardRequest'
        '409':
          $ref: '#/responses/409RejectCardRequestConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - admin/write
  /canceledCardRequests:
    post:
      operationId: cancelCardRequest
      summary: Cancel a card request
      description: >-
        Cancel a card replacement request. This changes the `state` property of the card request to `canceled`. This operation is available via the
        `apiture:cancel` link on the card request resource, if and only if the card request is eligible for the cancel operation. The response is the
        updated representation of the card request. The `If-Match` request header value, if passed, must match the current entity tag value of the
        card request.
      tags:
        - Card Requests Actions
      parameters:
        - $ref: '#/parameters/cardRequestQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card request was updated and its `state` changed to `canceled`.
          schema:
            $ref: '#/definitions/cardRequest'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400CancelCardRequest'
        '409':
          $ref: '#/responses/409CancelCardRequestConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - card/write
  /cards:
    get:
      summary: Return a collection of cards
      description: |-
        Return a
        [paginated](http://developer.apiture.com/docs/concepts/pagination)
        [sortable](http://developer.apiture.com/docs/concepts/sorting)
        [filterable](http://developer.apiture.com/docs/concepts/filtering)
        [searchable](http://developer.apiture.com/docs/concepts/searching)
        collection of cards for the user's accounts or the subset of those cards that
        satisfy the filter crieria.
        [links](http://developer.apiture.com/docs/concepts/links) in the
        response include pagination links.


        For an account owner or joint owner of a personal account, the default response
        includes all cards issued to all primary or joint owners of the account.
        For authorized signers on business accounts, the default response
        incldues cards for all authorized signers for that account.


        There is another version of this operation which allows
        getting a list of cards based on the query constraints
        passed in the request body; see the `getCardsForAccount` operation.
      operationId: getCards
      tags:
        - Cards
      x-apiture-traits:
        sortBy:
          - accountName
          - state
          - replacementState
          - updatedAt
        filters:
          account:
            filter:
              - eq
              - ne
              - in
          accountName:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          accountCategory:
            filter:
              - eq
              - ne
              - in
          accountType:
            filter:
              - eq
              - ne
              - in
          state:
            filter:
              - eq
              - ne
              - in
          replacementState:
            filter:
              - eq
              - ne
              - in
          updatedAt:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
            multiMatch: false
          modifiedOn:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - in
            as: date(updatedAt)
          issuedOn:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - in
            as: date(issuedAt)
          expiresOn:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - in
            as: date(expiresAt)
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first card item to include in this page. The default 0 denotes the beginning of the collection.
          type: integer
          format: int64
          default: 0
        - name: limit
          in: query
          description: The maximum number of card representations to return in this page.
          type: integer
          format: int32
          default: 100
        - name: sortBy
          in: query
          type: string
          description: 'Optional sort criteria. See [sort criteria format](http://developer.apiture.com/docs/concepts/sorting), such as `?sortBy=field1,-field2`.'
        - $ref: '#/parameters/filterQueryParam'
        - $ref: '#/parameters/qQueryParam'
        - $ref: '#/parameters/unmaskedQueryParam'
        - name: mine
          description: 'If `true`, limit the response to only cards issued to the user making the request.'
          type: boolean
          in: query
          default: false
        - name: account
          in: query
          type: string
          description: >-
            Filter cards to only those for the account with the account ID named in this query parameter. (By default, the list is pre-filtered to
            only accounts that the user has access to; this further narrows that list. FI admins can use this to view cards for a user.) This can
            match exactly one account ID, or a set of `|`-separated IDs This parameter is mutually exclusive with `?accountName=`. Examples:
            `?account=d8631e97-e9d7-4902-bf19-a223db933809` or `?account=d8631e97-e9d7-4902-bf19-a223db933809|493e36b3-4545-48ca-a1e0-fd89d651283b`.
        - name: accountName
          in: query
          type: string
          description: >-
            Filter cards to those whose account name matches this value. This can match exactly one account name, or a set of `|`-separated names.
            This parameter is mutually exclusive with `?account=`. Examples: `?accountName=My%20Basic%20Savings` or
            `?accountName=My%20Basic%20Savings|My%20Joint%02Savings`.
        - name: accountType
          in: query
          type: string
          description: >-
            Filter cards based whose corresponding account type matches this value. This can match exactly one type, or a set of `|`-separated states.
            Examples: `?accountCategory=SDA` , `?accountCategory=SDA|DDA`
        - name: accountCategory
          in: query
          type: string
          description: >-
            Filter cards based whose corresponding account category matches this value. This can match exactly one category, or a set of `|`-separated
            states. Examples: `?accountCategory=Savings` , `?accountCategory=Savings|Checking`
        - name: state
          in: query
          description: >-
            Filter cards on the state of the card. This can match exactly one state, or a set of `|`-separated states. Examples: `?state=requested` ,
            `?state=lost|stolen|damaged`.
          type: string
          enum:
            - requested
            - issued
            - active
            - locked
            - lost
            - stolen
            - damaged
            - closed
        - name: replacementState
          in: query
          type: string
          enum:
            - none
            - requested
            - replacedWithSameNumber
            - replacedWithNewNumber
          description: >-
            Filter the response to card by the state of their replacement states. This can match exactly one state, or a set of `|`-separated states.
            Examples: `?replacementState=requested` , `?replacementState=replacedWithSameNumber|replacedWithNewNumber`
        - name: modifiedOn
          in: query
          type: string
          format: date
          description: >-
            Filter the response to cards last modified on this date or set of `|`-separated dates. Dates are in [RFC
            3339](https://tools.ietf.org/html/rfc3339) YYYY-MM-DD format. Examples: `?modifiedOn=2019-06-10` ,
            `?modifiedOn=2019-06-10|2019-06-08|2019-06-07`
        - name: issuedOn
          in: query
          type: string
          format: date
          description: >-
            Filter the response to cards issued on this date or set of `|`-separated dates. Dates are in [RFC
            3339](https://tools.ietf.org/html/rfc3339) YYYY-MM-DD format. Examples: `?issuedOn=2019-06-10` ,
            `?issuedOn=2019-06-10|2019-06-08|2019-06-07`
        - name: updatedBy
          in: query
          type: string
          description: Filter the response to card requests created by the user named by this user ID.
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/cards'
        '400':
          $ref: '#/responses/400'
        '422':
          $ref: '#/responses/422'
      security:
        - apiKey: []
          accessToken:
            - card/read
    post:
      summary: Create a new card
      description: >-
        Create a new card resource that represents a physical debit card. The URI to the associated account should be passed in the request in the
        link named `apiture:account'. Only administrative applications can create cards.
      operationId: createCard
      x-apiture-implemented: false
      tags:
        - Cards
      parameters:
        - name: card
          in: body
          description: The data necessary to create a new card.
          required: true
          schema:
            $ref: '#/definitions/createCard'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/card'
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              type: string
              format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400'
      security:
        - apiKey: []
          accessToken:
            - admin/write
  '/cards/{cardId}':
    get:
      summary: Fetch a representation of this card
      description: 'Return a [HAL](http://developer.apiture.com/docs/concepts/hal) representation of this card resource.'
      operationId: getCard
      tags:
        - Cards
      parameters:
        - $ref: '#/parameters/cardIdPathParam'
        - $ref: '#/parameters/ifNoneMatchHeaderParam'
        - $ref: '#/parameters/unmaskedQueryParam'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/card'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this card resource.
              type: string
        '304':
          $ref: '#/responses/304'
        '404':
          $ref: '#/responses/404Card'
      security:
        - apiKey: []
          accessToken:
            - card/read
  /activeCards:
    post:
      operationId: activateCard
      summary: Activate a card
      description: |-
        Activate a card so a customer can use it and change the card's `state` property to `active`.
        Services or administrative users may activate a `requested` card after a card
        request has been approved. Customers may _not_ use this operation for
        activating new cards.


        This operation is available via the `apiture:activate` link on the card
        resource, if and only if the activation operation is available. The
        response is the updated representation of the card. The `If-Match`
        request header value must match the current entity tag value of the
        card.
      tags:
        - Card Actions
      parameters:
        - $ref: '#/parameters/cardsQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card was updated and its `state` changed to `active`.
          schema:
            $ref: '#/definitions/card'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400ActivateCard'
        '409':
          $ref: '#/responses/409ActivateCardConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - card/write
  /lockedCards:
    post:
      operationId: lockCard
      summary: Lock a card
      description: |-
        Lock a card so that it cannot be used for debits or other financial activity.
        (This differs from locking the entire account.) This is also referred to
        a _placing a hold on the card_.
        This is one step before reporting a card as lost or stolen. A user can
        unlock the card (restore it to the normal, active state) by using the
        `apiture:unlock` link which invokes the
        [`unlockCard`](#op-unlockCard) operation.
        This is a self-service operation which a card holder may take if they
        want to prevent fraudulent use of the card, such as if they have
        misplaced it (but expect to find it again), or will be out of the
        country.


        This operation changes the `state` property of the card to `locked`.
        This operation is available via the `apiture:lock` link on the card
        resource, if and only if the card is eligible for the lock operation.
        The response is the updated representation of the card. The `If-Match`
        request header value must match the current entity tag value of the
        card.


        Only the card holder or an admin can lock a card.
      tags:
        - Card Actions
      parameters:
        - $ref: '#/parameters/cardsQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card was updated and its `state` changed to `locked`.
          schema:
            $ref: '#/definitions/card'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400LockCard'
        '409':
          $ref: '#/responses/409LockCardConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - card/write
  /unlockedCards:
    post:
      operationId: unlockCard
      summary: Unlock a card
      description: |-
        Unlock a locked card so that it can be used for debits or other financial activity.
        This changes the `state` property of the card back to
        `active`. This operation is available via the `apiture:unlock`
        link on the card resource, if and only if the card is currently `locked`.
        The response is the updated representation of the
        card. The `If-Match` request header value, if passed, must match the current entity
        tag value of the card.


        Only the card holder or an admin can unlock a card.
      tags:
        - Card Actions
      parameters:
        - $ref: '#/parameters/cardsQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card was updated and its `state` changed to `active`.
          schema:
            $ref: '#/definitions/card'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400UnlockCard'
        '409':
          $ref: '#/responses/409UnlockCardConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - card/write
  /closedCards:
    post:
      operationId: closeCard
      summary: Close a card
      description: >-
        Close a card by adding it to the set of closed cards. This changes the `state` property of the card to `closed`. This operation is available
        via the `apiture:close` link on the card resource, if and only if the card is eligible for the close operation. The response is the updated
        representation of the card. The `If-Match` request header value, if passed, must match the current entity tag value of the card.


        Only the card holder or an admin can close a card.
      tags:
        - Card Actions
      parameters:
        - $ref: '#/parameters/cardsQueryParam'
        - $ref: '#/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK. The operation succeeded. The card was updated and its `state` changed to `closed`.
          schema:
            $ref: '#/definitions/card'
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              type: string
        '400':
          $ref: '#/responses/400CloseCard'
        '409':
          $ref: '#/responses/409CloseCardConflict'
        '412':
          $ref: '#/responses/412'
      security:
        - apiKey: []
          accessToken:
            - card/write
  /labels:
    get:
      summary: Localized Labels
      description: >-
        Return a JSON object which defines labels for enumeration types defined by the schemas defined in this API. The labels in the response may not
        all match the requested language; some may be in the default language (`en-us`).
      operationId: getLabels
      security:
        - apiKey: []
      parameters:
        - name: Accept-Language
          in: header
          type: string
          description: >-
            The weighted language tags which indicate the user's preferred natural language for the localized labels in the response, as per [RFC
            7231](https://tools.ietf.org/html/rfc7231#section-5.3.5).
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/localizedLabels'
      tags:
        - API
  /:
    get:
      summary: Top-level resources and operations in this API
      description: Return links to the top-level resources and operations in this API.
      operationId: getApi
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/root'
      tags:
        - API
      security:
        - apiKey: []
      parameters: []
  /apiDoc:
    get:
      summary: Return API definition document
      description: Return the OpenAPI document that describes this API.
      operationId: getApiDoc
      produces:
        - application/json
        - application/openapi+json;version=2.0
        - application/openapi+yaml;version=2.0
      responses:
        '200':
          description: OK
          schema:
            type: object
      tags:
        - API
      security:
        - apiKey: []
      parameters: []
parameters:
  cardRequestQueryParam:
    name: cardRequest
    required: true
    in: query
    type: string
    description: >-
      A string which uniquely identifies a card request which is to added to the canceled card requests resource set. This may be the unique
      cardRequestId or the URI of the card request.
  unmaskedQueryParam:
    name: unmasked
    description: |-
      For `?unmasked=true`, the response body includes the full banking account
      number (accountNumbers.full`) for each of the requested cards.
      For security reasons, the response includes only a _masked_ account number (consisting of
      asterisks and the last four digits of the number) for
      partial identification purposes. Such requests are auditable.


      Note that card numbers are _always_ masked.
    type: boolean
    in: query
    required: false
    default: false
  cardsQueryParam:
    name: card
    required: true
    in: query
    type: string
    description: 'A string which uniquely identifies a card. This may be the unique `{cardId}` or the URI of the card.'
  cardRequestIdPathParam:
    name: cardRequestId
    description: The unique identifier of this card request resource. This is an opaque string.
    in: path
    type: string
    required: true
  filterQueryParam:
    name: filter
    in: query
    description: 'Optional filter criteria. See [filtering](http://developer.apiture.com/docs/concepts/filtering).'
    type: string
  qQueryParam:
    name: q
    in: query
    description: 'Optional search string. See [searching](http://developer.apiture.com/docs/concepts/searching).'
    type: string
  cardIdPathParam:
    name: cardId
    description: The unique identifier of this card. This is an opaque string.
    in: path
    type: string
    required: true
  ifMatchHeaderParam:
    name: If-Match
    description: The entity tag that was returned in the `ETag` response. This must match the current entity tag of the resource.
    in: header
    type: string
    required: true
  ifNoneMatchHeaderParam:
    name: If-None-Match
    description: >-
      The entity tag that was returned in the `ETag` response. If the resource's current entity tag matches, the `GET` will return 304 (Not Modified)
      and no response body, else the resource representation will be returned.
    in: header
    type: string
  typeIdPathParam:
    name: typeId
    description: The unique identifier of this policy type. This is the policy name.
    in: path
    type: string
    required: true
responses:
  '304':
    description: Not Modified. The resource has not been modified since it was last fetched.
  '400':
    description: >-
      Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will contain
      details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  '412':
    description: >-
      Precondition Failed. The supplied `if-Match` header value does not match the most recent `ETag` response header value. The resource has changed
      in the interim.
    schema:
      $ref: '#/definitions/errorResponse'
  '422':
    description: >-
      Unprocessable Entity. One or more of the query parameters was well formed but otherwise invalid. The `_error` field in the response will contain
      details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  400CompleteCardRequest:
    description: |-
      Bad Request. The cardRequest parameter was malformed or does not refer to an existing or accessible card request.

      This error response may have one of the following `type` values:
      * [`cardRequestRefNotFound`](#err-cardRequestRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRequestRefNotFound
  409CompleteCardRequestConflict:
    description: >-
      Conflict. The request to complete the card request is not allowed. The `_error` field in the response will contain details about the request
      error.
    schema:
      $ref: '#/definitions/errorResponse'
  400RejectCardRequest:
    description: |-
      Bad Request. The cardRequest parameter was malformed or does not refer to an existing or accessible card request.

      This error response may have one of the following `type` values:
      * [`cardRequestRefNotFound`](#err-cardRequestRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRequestRefNotFound
  409RejectCardRequestConflict:
    description: >-
      Conflict. The request to reject the card request is not allowed. The `_error` field in the response will contain details about the request
      error.
    schema:
      $ref: '#/definitions/errorResponse'
  400CancelCardRequest:
    description: |-
      Bad Request. The cardRequest parameter was malformed or does not refer to an existing or accessible card request.

      This error response may have one of the following `type` values:
      * [`cardRequestRefNotFound`](#err-cardRequestRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRequestRefNotFound
  409CancelCardRequestConflict:
    description: >-
      Conflict. The request to cancel the card request is not allowed. The `_error` field in the response will contain details about the request
      error.
    schema:
      $ref: '#/definitions/errorResponse'
  400UnlockCard:
    description: |-
      Bad Request. The card parameter was malformed or does not refer to an existing or accessible card.

      This error response may have one of the following `type` values:
      * [`cardRefNotFound`](#err-cardRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRefNotFound
  409UnlockCardConflict:
    description: Conflict. The request to unlock the card is not allowed. The `_error` field in the response will contain details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  400CloseCard:
    description: |-
      Bad Request. The card parameter was malformed or does not refer to an existing or accessible card.

      This error response may have one of the following `type` values:
      * [`cardRefNotFound`](#err-cardRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRefNotFound
  409CloseCardConflict:
    description: Conflict. The request to close the card is not allowed. The `_error` field in the response will contain details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  400LockCard:
    description: |-
      Bad Request. The card parameter was malformed or does not refer to an existing or accessible card.

      This error response may have one of the following `type` values:
      * [`cardRefNotFound`](#err-cardRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRefNotFound
  409LockCardConflict:
    description: Conflict. The request to lock the card is not allowed. The `_error` field in the response will contain details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  400ActivateCard:
    description: |-
      Bad Request. The card parameter was malformed or does not refer to an existing or accessible card.

      This error response may have one of the following `type` values:
      * [`cardRefNotFound`](#err-cardRefNotFound)
    schema:
      $ref: '#/definitions/errorResponse'
    x-apiture-errors:
      - cardRefNotFound
  409ActivateCardConflict:
    description: Conflict. The request to activate the card is not allowed. The `_error` field in the response will contain details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  404CardRequest:
    description: >-
      Not Found. There is no such card card request resource at the specified `{cardRequestId}`. The `_error` field in the response will contain
      details about the request error.
    schema:
      $ref: '#/definitions/errorResponse'
  404Card:
    description: >-
      Not Found. There is no such card resource at the specified `{cardId}`. The `_error` field in the response will contain details about the request
      error.
    schema:
      $ref: '#/definitions/errorResponse'
  204Deleted:
    description: No Content. The resource was deleted successfully.
definitions:
  createCard:
    title: Create Card (v1.0.0)
    description: |-
      Representation used to create a new card.

      This schema is version `v1.0.0`.
    required:
      - accountName
    example:
      _profile: 'https://api.apiture.com/schemas/cards/card/v1.0.0/profile.json'
      accountName: My Premiere Savings
      _links:
        'apiture:account':
          href: /accounts/accounts/e7076b86-0f0b-4126-92eb-d90f4be1ae6a
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
      - $ref: '#/definitions/cardFields'
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      accountName:
        description: The name of the account that this card is tied to.
        type: string
        minLength: 1
        maxLength: 128
        example: Premiere Checking
        readOnly: true
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. This is derived from the account used in the initial
          card request. By default, only the `masked` number is returned; use `?unmasked=true` to reveal the `full` account number.
        allOf:
          - $ref: '#/definitions/accountNumbers'
        readOnly: true
      accountCategory:
        description: 'The category of the account, such as `Savings` or `Checking`. This is derived from the product associated with the account for this card.'
        type: string
        readOnly: true
        example: Checking
      accountType:
        description: 'The type of the account, such as `CDA` or `DDA` for savings and checking (demand deposit accounts).'
        allOf:
          - $ref: '#/definitions/ifxType'
        readOnly: true
    type: object
    x-apiture-flattened: true
  summaryCard:
    title: Card Summary (v1.0.0)
    description: >-
      Summary representation of a card resource in cards collections. This representation normally does not contain any `_embedded` objects. If
      needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.


      This schema is version `v1.0.0`.
    example:
      _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
      _profile: 'https://api.apiture.com/schemas/cards/card/v1.0.0/profile.json'
      holderName: LUCILLE WELLPHUNDED
      label: Premiere Checking *3210
      accountName: Premiere Checking
      accountNumbers:
        masked: '*************3210'
        full: '9876543210'
      cardNumbers:
        masked: '************3210'
      accountCategory: DDA
      state: active
      issuedAt: '2019-06-07T05:18:30.375Z'
      updatedAt: '2019-06-07T05:18:30.375Z'
      updatedBy: lucy.wellphunded@bankcustomer.example.com
      expiresOn: {}
      _embedded: {}
      _links:
        self:
          href: /cards/cards/0399abed-fd3d-4830-a88b-30f38b8a365c
        'apiture:lock':
          href: /cards/lockedCards?card=0399abed-fd3d-4830-a88b-30f38b8a365c
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
      - $ref: '#/definitions/cardFields'
      - properties:
          - _id
          - label
          - holderName
          - cardNumbers
          - replacementState
          - state
          - issuedAt
          - activatedAt
          - expiresOn
          - updatedAt
          - updatedBy
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      accountName:
        description: The name of the account that this card is tied to.
        type: string
        minLength: 1
        maxLength: 128
        example: Premiere Checking
        readOnly: true
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. This is derived from the account used in the initial
          card request. By default, only the `masked` number is returned; use `?unmasked=true` to reveal the `full` account number.
        allOf:
          - $ref: '#/definitions/accountNumbers'
        readOnly: true
      accountCategory:
        description: 'The category of the account, such as `Savings` or `Checking`. This is derived from the product associated with the account for this card.'
        type: string
        readOnly: true
        example: Checking
      accountType:
        description: 'The type of the account, such as `CDA` or `DDA` for savings and checking (demand deposit accounts).'
        allOf:
          - $ref: '#/definitions/ifxType'
        readOnly: true
      _id:
        description: The unique identifier for this card resource. This is an immutable opaque string.
        readOnly: true
        type: string
      label:
        description: The text label for this card.
        type: string
        minLength: 1
        maxLength: 128
        readOnly: true
        example: My debit card for Premiere Checking
      holderName:
        description: 'The card holder''s full name, as it appears on the card. This value is often ALL CAPS.'
        type: string
        example: LUCILLE WELLPHUNDED
        readOnly: true
      cardNumbers:
        description: The masked and full card number this card.
        allOf:
          - $ref: '#/definitions/cardNumbers'
        readOnly: true
      replacementState:
        description: Indicates the state of a card replacement request. The user cannot change this property.
        allOf:
          - $ref: '#/definitions/cardReplacementState'
        readOnly: true
        example: replacedWithNewNumber
      state:
        description: The state of this card. This is derived.
        allOf:
          - $ref: '#/definitions/cardState'
        readOnly: true
      issuedAt:
        description: >-
          The date-time when this card was issued. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format. This field is present only
          after the card has been issued, _and_ if the card vendor provides the time stamp.
        type: string
        format: date-time
        example: {}
        readOnly: true
      activatedAt:
        description: >-
          The date-time when this card was activated. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format. This field is present
          only after the card has been activated, _and_ if the card vendor provides the time stamp.
        type: string
        format: date-time
        example: {}
        readOnly: true
      expiresOn:
        description: >-
          The card's expiration date. The day should is the last day of the month, such as 2021-10-31 if the card expires at the end of October, 2021.
          in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DD` format.
        type: string
        format: date
        example: {}
        readOnly: true
      updatedAt:
        description: >-
          The date-time when this card's state or other attributes were last changed. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC
          format.
        type: string
        format: date-time
        example: {}
        readOnly: true
      updatedBy:
        description: 'The username of the person who last modified this card resource. '
        type: string
        readOnly: true
        example: lucy.wellphunded@bankcustomer.example.com
    type: object
    x-apiture-flattened: true
  cardState:
    title: Card State (v1.0.0)
    description: |-
      The state of a card.

      <strong><code>cardState</code></strong> strings may have one of the following
      [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations) values
      (described by the named cardState)

      <table>
      <tr>
        <th>Value</th><th>Description</th>
      </tr>

      These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
      named `cardState` in the response from the [`getLabels`](#op-getLabels) operation.

      <tr>
          <td><strong><code>unknown</code></strong></td><td>Unknown</td>
          </tr>
      <tr>
          <td><strong><code>requested</code></strong></td><td>Requested: The used has submitted the request to issue the card but the request has not been completed.</td>
          </tr>
      <tr>
          <td><strong><code>issued</code></strong></td><td>Issued: The card has been issued but the card holder has not activated it.</td>
          </tr>
      <tr>
          <td><strong><code>active</code></strong></td><td>Active: The card has been issued and activated an is available for use.</td>
          </tr>
      <tr>
          <td><strong><code>locked</code></strong></td><td>Locked: The user has requested that the card be locked so that it may not be used. This is useful if they have misplaced the card but do not yet want to report it as lost.</td>
          </tr>
      <tr>
          <td><strong><code>lost</code></strong></td><td>Reported as lost: The user has reported the card as lost. The card is disabled. A new card (with a new card number) will be issued.</td>
          </tr>
      <tr>
          <td><strong><code>stolen</code></strong></td><td>Reported as stolen: The user has reported the card as stolen. The card is disabled. A new card (with a new card number) will be issued.</td>
          </tr>
      <tr>
          <td><strong><code>damaged</code></strong></td><td>Reported as damaged: The user has reported the card as stolen. A new card with the same card number will be issued.</td>
          </tr>
      <tr>
          <td><strong><code>frozen</code></strong></td><td>Frozen: The financial institution has frozen the card or the account associated with this card.</td>
          </tr>
      <tr>
          <td><strong><code>closed</code></strong></td><td>Closed: The card has been closed at the card holder's request. The card is disabled and the user cannot request replacements.</td>
          </tr>
      </table>


      This schema is version `v1.0.0`.
    type: string
    enum:
      - unknown
      - requested
      - issued
      - active
      - locked
      - lost
      - stolen
      - damaged
      - frozen
      - closed
    x-apiture-enum: cardState
    x-apiture-version: 1.0.0
    x-apiture-flattened: true
  cardReplacementState:
    description: |-
      The state of a card replacement request.

      <strong><code>cardReplacementState</code></strong> strings may have one of the following
      [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations) values
      (described by the named cardReplacementState)

      <table>
      <tr>
        <th>Value</th><th>Description</th>
      </tr>

      These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
      named `cardReplacementState` in the response from the [`getLabels`](#op-getLabels) operation.

      <tr>
          <td><strong><code>none</code></strong></td><td>None: No card replacement requests are active.</td>
          </tr>
      <tr>
          <td><strong><code>requested</code></strong></td><td>Requested: The user has requested a card replacement.</td>
          </tr>
      <tr>
          <td><strong><code>ordered</code></strong></td><td>Ordered: The card replacement order has been sent to the card provider.</td>
          </tr>
      <tr>
          <td><strong><code>issued</code></strong></td><td>Issued: The card has been issued by the card provider.</td>
          </tr>
      <tr>
          <td><strong><code>shipped</code></strong></td><td>Shipped: The issued card has been shipped by the card provider.</td>
          </tr>
      <tr>
          <td><strong><code>replacedWithSameNumber</code></strong></td><td>Replaced with same card number: The card for this account number has been replaced; the card has been issued, shipped, and activated.</td>
          </tr>
      <tr>
          <td><strong><code>replacedWithNewNumber</code></strong></td><td>Replaced with new card number: The card for this account has been replaced with a new card and new card number; the card has been issued, shipped, and activated.</td>
          </tr>
      </table>


      This schema is version `v1.0.0`.
    title: Card Replacement State (v1.0.0)
    type: string
    enum:
      - none
      - requested
      - ordered
      - issued
      - shipped
      - replacedWithSameNumber
      - replacedWithNewNumber
      - rejected
    x-apiture-enum: cardReplacementState
    x-apiture-version: 1.0.0
    x-apiture-flattened: true
  card:
    title: Card (v1.0.0)
    description: >-
      A card resource, which represents physical Debit cards associated with a banking

      account or credit cards.



      The default representation includes only a masked card number. Use `?unmasked=true`

      on the request to include the full card number.



      The hypermedia `_links` in the response (listed below) include several action

      links which change the state of the card.

      These links should be used with the `POST` verb

      (see [Resource sets](https://developer.apiture.com/docs/concepts/resource-sets/)).



      <h3 class='schema-links' id="card-links" >Links</h3>


      Response and request bodies using this <strong><code>card</code></strong> schema may contain

      the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


      <table>

      <tr>
        <th>Rel</th><th>Summary</th><th>Method</th>
      </tr>


      <tr>

      <td><a href='#op-unlockCard'><strong><code>apiture:unlock</code></strong></a></td><td>Unlock a card</td><td><code>POST</code></td>

      </tr>


      <tr>

      <td><a href='#op-closeCard'><strong><code>apiture:close</code></strong></a></td><td>Close a card</td><td><code>POST</code></td>

      </tr>


      <tr>

      <td><a href='#op-lockCard'><strong><code>apiture:lock</code></strong></a></td><td>Lock a card</td><td><code>POST</code></td>

      </tr>


      <tr>

      <td><a href='#op-activateCard'><strong><code>apiture:activate</code></strong></a></td><td>Activate a card</td><td><code>POST</code></td>

      </tr>


      <tr>

      <td><a href='#op-createCardRequest'><strong><code>apiture:replace</code></strong></a></td><td>Request a new or replacement
      card</td><td><code>POST</code></td>

      </tr>

      </table>



      This schema is version `v1.0.0`.
    example:
      _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
      _profile: 'https://api.apiture.com/schemas/cards/card/v1.0.0/profile.json'
      holderName: LUCILLE WELLPHUNDED
      name: My debit card for Premiere Checking
      accountName: Premiere Checking
      accountNumbers:
        masked: '*************3210'
        full: '9876543210'
      cardNumbers:
        masked: '************3210'
      accountCategory: DDA
      state: active
      issuedAt: '2019-06-07T05:18:30.375Z'
      updatedAt: '2019-06-07T05:18:30.375Z'
      updatedBy: lucy.wellphunded@bankcustomer.example.com
      expiresOn: {}
      _embedded: {}
      _links:
        self:
          href: /cards/cards/0399abed-fd3d-4830-a88b-30f38b8a365c
        'apiture:lock':
          href: /cards/lockedCards?card=0399abed-fd3d-4830-a88b-30f38b8a365c
    x-apiture-links:
      - rel: 'apiture:unlock'
        operationId: unlockCard
      - rel: 'apiture:close'
        operationId: closeCard
      - rel: 'apiture:lock'
        operationId: lockCard
      - rel: 'apiture:activate'
        operationId: activateCard
      - rel: 'apiture:replace'
        operationId: createCardRequest
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/summaryCard'
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      accountName:
        description: The name of the account that this card is tied to.
        type: string
        minLength: 1
        maxLength: 128
        example: Premiere Checking
        readOnly: true
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. This is derived from the account used in the initial
          card request. By default, only the `masked` number is returned; use `?unmasked=true` to reveal the `full` account number.
        allOf:
          - $ref: '#/definitions/accountNumbers'
        readOnly: true
      accountCategory:
        description: 'The category of the account, such as `Savings` or `Checking`. This is derived from the product associated with the account for this card.'
        type: string
        readOnly: true
        example: Checking
      accountType:
        description: 'The type of the account, such as `CDA` or `DDA` for savings and checking (demand deposit accounts).'
        allOf:
          - $ref: '#/definitions/ifxType'
        readOnly: true
      _id:
        description: The unique identifier for this card resource. This is an immutable opaque string.
        readOnly: true
        type: string
      label:
        description: The text label for this card.
        type: string
        minLength: 1
        maxLength: 128
        readOnly: true
        example: My debit card for Premiere Checking
      holderName:
        description: 'The card holder''s full name, as it appears on the card. This value is often ALL CAPS.'
        type: string
        example: LUCILLE WELLPHUNDED
        readOnly: true
      cardNumbers:
        description: The masked and full card number this card.
        allOf:
          - $ref: '#/definitions/cardNumbers'
        readOnly: true
      replacementState:
        description: Indicates the state of a card replacement request. The user cannot change this property.
        allOf:
          - $ref: '#/definitions/cardReplacementState'
        readOnly: true
        example: replacedWithNewNumber
      state:
        description: The state of this card. This is derived.
        allOf:
          - $ref: '#/definitions/cardState'
        readOnly: true
      issuedAt:
        description: >-
          The date-time when this card was issued. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format. This field is present only
          after the card has been issued, _and_ if the card vendor provides the time stamp.
        type: string
        format: date-time
        example: {}
        readOnly: true
      activatedAt:
        description: >-
          The date-time when this card was activated. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format. This field is present
          only after the card has been activated, _and_ if the card vendor provides the time stamp.
        type: string
        format: date-time
        example: {}
        readOnly: true
      expiresOn:
        description: >-
          The card's expiration date. The day should is the last day of the month, such as 2021-10-31 if the card expires at the end of October, 2021.
          in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DD` format.
        type: string
        format: date
        example: {}
        readOnly: true
      updatedAt:
        description: >-
          The date-time when this card's state or other attributes were last changed. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC
          format.
        type: string
        format: date-time
        example: {}
        readOnly: true
      updatedBy:
        description: 'The username of the person who last modified this card resource. '
        type: string
        readOnly: true
        example: lucy.wellphunded@bankcustomer.example.com
    type: object
    x-apiture-flattened: true
  cardFields:
    title: Card Fields (v1.0.0)
    description: |-
      Common fields of the card resource, used to build other model schemas.

      This schema is version `v1.0.0`.
    x-apiture-fragment: true
    properties:
      accountName:
        description: The name of the account that this card is tied to.
        type: string
        minLength: 1
        maxLength: 128
        example: Premiere Checking
        readOnly: true
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. This is derived from the account used in the initial
          card request. By default, only the `masked` number is returned; use `?unmasked=true` to reveal the `full` account number.
        allOf:
          - $ref: '#/definitions/accountNumbers'
        readOnly: true
      accountCategory:
        description: 'The category of the account, such as `Savings` or `Checking`. This is derived from the product associated with the account for this card.'
        type: string
        readOnly: true
        example: Checking
      accountType:
        description: 'The type of the account, such as `CDA` or `DDA` for savings and checking (demand deposit accounts).'
        allOf:
          - $ref: '#/definitions/ifxType'
        readOnly: true
    x-apiture-version: 1.0.0
    type: object
    x-apiture-flattened: true
  cards:
    title: Card Collection (v1.0.0)
    description: |-
      Collection of cards. The items in the collection are ordered in the `_embedded.items` array; the `name` is `cards`.
       The top-level `_links` object may contain pagination links (`self`, `next`, `prev`, `first`, `last`, `collection`).

      This schema is version `v1.0.0`.
    example:
      _profile: 'https://api.apiture.com/schemas/cards/cards/v1.0.0/profile.json'
      start: 10
      limit: 10
      count: 67
      name: cards
      _links:
        self:
          href: /cards/cards?start=10&limit=10
        first:
          href: /cards/cards?start=0&limit=10
        next:
          href: /cards/cards?start=20&limit=10
        collection:
          href: /cards/cards
      _embedded:
        items:
          - _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
            _profile: 'https://api.apiture.com/schemas/cards/card/v1.0.0/profile.json'
            _links:
              self:
                href: /cards/cards/0399abed-fd3d-4830-a88b-30f38b8a365c
          - _id: d62c0701-0d74-4836-83f9-ebf3709442ea
            _profile: 'https://api.apiture.com/schemas/cards/card/v1.0.0/profile.json'
            _links:
              self:
                href: /cards/cards/d62c0701-0d74-4836-83f9-ebf3709442ea
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/collection'
      - properties:
          - _embedded
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        type: object
        description: Embedded objects.
        properties:
          items:
            description: An array containing a page of card items.
            type: array
            items:
              $ref: '#/definitions/summaryCard'
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      count:
        description: >-
          The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
          is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
          filter.
        type: integer
      start:
        description: The start index of this page of items.
        type: integer
      limit:
        description: The maximum number of items per page.
        type: integer
      name:
        description: The name of the collection.
        type: string
    type: object
    x-apiture-flattened: true
  createCardRequest:
    title: Create Card Request (v1.0.0)
    description: >-
      Representation used to create a request for a new or replacement card. For new cards, the request must include the `accountNumbers` object with
      the `full` account number of the account that the card is associated with; the user must have access to that account.


      This schema is version `v1.0.0`.
    example:
      _profile: 'https://api.apiture.com/schemas/cards/cardRequest/v1.0.0/profile.json'
      cardId: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason: lost
      description: Replace lost card
      _links:
        'Apiture:account':
          href: 'https://api.example.com/accounts/accounts/617c31ce-7bf0-4e55-a5df-12916ff22ada'
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
      - $ref: '#/definitions/cardRequestFields'
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      cardId:
        description: The resource ID of the card that is to be replaced.
        type: string
        example: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason:
        description: Reasons which describe why the user is requesting a a card.
        allOf:
          - $ref: '#/definitions/cardRequestReason'
        example: lost
      description:
        description: |-
          The card holder's description, note, or explanation of why they requested a card.
           type: string
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. The `accountNumbers.full` is required in the request
          body of a new card request; this object is immutable afterwards. The `full` number is only returned when requests contain the `?unmasked`
          query parameter.
        allOf:
          - $ref: '#/definitions/accountNumbers'
    type: object
    x-apiture-flattened: true
  summaryCardRequest:
    title: Card Request Summary (v1.0.0)
    description: >-
      Summary representation of a card request resource in replacements collections. This representation normally does not contain any `_embedded`
      objects. If needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.


      This schema is version `v1.0.0`.
    example:
      _id: 35eb0e67-ac9b-44d7-8799-6648ba6b1c65
      _profile: 'https://api.apiture.com/schemas/cards/cardRequest/v1.0.0/profile.json'
      cardId: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason: lost
      description: Replace lost card
      submittedAt: '2019-06-07T05:18:30.375Z'
      updatedAt: '2019-06-07T05:18:30.375Z'
      updatedBy: lucy.wellphunded@bankcustomer.example.com
      _links:
        self:
          href: /cards/cards/35eb0e67-ac9b-44d7-8799-6648ba6b1c65
        'apiture:account':
          href: 'https://api.example.com/accounts/accounts/617c31ce-7bf0-4e55-a5df-12916ff22ada'
        'apiture:cancel':
          href: 'https://api.example.com/cards/canceledCardRequests?cardRequest=617c31ce-7bf0-4e55-a5df-12916ff22ada'
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
      - $ref: '#/definitions/cardRequestFields'
      - properties:
          - _id
          - state
          - submittedAt
          - resolvedAt
          - updatedAt
          - resolutionReason
          - updatedBy
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      cardId:
        description: The resource ID of the card that is to be replaced.
        type: string
        example: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason:
        description: Reasons which describe why the user is requesting a a card.
        allOf:
          - $ref: '#/definitions/cardRequestReason'
        example: lost
      description:
        description: |-
          The card holder's description, note, or explanation of why they requested a card.
           type: string
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. The `accountNumbers.full` is required in the request
          body of a new card request; this object is immutable afterwards. The `full` number is only returned when requests contain the `?unmasked`
          query parameter.
        allOf:
          - $ref: '#/definitions/accountNumbers'
      _id:
        description: The unique identifier for this card request resource. This is an immutable opaque string.
        readOnly: true
        type: string
      state:
        description: Indicates the state of a card request.
        allOf:
          - $ref: '#/definitions/cardRequestState'
        readOnly: true
        example: submitted
      submittedAt:
        description: 'The date-time when this card request request was submitted. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format.'
        type: string
        format: date-time
        example: {}
      resolvedAt:
        description: >-
          The date-time when this card request request was completed, rejected, or canceled. This is in [RFC
          3339](https://tools.ietf.org/html/rfc3339) UTC format.
        type: string
        format: date-time
        example: {}
      updatedAt:
        description: 'The date-time when this card request attributes were last changed. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format.'
        type: string
        format: date-time
        example: {}
      resolutionReason:
        description: The explanation for why the card was resolved. This may be the reason the card request was rejected.
        type: string
        maxLength: 2048
        example: Suspected fraudulent activity has been detected.
      updatedBy:
        description: The username of the person who last modified or resolved this card request at the time indicated by the `resolvedAt` time stamp).
        type: string
    type: object
    x-apiture-flattened: true
  cardRequestState:
    title: Card Request State (v1.0.0)
    description: |-
      Indicates the state of a card request.

      <strong><code>cardRequestState</code></strong> strings may have one of the following
      [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations) values
      (described by the named cardRequestState)

      <table>
      <tr>
        <th>Value</th><th>Description</th>
      </tr>

      These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
      named `cardRequestState` in the response from the [`getLabels`](#op-getLabels) operation.

      <tr>
          <td><strong><code>pending</code></strong></td><td>Pending: A card request has been created but not yet submitted.</td>
          </tr>
      <tr>
          <td><strong><code>submitted</code></strong></td><td>Submitted: A card request has been submitted but not processed.</td>
          </tr>
      <tr>
          <td><strong><code>canceled</code></strong></td><td>Canceled: A card request has been canceled.</td>
          </tr>
      <tr>
          <td><strong><code>rejected</code></strong></td><td>Rejected: A card request has been rejected.</td>
          </tr>
      <tr>
          <td><strong><code>completed</code></strong></td><td>Completed: A card request has been completed.</td>
          </tr>
      </table>


      This schema is version `v1.0.0`.
    type: string
    enum:
      - pending
      - submitted
      - canceled
      - rejected
      - completed
    x-apiture-enum: cardRequestState
    x-apiture-version: 1.0.0
    x-apiture-flattened: true
  cardRequest:
    title: Card Request (v1.0.0)
    description: >-
      Representation of a card request resource.

      This represents a request to issue a new card or replace a lost,

      stolen, or damaged card.



      The hypermedia `_links` in the card request representation (listed below)

      include several action links which change the state of the card request.

      These links should be used with the `POST` verb

      (see [Resource sets](https://developer.apiture.com/docs/concepts/resource-sets/)).



      <h3 class='schema-links' id="cardRequest-links" >Links</h3>


      Response and request bodies using this <strong><code>cardRequest</code></strong> schema may contain

      the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


      <table>

      <tr>
        <th>Rel</th><th>Summary</th><th>Method</th>
      </tr>


      <tr>

      <td><a href='#op-cancelCardRequest'><strong><code>apiture:cancel</code></strong></a></td><td>Cancel a card
      request</td><td><code>POST</code></td>

      </tr>


      <tr>

      <td><a href='#op-completeCardRequest'><strong><code>apiture:complete</code></strong></a></td><td>Complete a card
      request</td><td><code>POST</code></td>

      </tr>


      <tr>

      <td><a href='#op-rejectCardRequest'><strong><code>apiture:reject</code></strong></a></td><td>Reject a card
      request</td><td><code>POST</code></td>

      </tr>

      </table>



      This schema is version `v1.0.0`.
    x-apiture-links:
      - rel: 'apiture:cancel'
        operationId: cancelCardRequest
      - rel: 'apiture:complete'
        operationId: completeCardRequest
      - rel: 'apiture:reject'
        operationId: rejectCardRequest
    example:
      _id: 35eb0e67-ac9b-44d7-8799-6648ba6b1c65
      _profile: 'https://api.apiture.com/schemas/cards/cardRequest/v1.0.0/profile.json'
      cardId: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason: lost
      description: Replace lost card
      submittedAt: '2019-06-07T05:18:30.375Z'
      updatedAt: '2019-06-07T05:18:30.375Z'
      updatedBy: lucy.wellphunded@bankcustomer.example.com
      _links:
        self:
          href: /cards/cardRequests/35eb0e67-ac9b-44d7-8799-6648ba6b1c65
        'apiture:card':
          href: /cards/cards/9e5a519c-ed3d-48ec-84d0-ef29b2843803
        'apiture:account':
          href: 'https://api.example.com/accounts/accounts/617c31ce-7bf0-4e55-a5df-12916ff22ada'
        'apiture:cancel':
          href: 'https://api.example.com/cards/canceledCardRequests?cardRequest=617c31ce-7bf0-4e55-a5df-12916ff22ada'
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/summaryCardRequest'
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      cardId:
        description: The resource ID of the card that is to be replaced.
        type: string
        example: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason:
        description: Reasons which describe why the user is requesting a a card.
        allOf:
          - $ref: '#/definitions/cardRequestReason'
        example: lost
      description:
        description: |-
          The card holder's description, note, or explanation of why they requested a card.
           type: string
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. The `accountNumbers.full` is required in the request
          body of a new card request; this object is immutable afterwards. The `full` number is only returned when requests contain the `?unmasked`
          query parameter.
        allOf:
          - $ref: '#/definitions/accountNumbers'
      _id:
        description: The unique identifier for this card request resource. This is an immutable opaque string.
        readOnly: true
        type: string
      state:
        description: Indicates the state of a card request.
        allOf:
          - $ref: '#/definitions/cardRequestState'
        readOnly: true
        example: submitted
      submittedAt:
        description: 'The date-time when this card request request was submitted. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format.'
        type: string
        format: date-time
        example: {}
      resolvedAt:
        description: >-
          The date-time when this card request request was completed, rejected, or canceled. This is in [RFC
          3339](https://tools.ietf.org/html/rfc3339) UTC format.
        type: string
        format: date-time
        example: {}
      updatedAt:
        description: 'The date-time when this card request attributes were last changed. This is in [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC format.'
        type: string
        format: date-time
        example: {}
      resolutionReason:
        description: The explanation for why the card was resolved. This may be the reason the card request was rejected.
        type: string
        maxLength: 2048
        example: Suspected fraudulent activity has been detected.
      updatedBy:
        description: The username of the person who last modified or resolved this card request at the time indicated by the `resolvedAt` time stamp).
        type: string
    type: object
    x-apiture-flattened: true
  cardRequests:
    title: Card Requests Collection (v1.0.0)
    description: >-
      Collection of requests to issue a new or replacement card. The items in the collection are ordered in the `_embedded.items` array; the `name` is
      `replacements`.
       The top-level `_links` object may contain pagination links (`self`, `next`, `prev`, `first`, `last`, `collection`).

      This schema is version `v1.0.0`.
    example:
      _profile: 'https://api.apiture.com/schemas/cards/cardRequests/v1.0.0/profile.json'
      start: 10
      limit: 10
      count: 67
      name: cardRequests
      _links:
        self:
          href: /cards/cardRequests?start=10&limit=10
        first:
          href: /cards/cardRequests?start=0&limit=10
        next:
          href: /cards/cardRequests?start=20&limit=10
        collection:
          href: /cards/cardRequests
      _embedded:
        items:
          - _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
            _profile: 'https://api.apiture.com/schemas/cards/cardRequest/v1.0.0/profile.json'
            _links:
              self:
                href: /cards/cardRequests/0399abed-fd3d-4830-a88b-30f38b8a365c
          - _id: d62c0701-0d74-4836-83f9-ebf3709442ea
            _profile: 'https://api.apiture.com/schemas/cards/cardRequest/v1.0.0/profile.json'
            _links:
              self:
                href: /cards/cardRequests/d62c0701-0d74-4836-83f9-ebf3709442ea
    x-apiture-version: 1.0.0
    x-apiture-composition:
      - $ref: '#/definitions/collection'
      - properties:
          - _embedded
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        type: object
        description: Embedded objects.
        properties:
          items:
            description: An array containing a page of replacement items.
            type: array
            items:
              $ref: '#/definitions/summaryCardRequest'
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      count:
        description: >-
          The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
          is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
          filter.
        type: integer
      start:
        description: The start index of this page of items.
        type: integer
      limit:
        description: The maximum number of items per page.
        type: integer
      name:
        description: The name of the collection.
        type: string
    type: object
    x-apiture-flattened: true
  cardRequestFields:
    title: Card Request Fields (v1.0.0)
    description: |-
      Common fields of the card request resource used to build other model schemas. TODO: add the mailing address for the new card.

      This schema is version `v1.0.0`.
    x-apiture-fragment: true
    properties:
      cardId:
        description: The resource ID of the card that is to be replaced.
        type: string
        example: 9e5a519c-ed3d-48ec-84d0-ef29b2843803
      reason:
        description: Reasons which describe why the user is requesting a a card.
        allOf:
          - $ref: '#/definitions/cardRequestReason'
        example: lost
      description:
        description: |-
          The card holder's description, note, or explanation of why they requested a card.
           type: string
      accountNumbers:
        description: >-
          The masked and (optionally) full number for the account this card is associated with. The `accountNumbers.full` is required in the request
          body of a new card request; this object is immutable afterwards. The `full` number is only returned when requests contain the `?unmasked`
          query parameter.
        allOf:
          - $ref: '#/definitions/accountNumbers'
    x-apiture-version: 1.0.0
    type: object
    x-apiture-flattened: true
  cardRequestReason:
    title: Card Request Reason (v1.0.0)
    description: |-
      The reason the user is requesting a replacement card.

      <strong><code>cardRequestReason</code></strong> strings may have one of the following
      [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations) values
      (described by the named cardRequestReason)

      <table>
      <tr>
        <th>Value</th><th>Description</th>
      </tr>

      These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
      named `cardRequestReason` in the response from the [`getLabels`](#op-getLabels) operation.

      <tr>
          <td><strong><code>initial</code></strong></td><td>Initial card request</td>
          </tr>
      <tr>
          <td><strong><code>lost</code></strong></td><td>Lost card</td>
          </tr>
      <tr>
          <td><strong><code>stolen</code></strong></td><td>Stolen card</td>
          </tr>
      <tr>
          <td><strong><code>damaged</code></strong></td><td>Damaged card</td>
          </tr>
      </table>


      This schema is version `v1.0.0`.
    type: string
    enum:
      - initial
      - lost
      - stolen
      - damaged
    x-apiture-enum: cardRequestReason
    x-apiture-version: 1.0.0
    x-apiture-flattened: true
  cardNumbers:
    title: Card Numbers (v1.0.0)
    description: |-
      Masked and full representation of a card number.

      This schema is version `v1.0.0`.
    properties:
      masked:
        description: >-
          A partial (masked) card number that does not contain all the digits of the full card number. This masked number appears in statements or in
          user experience presentation. It is sufficient for a user to differentiate this card from other cards the user holds, but is not sufficient
          for initiating transactions, etc. The first character is the mask character and is repeated; this does not indicate that the full card
          number is the same as the mask length. This value is derived and immutable.
        type: string
        maxLength: 16
        readOnly: true
        example: '************3210'
    x-apiture-version: 1.0.0
    type: object
    x-apiture-flattened: true
  localizedLabels:
    title: Localized Labels
    description: >-
      A map that defines lables for an enumeration or other item in a JSON schema. This is a map which maps enumeration schema names to an
      `localizedLabel` object. This schema is deprecated. Use [`labelGroups`](#schema-labelgroups)` instead.
    x-apiture-deprecated: true
    additionalProperties:
      $ref: '#/definitions/localizedLabel'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/localizedLabels/v1.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-version: 1.0.0
    type: object
    properties: {}
    x-apiture-flattened: true
  root:
    x-apiture-version: 2.0.0
    title: API Root
    description: 'A HAL response, with hypermedia `_links` for the top-level resources and operations in API.'
    example:
      id: apiName
      name: API name
      apiVersion: 1.0.0
      _profile: 'https://production.api.apiture.com/schemas/common/root/v2.0.0/profile.json'
      _links: {}
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/root/v2.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
      - properties:
          - _id
          - name
          - apiVersion
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      _id:
        description: This API's unique ID.
        readOnly: true
        type: string
      name:
        type: string
        description: This API's name.
      apiVersion:
        type: string
        description: This API's version.
    type: object
    x-apiture-flattened: true
  errorResponse:
    x-apiture-version: 2.0.0
    title: Error Response
    description: 'Describes an error response, typically returned on 4xx or 5xx errors from API operations. The `_error` object contains the error details.'
    example:
      _profile: 'https://api.apiture.com/schemas/common/errorResponse/v2.0.0/profile.json'
      _error:
        _id: 2eae46e1-575c-4d69-8a8f-0a7b0115a4b3
        message: The value for deposit must be greater than 0.
        statusCode: 422
        type: positiveNumberRequired
        attributes:
          value: -125.5
        remediation: Provide a value which is greater than 0
        occurredAt: '2018-01-25T05:50:52.375Z'
        _links:
          describedby:
            href: 'https://api.apiture.com/errors/positiveNumberRequired'
        _embedded:
          errors: []
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/errorResponse/v2.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
    type: object
    x-apiture-flattened: true
  abstractResource:
    x-apiture-version: 2.0.0
    title: Abstract Resource
    description: >-
      An abstract schema used to define other schemas for request and response bodies. This is a
      [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08) resource representation. This model contains hypermedia `_links`, and either optional
      domain object data with `_profile` and optional `_embedded` objects, or an `_error` object. In responses, if the operation was successful, this
      object will not include the `_error`, but if the operation was a 4xx or 5xx error, this object will not include `_embedded` or any data fields,
      only `_error` and optionally `_links`.
    example:
      _profile: '{uri of resource profile.json}'
      _links:
        self:
          href: '{uri of current resource}'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/abstractResource/v2.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-composition:
      - $ref: '#/definitions/abstractRequest'
      - properties:
          - _error
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
    type: object
    x-apiture-flattened: true
  accountNumbers:
    title: Account Numbers
    description: Different representations of an account number.
    properties:
      masked:
        description: >-
          A partial account number that does not contain all the digits of the full account number. This masked number appears in statements or in
          user experience presentation. It is sufficient for a user to differentiate this account from other accounts they hold, but is not sufficient
          for initiating transfers, etc. The first character is the mask character and is repeated; this does not indicate that the full account
          number is the same as the mask length. This value is derived and immutable.
        type: string
        minLength: 8
        maxLength: 32
        readOnly: true
        example: '*************3210'
      full:
        description: >-
          The full account number. This value only appears when `?unmasked=true` is passed on the `GET` request. Not included in the summary
          representation of the account that is included in account collection responses. This value is derived and immutable.
        type: string
        minLength: 4
        maxLength: 17
        example: '9876543210'
        readOnly: true
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/accountNumbers/v1.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-version: 1.0.0
    type: object
    x-apiture-flattened: true
  ifxType:
    title: IFX Account Type (v1.0.0)
    description: >-
      A code which identifies the product type. This is one of the [IFX AcctType](https://ifxforum.org) values. Labels and descriptions for the
      enumeration values are in the `ifxType` key in the response of the `getLabels` operation.


      <strong><code>ifxType</code></strong> strings may have one of the following

      [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations) values

      (described by the named ifxType)


      <table>

      <tr>
        <th>Value</th><th>Description</th>
      </tr>


      These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)

      named `ifxType` in the response from the [`getLabels`](#op-getLabels) operation.


      <tr>
          <td><strong><code>CCA</code></strong></td><td>Credit card account</td>
          </tr>
      <tr>
          <td><strong><code>CDA</code></strong></td><td>Certificate of deposit account (CD)</td>
          </tr>
      <tr>
          <td><strong><code>CLA</code></strong></td><td>Commercial loan account</td>
          </tr>
      <tr>
          <td><strong><code>CMA</code></strong></td><td>Cash management account</td>
          </tr>
      <tr>
          <td><strong><code>DDA</code></strong></td><td>Demand deposit account</td>
          </tr>
      <tr>
          <td><strong><code>EQU</code></strong></td><td>Home equity loan</td>
          </tr>
      <tr>
          <td><strong><code>GLA</code></strong></td><td>General ledger account</td>
          </tr>
      <tr>
          <td><strong><code>ILA</code></strong></td><td>Installment loan account</td>
          </tr>
      <tr>
          <td><strong><code>INV</code></strong></td><td>Investment account</td>
          </tr>
      <tr>
          <td><strong><code>IRA</code></strong></td><td>Individual retirement account</td>
          </tr>
      <tr>
          <td><strong><code>IRL</code></strong></td><td>Accounts held in Ireland</td>
          </tr>
      <tr>
          <td><strong><code>LOC</code></strong></td><td>Consumer line of credit</td>
          </tr>
      <tr>
          <td><strong><code>MLA</code></strong></td><td>Military Lending Account: Credit facility held by former US service member</td>
          </tr>
      <tr>
          <td><strong><code>MMA</code></strong></td><td>Money market account</td>
          </tr>
      <tr>
          <td><strong><code>PBA</code></strong></td><td>Packaged bank Account: Account with additional benefits that charges a fixed monthly fee.</td>
          </tr>
      <tr>
          <td><strong><code>PPA</code></strong></td><td>Private pension administrator</td>
          </tr>
      <tr>
          <td><strong><code>RWD</code></strong></td><td>Reward accounts</td>
          </tr>
      <tr>
          <td><strong><code>SDA</code></strong></td><td>Savings deposit account</td>
          </tr>
      </table>



      This schema is version `v1.0.0`.
    x-apiture-enum: ifxType
    type: string
    enum:
      - CCA
      - CDA
      - CLA
      - CMA
      - DDA
      - EQU
      - GLA
      - ILA
      - INV
      - IRA
      - IRL
      - LOC
      - MLA
      - MMA
      - PBA
      - PPA
      - RWD
      - SDA
    x-apiture-version: 1.0.0
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/products/ifxType/v1.0.0/model.json'
    x-apiture-namespace: products
    x-apiture-flattened: true
  collection:
    x-apiture-version: 2.0.0
    title: Collection
    description: A collection of resources. This is an abstract model schema which is extended to define specific resource collections.
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/collection/v2.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-composition:
      - $ref: '#/definitions/abstractResource'
      - properties:
          - count
          - start
          - limit
          - name
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
      _error:
        description: An object which describes an error. This value is omitted if the operation succeeded without error.
        type: object
        allOf:
          - $ref: '#/definitions/error'
      count:
        description: >-
          The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
          is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
          filter.
        type: integer
      start:
        description: The start index of this page of items.
        type: integer
      limit:
        description: The maximum number of items per page.
        type: integer
      name:
        description: The name of the collection.
        type: string
    type: object
    x-apiture-flattened: true
  abstractRequest:
    x-apiture-version: 2.0.0
    title: Abstract Request
    description: >-
      An abstract schema used to define other request-only schemas. This is a [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08) resource
      representation, minus the `_error` defined in `abstractResource`.
    properties:
      _links:
        description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
        $ref: '#/definitions/links'
      _embedded:
        description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
        type: object
      _profile:
        description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
        type: string
        format: uri
    example:
      _profile: '{uri of resource profile.json}'
      _links:
        self:
          href: '{uri of current resource}'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/abstractRequest/v2.0.0/model.json'
    x-apiture-namespace: common
    type: object
    x-apiture-flattened: true
  error:
    x-apiture-version: 2.0.0
    title: Error
    description: Describes an error in an API request or in a service called via the API.
    required:
      - message
    properties:
      message:
        type: string
        description: A localized message string describing the error condition.
      _id:
        description: >-
          A unique identifier for this error instance. This may be used as a correlation ID with the root cause error (i.e. this ID may be logged at
          the source of the error). This is is an opaque string.
        readOnly: true
        type: string
      statusCode:
        description: The HTTP status code associate with this error.
        type: integer
        minimum: 100
        maximum: 599
        example: 422
      type:
        type: string
        description: >-
          An error identifier which indicates the category of error and associate it with API support documentation or which the UI tier can use to
          render an appropriate message or hint. This provides a finer level of granularity than the `statusCode`. For example, instead of just 400
          Bad Request, the `type` may be much more specific. such as `integerValueNotInAllowedRange` or `numericValueExceedsMaximum` or
          `stringValueNotInAllowedSet`.
      occurredAt:
        type: string
        format: date-time
        description: 'An [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC time stamp indicating when the error occurred.'
        example: '2018-02-02T03:37:15.375Z'
      attributes:
        description: >-
          Informative values or constraints which describe the error. For example, for a value out of range error, the attributes may specify the
          `minimum` and `maximum` values. This allows clients to present error messages as they see fit (the API does not assume the
          client/presentation tier). The set of attributes varies by error `type`.
        allOf:
          - $ref: '#/definitions/attributes'
      remediation:
        type: string
        description: An optional localized string which provides hints for how the user or client can resolve the error.
      errors:
        description: An optional array of nested error objects. This property is not always present.
        type: array
        items:
          $ref: '#/definitions/error'
      _links:
        $ref: '#/definitions/links'
    example:
      _id: 2eae46e1575c0a7b0115a4b3
      message: Descriptive error message...
      statusCode: 422
      type: errorType1
      remediation: Remediation string...
      occurredAt: '2018-01-25T05:50:52.375Z'
      errors:
        - _id: ccdbe2c5c938a230667b3827
          message: An optional embedded error
        - _id: dbe9088dcfe2460f229338a3
          message: Another optional embedded error
      _links:
        describedby:
          href: 'https://developer.apiture.com/errors/errorType1'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/error/v2.0.0/model.json'
    x-apiture-namespace: common
    type: object
    x-apiture-flattened: true
  localizedLabel:
    title: Localized Label
    description: >-
      A localized label and optional description for localizable content defined in this API. This schema is deprecated; use
      [`labelItem`](#schema-labelitem) instead.
    x-apiture-deprecated: true
    type: object
    properties:
      label:
        type: string
        description: A localized label or title which may be used labels or other UI controls which present a value.
        example: Limited Liability Corporation
      description:
        type: string
        description: A more detailed localized description of a localizable label.
      language:
        type: string
        description: >-
          The actual natural language tag to which this localized label is associated, as per [RFC
          7231](https://tools.ietf.org/html/rfc7231#section-3.1.3.1)
        example: en-us
      code:
        type: string
        description: 'If the localized value is associated with an external standard, this is a lookup code or key or URI for that value.'
        example: '31'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/localizedLabel/v1.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-version: 1.0.0
    x-apiture-flattened: true
  links:
    title: Links
    description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
    type: object
    x-apiture-key: linkRelationName
    additionalProperties:
      $ref: '#/definitions/link'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/links/v1.0.0/model.json'
    x-apiture-namespace: common
    x-apiture-version: 1.0.0
    properties: {}
    x-apiture-flattened: true
  attributes:
    x-apiture-version: 2.0.0
    title: Attributes
    description: An optional map of name/value pairs which contains additional dynamic data about the resource.
    type: object
    x-apiture-key: attributeName
    additionalProperties:
      $ref: '#/definitions/attributeValue'
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/attributes/v2.0.0/model.json'
    x-apiture-namespace: common
    properties: {}
    x-apiture-flattened: true
  attributeValue:
    x-apiture-version: 2.0.0
    title: Attribute Value
    description: The data associated with this attribute.
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/attributeValue/v2.0.0/model.json'
    x-apiture-namespace: common
    type: object
    properties: {}
    x-apiture-flattened: true
  link:
    x-apiture-version: 1.0.0
    title: Link
    description: >-
      Describes a hypermedia link within a `_links` object in HAL representations. In Apiture APIs, links are [HAL
      links](https://developer.apiture.com/docs/concepts/links), but Apiture APIs do not use the `name` or `hreflang` properties of HAL. Apiture links
      _may_ include a `method` property.
    required:
      - href
    properties:
      href:
        type: string
        format: uri
        description: The URI or URI template for the resource/operation this link refers to.
      type:
        type: string
        description: The media type for the resource.
      templated:
        type: boolean
        description: 'If true, the link''s href is a [URI template](https://tools.ietf.org/html/rfc6570).'
      title:
        type: string
        description: An optional human-readable localized title for the link.
      deprecation:
        type: string
        format: uri
        description: 'If present, the containing link is deprecated and the value is a URI which provides human-readable text information about the deprecation.'
      profile:
        type: string
        format: uri
        description: 'The URI of a profile document, a JSON document which describes the target resource/operation.'
    example:
      href: /contacts/contacts/328f6bf6-d762-422f-a077-ab91ca4d0b6f
      title: Applicant
    x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/link/v1.0.0/model.json'
    x-apiture-namespace: common
    type: object
    x-apiture-flattened: true
x-apiture-errors:
  cardRequestRefNotFound:
    description: The request card request resource ID does not identify a card
    remediation: Pass the ID of an existing card request resource
  cardRefNotFound:
    description: The request card resource ID does not identify a card
    remediation: Pass the ID of an existing card resource
  invalidUserRef:
    description: The request user resource ID does not identify a user
    remediation: Pass the ID of an existing user resource
  invalidAccountRef:
    description: The request account resource ID does not identify an account
    remediation: Pass the ID of an existing account resource
x-apiture-traits:
  - api:
      name: Cards
      links:
        - getApi
        - getApiDoc
        - getLabels
        - getCards
        - createCardRequest
        - getCards
        - createCard
  - resource:
      name: card
      description: Debit cards associated with a banking account and credit cards.
      excludeMethods:
        - put
        - patch
  - resource:
      name: card request
      description: 'A request to issue a new card or to replace a lost, stolen, or damaged card.'
      excludeMethods:
        - put
        - patch
  - state:
      name: card
      verb: activate
      state: active
  - state:
      name: card
      verb: lock
      state: locked
  - state:
      name: card
      verb: close
      state: closed
  - state:
      name: card request
      verb: cancel
      state: canceled
  - state:
      name: card request
      verb: reject
      state: rejected
  - state:
      name: card request
      verb: complete
      state: completed
  - labels:
      applied: true
  - security:
      baseScope: card
x-apiture-annotated-at: '2020-05-19T21:05:19.014Z'
host: api.devbank.apiture.com
