openapi: 3.0.1
info:
  title: payments_cards API
  description: Merged OpenAPI spec for payments_cards domain
  version: 1.0.0
servers:
- url: https://api.cve.btx.eu.banqup.com/payments/cards
paths:
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards:
    get:
      description: 'List cards for the given payment account <br/> Scope: space_read,
        account_read'
      operationId: listCards
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: query
        name: cardHolderEntityId
        required: false
        schema:
          type: string
          format: uuid
      - in: query
        name: cardHolderSubject
        required: false
        schema:
          type: string
      - in: query
        name: includeTerminated
        required: false
        schema:
          type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCardResponse'
          description: Card details listing
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: List cards
      tags:
      - Card
    post:
      description: 'Request issuance of a new card for the given payment account <br/>
        Scope: space_read, space_write, account_read, account_write'
      operationId: createCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCardRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
          description: Card issuance request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - space_write
        - account_read
        - account_write
      summary: Create card
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:
    get:
      description: 'Request card details <br/> Scope: space_read, account_read'
      operationId: getCardDetails
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardDetails'
          description: Card details request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Get card details
      tags:
      - Card
    patch:
      description: 'Request update card <br/> Scope: space_read, account_read'
      operationId: updateCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCardRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardDetails'
          description: Update card request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Update card
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}/secureAccess:
    post:
      description: 'Request access token <br/> Scope: space_read, account_read'
      operationId: getSecureAccess
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecureAccessRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecureAccessResult'
          description: Access token request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Get access token
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}/transactions:
    get:
      description: 'Request card transactions <br/> Scope: space_read, account_read'
      operationId: listCardTransactions
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      - description: Start date
        example: 2024-01-15
        in: query
        name: dateFrom
        required: false
        schema:
          type: string
          format: date
          description: Start date
          example: 2024-01-15
      - description: End date
        example: 2024-02-15
        in: query
        name: dateTo
        required: false
        schema:
          type: string
          format: date
          description: End date
          example: 2024-02-15
      - example: 100
        in: query
        name: amountFrom
        required: false
        schema:
          type: number
          example: 100
      - example: 1000
        in: query
        name: amountTo
        required: false
        schema:
          type: number
          example: 1000
      - example: Merchant
        in: query
        name: merchantName
        required: false
        schema:
          type: string
          example: Merchant
      - description: Page index
        example: 1
        in: query
        name: page
        required: false
        schema:
          type: integer
          format: int64
          default: 0
          description: Page index
          example: 1
          minimum: 0
      - description: Number of objects in a page
        example: 20
        in: query
        name: size
        required: false
        schema:
          type: integer
          format: int32
          default: 30
          description: Number of objects in a page
          example: 20
          maximum: 100
          minimum: 1
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardTransactionsResponse'
          description: Card transactions request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Get card transactions
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:activate:
    post:
      description: 'Request activation of a new card <br/> Scope: space_read, account_read'
      operationId: activateCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateCardRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateCardResult'
          description: Card activation request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Activate card
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:pin:
    post:
      description: 'Request set card pin <br/> Scope: space_read, account_read'
      operationId: setCardPin
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetCardPinRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetCardPinResult'
          description: Set card pin request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Set card pin
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:replace:
    post:
      description: 'Request physical card replacement <br/> Scope: space_read, account_read'
      operationId: replaceCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceCardRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplaceCardResult'
          description: Physical card replacement request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Replace physical card
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:suspend:
    post:
      description: 'Request suspend card <br/> Scope: space_read, account_read'
      operationId: suspendCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Suspend card request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Suspend card
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:terminate:
    post:
      description: 'Request terminate card <br/> Scope: space_read, account_read'
      operationId: terminateCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Terminate card request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Terminate card
      tags:
      - Card
  /v1/spaces/{spaceId}/paymentAccounts/{paymentAccountId}/cards/{cardId}:unsuspend:
    post:
      description: 'Request unsuspend card <br/> Scope: space_read, account_read'
      operationId: unsuspendCard
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentAccountId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: cardId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Unsuspend card request registered
        '400':
          content:
            application/json:
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: BAD REQUEST
        '401':
          content:
            application/json:
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: UNAUTHORIZED
        '403':
          content:
            application/json:
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: FORBIDDEN
        '503':
          content:
            application/json:
              example:
                status: 503
                error: UNAVAILABLE
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Service Unavailable
                detail: Service is unavailable. Please try again later.
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: SERVICE UNAVAILABLE
      security:
      - oauth2:
        - space_read
        - account_read
      summary: Unsuspend card
      tags:
      - Card
