{
  "openapi": "3.0.0",
  "info": {
    "title": "Outbound Card API",
    "version": "1.0",
    "description": "Notification API to be supported by the Banking system.\n  - 3-D Secure Operations ",
    "contact": {
      "name": "Thales",
      "url": "https://www.thalesgroup.com/"
    }
  },
  "servers": [
    {
      "url": "https://YOUR_DOMAIN_NAME"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/notifications/d1/v1/issuers/{issuerId}/cards/{cardId}/3ds/notifications": {
      "parameters": [
        {
          "$ref": "#/components/parameters/issuer-id-path"
        },
        {
          "$ref": "#/components/parameters/card-id-path"
        },
        {
          "$ref": "#/components/parameters/x-correlation-id-output"
        }
      ],
      "post": {
        "description": "This request is used by D1 to notify the issuer backend about all 3-D Secure operations done on a card.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/3dsCardOperation"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful"
          },
          "400": {
            "description": "Bad Request, Invalid request URI or header, or unsupported nonstandard parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "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": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        },
        "summary": "Notify 3-D Secure Card Operation",
        "operationId": "notify-card-3ds-operation"
      }
    }
  },
  "components": {
    "schemas": {
      "error": {
        "title": "error",
        "type": "object",
        "x-examples": {
          "Example 1": {
            "error": "Exmaple of a generic error description"
          }
        },
        "description": "An error occurred",
        "properties": {
          "error": {
            "type": "string",
            "description": "Detailed description of the error that occurred.\n"
          }
        }
      },
      "issuerId": {
        "maxLength": 10,
        "minLength": 10,
        "type": "string"
      },
      "cardId": {
        "type": "string",
        "description": "Unique identifier of the card.",
        "minLength": 1,
        "maxLength": 48,
        "pattern": "^[A-Za-z0-9_-]{1,48}$"
      },
      "operationId": {
        "type": "string",
        "description": "Unique identifier of the operation",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "operationStatusSuccessfulFailed": {
        "type": "string",
        "description": "Status of the operation",
        "enum": [
          "SUCCESSFUL",
          "FAILED"
        ]
      },
      "operationStartTime": {
        "type": "string",
        "title": "Operation Start Time",
        "description": "The time the request has been processed.\nFormat ISO 8601 YYYY-MM-DDThh:mm:ssTZD",
        "minLength": 1,
        "maxLength": 64,
        "example": "2022-06-16T06:28:02.492Z"
      },
      "consumerId": {
        "type": "string",
        "description": "Unique identifier of the consumer. ",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "appInstanceId": {
        "description": "Unique identifier of the issuer application instance.",
        "type": "string"
      },
      "authnType": {
        "type": "string",
        "enum": [
          "BIOMETRIC",
          "PLATFORM"
        ]
      },
      "operationError": {
        "type": "string",
        "description": "Human readable string representing the error, only present in case of operation failure"
      },
      "3dsCardOperation": {
        "title": "3-D Secure Operation",
        "type": "object",
        "description": "Details about a 3-D Secure operation.",
        "properties": {
          "operationId": {
            "$ref": "#/components/schemas/operationId"
          },
          "operation": {
            "type": "string",
            "description": "The operation type.",
            "enum": [
              "3DS_FRICTIONLESS",
              "3DS_CHALLENGE_OOB",
              "3DS_CHALLENGE_OOB_ISSUER",
              "3DS_CHALLENGE_OTP_SMS"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/operationStatusSuccessfulFailed"
          },
          "startTime": {
            "$ref": "#/components/schemas/operationStartTime"
          },
          "consumerId": {
            "$ref": "#/components/schemas/consumerId"
          },
          "details": {
            "oneOf": [
              {
                "title": "3DS_FRICTIONLESS, 3DS_CHALLENGE_OOB, 3DS_CHALLENGE_OOB_ISSUER, 3DS_CHALLENGE_OTP_SMS operations",
                "properties": {
                  "acsTransactionId": {
                    "description": "The ACS transaction identifier.",
                    "type": "string"
                  },
                  "threeDSServerTransId": {
                    "description": "The authentication session identifier from the 3DS server.",
                    "type": "string"
                  },
                  "dsTransId": {
                    "description": "The authentication session identifier from the directory server.",
                    "type": "string"
                  },
                  "purchase": {
                    "type": "object",
                    "properties": {
                      "merchantName": {
                        "description": "The merchant name.",
                        "type": "string"
                      },
                      "merchantType": {
                        "description": "The merchant category code.",
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 4
                      },
                      "amount": {
                        "description": "The nominal transaction amount value. Value without the decimal operator. Use the currency exponent to display amount with decimal. For example, an display amount of 789.99€ Euro is sent as 78999.",
                        "type": "string"
                      },
                      "currencyCode": {
                        "description": "The transaction currency code. Currency code in ISO 4217 alpha code format.",
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 3
                      },
                      "merchantId": {
                        "description": "The acquirer merchantId.",
                        "type": "string"
                      },
                      "countryCode": {
                        "description": "The merchant country code.",
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      "merchantUrl": {
                        "description": "The merchant URL.",
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  },
                  "acquirer": {
                    "type": "object",
                    "properties": {
                      "bin": {
                        "type": "string",
                        "maxLength": 16
                      },
                      "countryCode": {
                        "description": "The merchant country code.",
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      }
                    }
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "deviceChannel": {
                        "description": "The device channel. '01' is App-based, '02' is Browser, '03' is 3DS Requestor Initiated.",
                        "enum": [
                          "01",
                          "02",
                          "03"
                        ],
                        "type": "string"
                      },
                      "appInstanceId": {
                        "$ref": "#/components/schemas/appInstanceId"
                      },
                      "authnType": {
                        "$ref": "#/components/schemas/authnType"
                      }
                    }
                  },
                  "eci": {
                    "description": "The Electronic Commerce Indicator.",
                    "type": "string"
                  },
                  "authenticationMethod": {
                    "description": "The Authentication method used in case of challenge flow.",
                    "type": "string",
                    "enum": [
                      "02",
                      "07",
                      "09"
                    ]
                  },
                  "transStatus": {
                    "description": "Indicates whether a transaction qualifies as an authenticated transaction or account verification.\r\n\r\n|Operation Status|TransStatus Possible Values|\r\n|----|----|\r\n|SUCCESSFUL|Y|\r\n|FAILED|N, U, R|\r\n",
                    "type": "string",
                    "enum": [
                      "Y",
                      "N",
                      "U",
                      "R"
                    ]
                  },
                  "transStatusReason": {
                    "description": "Provides information on why the Transaction Status field has the specified value.",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "rba": {
                    "type": "object",
                    "properties": {
                      "evaluatedRule": {
                        "type": "array",
                        "items": {}
                      },
                      "selectedRule": {
                        "type": "array",
                        "items": {}
                      },
                      "appliedExemption": {
                        "type": "array",
                        "items": {}
                      }
                    }
                  }
                }
              }
            ],
            "type": "object"
          },
          "error": {
            "$ref": "#/components/schemas/operationError"
          }
        },
        "required": [
          "operationId",
          "operation",
          "status",
          "startTime"
        ]
      }
    },
    "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"
      }
    },
    "responses": {},
    "parameters": {
      "issuer-id-path": {
        "description": "The id of the issuer",
        "in": "path",
        "name": "issuerId",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/issuerId"
        }
      },
      "card-id-path": {
        "description": "The id of the card",
        "in": "path",
        "name": "cardId",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/cardId"
        }
      },
      "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.\n\nThere 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"
        }
      }
    }
  }
}