openapi: 3.0.0
info:
  contact:
    name: stephane.chretien@thalesgroup.com
  title: Outbound Digital Card API
  version: '1.0'
  description: D1 Services API - Digital Card Notification API<br/> This API is used by D1 to notify the issuer about any operation performed on a given digital card (lifecycle, device binding, etc)
servers:
  - url: https://YOUR_DOMAIN_NAME/notifications/d1/v1
security:
  - bearerAuth: []
paths:
  /issuers/{issuerId}/digitalCards/{digitalCardId}/notifications:
    post:
      description: This request is used by D1 to notify the issuer's backend about all operations done on a digital card.
      requestBody:
        content:
          application/json:
            schema:
              description: The following objects represent the notify digital card request body
              type: object
              properties:
                operationId:
                  $ref: '#/components/schemas/operationId'
                operation:
                  type: string
                  description: The lifecycle operation name performed on the target digital card.<br/> A digital card can be activated(i.e. resumed), suspended, deleted from the wallet application or CCI portal; it can also be renewed when expired by the TSP and updated after a card update/renewal operation (concerning a PAN and/or expiry date update).
                  enum:
                    - SUSPEND
                    - DELETE
                    - RESUME
                    - RENEW
                    - UPDATE
                status:
                  type: string
                  description: Status of the operation
                  enum:
                    - SUCCESSFUL
                    - FAILED
            examples: {}
        description: ''
      responses:
        '204':
          description: Successful
        '400':
          description: Bad Request, Invalid request URI or header, or unsupported nonstandard parameter
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
        '401':
          description: The provided Authorization header is missing or invalid
        '404':
          description: Resource not found. Unknown issuerId or consumerId or accountId or cardId
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                    description: Description of the error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
      summary: Notify Digital Card Operation
      operationId: notify-digital-card-operation
    parameters:
      - $ref: '#/components/parameters/issuer-id-path'
      - $ref: '#/components/parameters/digital-card-id-path'
      - $ref: '#/components/parameters/x-correlation-id-output'
components:
  parameters:
    issuer-id-path:
      description: The id of the issuer
      in: path
      name: issuerId
      required: true
      schema:
        $ref: '#/components/schemas/issuerId'
    digital-card-id-path:
      name: digitalCardId
      in: path
      required: true
      schema:
        type: string
        pattern: ^[A-Za-z0-9_-]{1,64}$
        minLength: 1
        maxLength: 64
      description: The id of the digital card
    x-correlation-id-output:
      description: |-
        Random identifier which can be used to correlate the different API calls done as part of a single use-case. This identifier will be the one primarily used for troubleshooting.

        There is no strong guarantee of the uniqueness of this identifier, so please refrain from using it for other purpose than logging and troubleshooting.
      in: header
      name: x-correlation-id
      schema:
        type: string
  schemas:
    error500:
      type: object
      description: Internal Server error
      required:
        - error
      properties:
        error:
          type: string
          description: Internal Server Error
          example: Internal Server Error
    issuerId:
      maxLength: 10
      minLength: 10
      type: string
    operationId:
      type: string
      description: Unique identifier of the operation
      minLength: 1
      maxLength: 64
      pattern: ^[A-Za-z0-9_-]{1,64}$
  securitySchemes:
    bearerAuth:
      type: http
      description: A JWT generated by the [Get Authorization Token API](oauth2-api).<br/>The server checks the validity of the provided token to control access to this protected resource. Please refer to [Get OAuth 2.0 access token](../../../integrate-the-d1-api/get-oauth-2.0-access-token) for more details on the flow and on how to get this JWT.
      scheme: bearer
      bearerFormat: JWT
