openapi: 3.0.3
info:
  title: Mobile Check Cashing SDK — Get Registered Cards
  version: '1'
  description: |
    Returns the list of cards a customer has registered. No PAN
    information is returned — only display metadata (nickname,
    program, last-four, expiration) and the Ingo card identifier.

    This endpoint is Card Partner specific. PayPal partners do not
    call it.

    Card-Partner only. Requires an active SDK partner session — the
    `SessionId` header from `POST /api/v1/partners/authenticate` — plus
    the customer's `customerId`. It does not require the OBO `ssoToken`;
    card setup typically runs before `/authenticate-obo`.
servers:
  - url: https://check-cashing-uat.spykemobile.net
    description: UAT (Sandbox)
  - url: https://check-cashing.spykemobile.net
    description: Production
security:
  - OAuth2:
      - sdkapi
tags:
  - name: Cards
    description: Card account management for Card Partners.
paths:
  /api/v1/partners/get-registered-cards:
    post:
      tags:
        - Cards
      operationId: getRegisteredCards
      summary: List a customer's registered cards
      description: |
        Returns all cards registered to the supplied `customerId`.
        Returns an empty array if the customer has no registered
        cards.
      parameters:
        - $ref: '#/components/parameters/SessionIdHeader'
        - $ref: '#/components/parameters/DeviceIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetRegisteredCardsRequest'
            example:
              customerId: 4g623rb9-48gh-7594-a5d6-268d37362d65
      responses:
        '200':
          description: Card list returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRegisteredCardsResponse'
              example:
                cards:
                  - cardArtAsBase64Png: ''
                    cardId: 07ae09f7-8b55-4f4e-8f3beb5aadf6e398
                    cardNickname: Nickname 2749
                    cardProgram: Super Duper Card
                    customerId: 5f73fb4e-3e5a-428c-95cf-e4c6e4cbae14
                    lastFourDigits: '2749'
                    showTermsAndConditions: true
                    termsAndConditionsId: TC1.1
                    issuerType: 1
                    expirationMonthYear: '1129'
                    cardProgramPhone: '5554445565'
                    currentCardMin: 500
                    currentCardMax: 50000
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
              example:
                errors: {}
                type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                title: Bad Request
                status: 400
                detail: One or more validation errors occurred.
                instance: /api/v1/partners/get-registered-cards
                validationErrors:
                  - key: query.customerId
                    message: The input was not valid.
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.spykemobile.net/connect/token
          scopes:
            sdkapi: Mobile Check Cashing SDK partner methods
  parameters:
    SessionIdHeader:
      name: SessionId
      in: header
      required: true
      schema:
        type: string
    DeviceIdHeader:
      name: DeviceId
      in: header
      required: true
      schema:
        type: string
  schemas:
    GetRegisteredCardsRequest:
      type: object
      required:
        - customerId
      properties:
        customerId:
          type: string
          format: uuid
          minLength: 36
          maxLength: 36
    GetRegisteredCardsResponse:
      type: object
      required:
        - cards
      properties:
        cards:
          type: array
          items:
            $ref: '#/components/schemas/RegisteredCard'
    RegisteredCard:
      type: object
      properties:
        cardId:
          type: string
          description: Ingo-assigned card identifier (GUID).
        customerId:
          type: string
          format: uuid
        cardNickname:
          type: string
          description: User-set nickname.
        cardProgram:
          type: string
          description: Card program display name.
        cardArtAsBase64Png:
          type: string
          description: |
            Base64-encoded PNG of the card art. Empty when not
            available.
        lastFourDigits:
          type: string
          maxLength: 4
        showTermsAndConditions:
          type: boolean
        termsAndConditionsId:
          type: string
        issuerType:
          type: integer
          description: Issuer enumeration.
        expirationMonthYear:
          type: string
          minLength: 4
          maxLength: 4
          description: MMYY format (e.g., `1129` = November 2029).
        cardProgramPhone:
          type: string
        currentCardMin:
          type: integer
          description: Minimum loadable amount in cents.
        currentCardMax:
          type: integer
          description: Maximum loadable amount in cents.
        hashId:
          type: string
    ValidationProblemDetails:
      type: object
      required:
        - type
        - title
        - status
      properties:
        errors:
          type: object
          additionalProperties: true
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
        validationErrors:
          type: array
          items:
            type: object
            required:
              - key
              - message
            properties:
              key:
                type: string
              message:
                type: string