components:
  schemas:
    AccessTokenResult:
      type: object
      properties:
        token:
          type: string
          minLength: 1
      required:
      - token
    ActivateCardRequest:
      type: object
      properties:
        displayHeaders:
          type: boolean
        redirectUrl:
          type: string
          example: https://www.example.com
          minLength: 1
      required:
      - displayHeaders
      - redirectUrl
    ActivateCardResult:
      type: object
      properties:
        activationUrl:
          type: string
    AmountDto:
      type: object
      properties:
        currency:
          type: string
          description: International code of the currency used
          example: EUR
          pattern: '[A-Z]{3}'
        value:
          type: string
          description: Amount value with a maximum of 14 integer digits and 2 fractional
            digits
          example: '10.05'
      required:
      - currency
      - value
    ApiErrorProblemDetail:
      type: object
      properties:
        detail:
          type: string
        error:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
        requestId:
          type: string
        status:
          type: integer
          format: int32
        timestamp:
          type: string
          format: date-time
        title:
          type: string
        type:
          type: string
          format: uri
      required:
      - error
      - requestId
      - timestamp
    Card:
      type: object
      properties:
        accountId:
          type: string
          format: uuid
        activatedAt:
          type: string
          format: date-time
        availableOperations:
          type: array
          items:
            type: string
            enum:
            - ACTIVATE_CARD
            - DEACTIVATE_CARD
            - SUSPEND_CARD
            - UNSUSPEND_CARD
            - RENAME_CARD
            - REPLACE_DAMAGED_CARD
            - REPORT_STOLEN_CARD
            - VIEW_LIMITS_AND_USAGE
            - UPDATE_LIMITS_AND_USAGE
            - VIEW_SETTINGS
            - UPDATE_SETTINGS
            - MANAGE_PIN
            - VIEW_UNMASKED_CARD_DETAILS
        createdAt:
          type: string
          format: date-time
        holder:
          $ref: '#/components/schemas/Cardholder'
        id:
          type: string
          format: uuid
        label:
          type: string
          example: Card label
          minLength: 1
        maskedPan:
          type: string
          minLength: 1
          pattern: \d{4}
        pinNeedsToBeSet:
          type: boolean
        status:
          $ref: '#/components/schemas/Status'
        type:
          type: string
          enum:
          - VIRTUAL
          - PHYSICAL
      required:
      - accountId
      - activatedAt
      - availableOperations
      - createdAt
      - holder
      - id
      - label
      - maskedPan
      - pinNeedsToBeSet
      - status
      - type
    CardDetails:
      type: object
      properties:
        accountId:
          type: string
          format: uuid
        activatedAt:
          type: string
          format: date-time
        availableOperations:
          type: array
          items:
            type: string
            enum:
            - ACTIVATE_CARD
            - DEACTIVATE_CARD
            - SUSPEND_CARD
            - UNSUSPEND_CARD
            - RENAME_CARD
            - REPLACE_DAMAGED_CARD
            - REPORT_STOLEN_CARD
            - VIEW_LIMITS_AND_USAGE
            - UPDATE_LIMITS_AND_USAGE
            - VIEW_SETTINGS
            - UPDATE_SETTINGS
            - MANAGE_PIN
            - VIEW_UNMASKED_CARD_DETAILS
        createdAt:
          type: string
          format: date-time
        holder:
          $ref: '#/components/schemas/Cardholder'
        id:
          type: string
          format: uuid
        label:
          type: string
          example: Card label
          minLength: 1
        limits:
          $ref: '#/components/schemas/SpendLimit'
        maskedPan:
          type: string
          minLength: 1
          pattern: \d{4}
        pinNeedsToBeSet:
          type: boolean
        settings:
          $ref: '#/components/schemas/CardSettings'
        status:
          $ref: '#/components/schemas/Status'
        type:
          type: string
          enum:
          - VIRTUAL
          - PHYSICAL
      required:
      - accountId
      - activatedAt
      - availableOperations
      - createdAt
      - holder
      - id
      - label
      - limits
      - maskedPan
      - pinNeedsToBeSet
      - settings
      - status
      - type
    CardIssuanceDetails:
      type: object
      description: Details of the requested card
      properties:
        country:
          type: string
          minLength: 1
        label:
          type: string
          description: Label of the card
          example: My card
          minLength: 1
        locale:
          type: string
        type:
          type: string
          enum:
          - VIRTUAL
          - PHYSICAL
      required:
      - country
      - label
      - locale
      - type
    CardLimit:
      type: object
      properties:
        currency:
          type: object
          example: EUR
          properties:
            currencyCode:
              type: string
            defaultFractionDigits:
              type: integer
              format: int32
            displayName:
              type: string
            numericCode:
              type: integer
              format: int32
            numericCodeAsString:
              type: string
            symbol:
              type: string
        currentLimit:
          type: number
          example: 90
        currentUsage:
          type: number
          example: 80
        expiresAt:
          type: string
          format: date-time
        maximumLimit:
          type: number
          example: 10
      required:
      - currency
      - currentLimit
      - currentUsage
      - expiresAt
      - maximumLimit
    CardSettings:
      type: object
      properties:
        contactlessEnabled:
          type: boolean
        ecommerceEnabled:
          type: boolean
        regions:
          type: array
          items:
            type: string
            enum:
            - UNITED_STATES
            - EUROPE
            - REST_OF_THE_WORLD
          uniqueItems: true
    CardStatusDetails:
      type: object
      properties:
        reason:
          type: string
          enum:
          - SUSPENDED_BY_USER
          - CVC_ATTEMPTS_EXCEEDED
          - PIN_ATTEMPTS_EXCEEDED
          - UNKNOWN
      required:
      - reason
    CardTransaction:
      type: object
      description: List of card transactions
      properties:
        amountInAccountCurrency:
          $ref: '#/components/schemas/AmountDto'
        amountInOriginalCurrency:
          $ref: '#/components/schemas/AmountDto'
        declineReason:
          type: string
          description: Reason for transaction being declined (only present for declined
            transactions)
        fxRate:
          type: string
          description: '1.0'
          minLength: 1
        id:
          type: string
          format: uuid
        merchant:
          $ref: '#/components/schemas/Merchant'
        schemeBrand:
          type: string
          description: MASTERCARD
          enum:
          - VISA
          - MASTERCARD
          - DISCOVER
          - PULSE
        status:
          type: string
          description: AUTHORIZED
          enum:
          - AUTHORIZED
          - CLEARED
          - PENDING_REFUND
          - REFUNDED
          - DECLINED
          - FULLY_REVERSED
        transactionDate:
          type: string
          format: date-time
        type:
          type: string
          description: PURCHASE
          enum:
          - PURCHASE
          - ATM_CASH_WITHDRAWAL
          - REFUND
          - ORIGINAL_CREDIT_TRANSFER
      required:
      - amountInAccountCurrency
      - amountInOriginalCurrency
      - fxRate
      - id
      - merchant
      - schemeBrand
      - status
      - transactionDate
      - type
    CardTransactionsResponse:
      type: object
      properties:
        currentPage:
          type: integer
          format: int32
          description: Current page
        pageSize:
          type: integer
          format: int32
          description: Response page size
        totalElements:
          type: integer
          format: int64
          description: Total number of items in the database that correspond to this
            search criteria
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/CardTransaction'
    Cardholder:
      type: object
      properties:
        firstName:
          type: string
          example: John
          minLength: 1
        id:
          type: string
          format: uuid
        lastName:
          type: string
          example: Alex
          minLength: 1
      required:
      - firstName
      - id
      - lastName
    CreateCardRequest:
      type: object
      properties:
        card:
          $ref: '#/components/schemas/CardIssuanceDetails'
        cardHolder:
          $ref: '#/components/schemas/CreateCardRequestHolder'
        deliveryAddress:
          $ref: '#/components/schemas/SepaStructuredAddress'
      required:
      - card
    CreateCardRequestHolder:
      type: object
      description: Information identifying the card holder. If the requester and card
        holder are the same, this should be null
      properties:
        entityId:
          type: string
          format: uuid
          description: Identifier of the card holder's personal entity
        subject:
          type: string
          description: Keycloak subject of the card holder user
    ListCardResponse:
      type: object
      properties:
        cards:
          type: array
          items:
            $ref: '#/components/schemas/Card'
        currentPage:
          type: integer
          format: int32
          description: Current page
        pageSize:
          type: integer
          format: int32
          description: Response page size
        totalElements:
          type: integer
          format: int64
          description: Total number of items in the database that correspond to this
            search criteria
    Merchant:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/StructuredAddress'
        name:
          type: string
          description: The name of the merchant
          minLength: 1
      required:
      - address
      - name
    NestedProblem:
      type: object
      properties:
        detail:
          type: string
        error:
          type: string
        title:
          type: string
        type:
          type: string
          format: uri
      required:
      - detail
      - error
      - title
    ReplaceCardRequest:
      type: object
      properties:
        deliveryAddress:
          $ref: '#/components/schemas/SepaStructuredAddress'
        isImmediateTerminationRequired:
          type: boolean
          description: A flag indicating whether the card is deactivated/terminated
            immediately or after replacement.
    ReplaceCardResult:
      type: object
      properties:
        fulfillmentStatus:
          type: string
          enum:
          - ISSUED
          - ORDERED
          - REJECTED
          - REORDERED
          - SHIPPED
          - DELIVERED
          - DIGITALLY_PRESENTED
        id:
          type: string
          format: uuid
        maskedPan:
          type: string
          example: '4598'
          minLength: 1
          pattern: \d{4}
        status:
          type: string
          enum:
          - UNACTIVATED
          - ACTIVE
          - SUSPENDED
          - TERMINATED
          - UNSUPPORTED
          - LIMITED
          - UNKNOWN
      required:
      - fulfillmentStatus
      - id
      - maskedPan
      - status
    SecureAccessRequest:
      type: object
      properties:
        type:
          type: string
          enum:
          - SHOW_PAN
          - SHOW_PIN
      required:
      - type
    SecureAccessResult:
      type: object
      properties:
        access:
          $ref: '#/components/schemas/AccessTokenResult'
        cardIssuerProcessor:
          type: string
          minLength: 1
      required:
      - access
      - cardIssuerProcessor
    SepaStructuredAddress:
      type: object
      description: 'EPC Interbank Structured Address Structure. Structured addresses
        are address information split into several fields instead of one unstructured
        address field.

        From November 2023, all banks and PSPs will have to accept payment messages
        with structured addresses.

        From 2025, banks and PSPs will have to send all their messages with structured
        addresses.

        '
      externalDocs:
        description: More about EPC Interbank Structured Address Structure
        url: https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2022-10/EPC153-22%20EPC%20guidance%20document%20-%20Use%20of%20Structured%20Address%20under%20the%20SEPA%20Payment%20Schemes%20as%20of%20Nov%202025.pdf
      properties:
        buildingName:
          type: string
          description: Name of the building or house.
          example: Empire State Building
          maxLength: 35
          minLength: 0
        buildingNumber:
          type: string
          description: A unique number assigned to the building in the street or area
          example: A22
        city:
          type: string
          description: Name of the city
          example: La Hulpe
          minLength: 1
        cityLocationName:
          type: string
          description: Specific location name within the town.
          example: City center
          maxLength: 35
          minLength: 0
        country:
          type: string
          description: Name of the country
          example: Belgium
        countryCode:
          type: string
          description: Two-letter country code defined in ISO 3166
          example: BE
        department:
          type: string
          description: Identification of a division of a large organisation or building.
          example: Finance
          maxLength: 70
          minLength: 0
        district:
          type: string
          description: Identifies a subdivision within a country sub-division
          example: Walloon Brabant
        floor:
          type: string
          description: A unique number or name assigned to the floor within the building
          example: ground
          maxLength: 70
          minLength: 0
        house:
          type: string
        level:
          type: string
        postBox:
          type: string
          description: Numbered box in a post office, assigned to a person or organisation,
            where letters are kept until called for.
          example: '1033'
          maxLength: 16
          minLength: 0
        postalCode:
          type: string
          description: Series of letters or digits or both, included in a postal address
          example: 12345-1A
        postalCodeExtension:
          type: string
        province:
          type: string
        room:
          type: string
          description: Building room number.
          example: '2.22'
          maxLength: 70
          minLength: 0
        state:
          type: string
          description: Name of the state
          example: California
        streetName:
          type: string
          description: Name of the street
          example: Avenue Reine Astrid
        subDepartment:
          type: string
          description: Identification of a sub-division of a large organisation or
            building.
          example: Accounting
          maxLength: 70
          minLength: 0
        subDistrict:
          type: string
          description: Identifies a subdivision of a country such as state, region,
            county.
          example: Wallonia
          maxLength: 35
          minLength: 0
      required:
      - city
    SetCardLimitRequest:
      type: object
      properties:
        dailyAtm:
          type: number
          example: 100
        weeklyAtm:
          type: number
          example: 100
        weeklyPurchase:
          type: number
          example: 100
    SetCardPinRequest:
      type: object
      properties:
        pin:
          type: string
          example: '4265'
          minLength: 1
      required:
      - pin
    SetCardPinResult:
      type: object
      properties:
        pinSyncAdvised:
          type: boolean
        warningMessage:
          type: string
          minLength: 1
      required:
      - pinSyncAdvised
      - warningMessage
    SpendLimit:
      type: object
      properties:
        dailyAtm:
          $ref: '#/components/schemas/CardLimit'
        weeklyAtm:
          $ref: '#/components/schemas/CardLimit'
        weeklyPurchase:
          $ref: '#/components/schemas/CardLimit'
      required:
      - dailyAtm
      - weeklyAtm
      - weeklyPurchase
    Status:
      type: object
      discriminator:
        mapping:
          ACTIVE: '#/components/schemas/Status'
          LIMITED: '#/components/schemas/Status'
          SUSPENDED: '#/components/schemas/SuspendedStatus'
          TERMINATED: '#/components/schemas/Status'
          UNACTIVATED: '#/components/schemas/Status'
          UNKNOWN: '#/components/schemas/Status'
          UNSUPPORTED: '#/components/schemas/Status'
        propertyName: card
      properties:
        card:
          type: string
          enum:
          - UNACTIVATED
          - ACTIVE
          - SUSPENDED
          - TERMINATED
          - UNSUPPORTED
          - LIMITED
          - UNKNOWN
        fulfillment:
          type: string
          enum:
          - ISSUED
          - ORDERED
          - REJECTED
          - REORDERED
          - SHIPPED
          - DELIVERED
          - DIGITALLY_PRESENTED
      required:
      - card
      - fulfillment
    StructuredAddress:
      type: object
      properties:
        buildingNumber:
          type: string
          description: A unique number assigned to the building in the street or area
          example: A22
        city:
          type: string
          description: Name of the city
          example: La Hulpe
          minLength: 1
        country:
          type: string
          description: Name of the country
          example: Belgium
        countryCode:
          type: string
          description: Two-letter country code defined in ISO 3166
          example: BE
        house:
          type: string
        level:
          type: string
        postalCode:
          type: string
          description: Series of letters or digits or both, included in a postal address
          example: 12345-1A
        postalCodeExtension:
          type: string
        province:
          type: string
        state:
          type: string
          description: Name of the state
          example: California
        streetName:
          type: string
          description: Name of the street
          example: Avenue Reine Astrid
      required:
      - city
    SuspendedStatus:
      type: object
      properties:
        card:
          type: string
          enum:
          - UNACTIVATED
          - ACTIVE
          - SUSPENDED
          - TERMINATED
          - UNSUPPORTED
          - LIMITED
          - UNKNOWN
        details:
          $ref: '#/components/schemas/CardStatusDetails'
        fulfillment:
          type: string
          enum:
          - ISSUED
          - ORDERED
          - REJECTED
          - REORDERED
          - SHIPPED
          - DELIVERED
          - DIGITALLY_PRESENTED
      required:
      - card
      - details
      - fulfillment
    UpdateCardFieldsInput:
      type: object
      properties:
        label:
          type: string
          minLength: 1
      required:
      - label
    UpdateCardRequest:
      type: object
      properties:
        card:
          $ref: '#/components/schemas/UpdateCardFieldsInput'
        deliveryAddress:
          $ref: '#/components/schemas/SepaStructuredAddress'
        limits:
          $ref: '#/components/schemas/SetCardLimitRequest'
        settings:
          $ref: '#/components/schemas/CardSettings'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.cve.btx.eu.banqup.com/oauth2/auth
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
tags:
- description: Endpoints related to cards
  name: Card
