openapi: 3.0.3
info:
  title: Mobile Check Cashing SDK — Delete Card
  version: '1'
  description: |
    Delete a registered card from the customer's account. The card
    can be added back later, but will be assigned a new `cardId` in
    the database.

    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/delete-card:
    post:
      tags:
        - Cards
      operationId: deleteCard
      summary: Delete a registered card
      description: |
        Removes a card from the customer's account. The card may be
        re-added later, but will receive a different `cardId`.
        Returns HTTP 204 with no body on success.
      parameters:
        - $ref: '#/components/parameters/SessionIdHeader'
        - $ref: '#/components/parameters/DeviceIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteCardRequest'
            example:
              customerId: 333554bf-b273-4d6e-b4f8-d319a1929608
              cardId: 3b242db9-67fc-4087-b0d6-156d37362a13
      responses:
        '204':
          description: Card deleted. No response body.
        '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/delete-card
                validationErrors:
                  - key: command.cardId
                    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:
    DeleteCardRequest:
      type: object
      required:
        - customerId
        - cardId
      properties:
        customerId:
          type: string
          format: uuid
          minLength: 36
          maxLength: 36
        cardId:
          type: string
          format: uuid
          minLength: 36
          maxLength: 36
    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
