openapi: 3.0.3
info:
  title: Mobile Check Cashing SDK — Update Account
  version: '1'
  description: |
    Update an existing card account's display and loadable-amount
    metadata. Card Partner specific.

    Note: this endpoint is present in the Card Partners Postman
    collection (`Uni SDK Card Partners Server to Server`) but is NOT
    documented on the Card Partners Methods dev-center page. Field
    semantics below are derived from the Postman example body. Confirm
    with Ingo Client Services before relying on field-level defaults.

    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/update-account:
    post:
      tags:
        - Cards
      operationId: updateAccount
      summary: Update card account metadata
      description: |
        Updates account-level metadata (nickname, holder name,
        address, geolocation, min/max loadable amounts, BillPay
        eligibility) for a previously-registered card account.
      parameters:
        - $ref: '#/components/parameters/SessionIdHeader'
        - $ref: '#/components/parameters/DeviceIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccountRequest'
            example:
              account:
                accountId: 3b242db9-67fc-4087-b0d6-156d37362a13
                accountArtHashId: ''
                accountIssuer: 0
                accountNickname: Test User Test Card
                accountNumber: '6532'
                accountType: 1
                accountHolderName: Test User
                address:
                  addressLine1: 123 Main Street
                  addressLine2: ''
                  city: Nashville
                  state: TN
                  zipCode: '37075'
                customerId: 333554bf-b273-4d6e-b4f8-d319a1929608
                geoLocation:
                  latitude: 36.15788
                  longitude: -86.79252
                minLoadableAmount: 10
                maxLoadableAmount: 1000
                supportsBillPay: false
      responses:
        '200':
          description: Account updated. Empty response body.
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
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:
    UpdateAccountRequest:
      type: object
      required:
        - account
      properties:
        account:
          $ref: '#/components/schemas/Account'
    Account:
      type: object
      required:
        - accountId
        - customerId
      properties:
        accountId:
          type: string
          format: uuid
          description: Ingo card identifier returned at registration.
        accountArtHashId:
          type: string
        accountIssuer:
          type: integer
          description: Card issuer enumeration.
        accountNickname:
          type: string
          maxLength: 20
        accountNumber:
          type: string
          description: |
            Last 4 of the account/card number (matches the
            `lastFourDigits` returned at registration).
        accountType:
          type: integer
          description: Account type enumeration.
        accountHolderName:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        customerId:
          type: string
          format: uuid
        geoLocation:
          $ref: '#/components/schemas/GeoLocation'
        minLoadableAmount:
          type: integer
          description: Minimum loadable amount in dollars (per Postman example).
        maxLoadableAmount:
          type: integer
          description: Maximum loadable amount in dollars (per Postman example).
        supportsBillPay:
          type: boolean
    Address:
      type: object
      required:
        - addressLine1
        - city
        - state
        - zipCode
      properties:
        addressLine1:
          type: string
          maxLength: 50
        addressLine2:
          type: string
          maxLength: 50
        city:
          type: string
          maxLength: 50
        state:
          type: string
          minLength: 2
          maxLength: 2
        zipCode:
          type: string
          minLength: 5
          maxLength: 5
          pattern: ^[0-9]{5}$
    GeoLocation:
      type: object
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          format: double
          minimum: -90
          maximum: 90
        longitude:
          type: number
          format: double
          minimum: -180
          maximum: 180
    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
