# Visa Consumer Authentication Service
Visa Consumer Authentication Service (VCAS) is a data-driven 3-D Secure (3DS)-compliant consumer authentication solution for issuers and processors that is designed to support issuer authentication strategies. Visa developed VCAS with the goal of balancing security and convenience. By employing advanced risk-based authentication technology, VCAS assists merchants and issuers in authenticating cardholders during the checkout process. This ensures legitimate transactions are approved swiftly and seamlessly, while accurately identifying and mitigating potentially fraudulent transactions.

## Version: 1

### Servers

| URL | Description |
| --- | ----------- |
| https://sandbox.api.visa.com | Sandbox server |

---
## VCAS-Marking-API
The Confirmed Marking API allows clients to notify VCAS when the status of a transaction has been verified. Issuers have the option to mark transactions as Good, Fraud, or Undetermined.

### [PUT] /vcas/v1/confirmedMarking/clear
**Clear Confirmed marking**

It mark the Transaction ID with marking status as Clear

#### Request Body

Mark a Transaction status to clear

| Required | Schema |
| -------- | ------ |
|  Yes | **application/json**: <br> |

#### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Clear Marking Successfully | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 400 | Bad Request | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 404 | Not Found - Transaction ID does not exist | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 500 | Internal server error | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |

### [POST] /vcas/v1/confirmedMarking/mark
**Confirmed marking**

It mark the Transacction ID  with marking status as Fraud, Good etc.

#### Request Body

Mark a Transaction

| Required | Schema |
| -------- | ------ |
|  Yes | **application/json**: <br> |

#### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 201 | Created | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 400 | Bad Request | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 404 | Not Found - Transaction ID does not exist | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 500 | Internal server error | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |

### [POST] /vcas/v1/confirmedMarking/markings
**Get confirmed marking**

It get the marking data from DB

#### Request Body

Get marking data from  DB

| Required | Schema |
| -------- | ------ |
|  Yes | **application/json**: { **"pan"**: , **"IssuerID"**: , **"transactionId"**:  }<br> |

#### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Get Markings Successfully | **application/json**: { **"orgUnitId"**:  }<br> |
| 400 | Bad Request | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 404 | Not Found - Transaction ID does not exist | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |
| 500 | Internal server error | **application/json**: { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  }<br> |

---
## VCAS-CardStatus-API
APIs for managing Card Status information in VCAS product.

### [PUT] /vcas/v1/cardStatus/upsert
**Upsert Card Status**

Upsert the card status

#### Request Body

Card status upsert request

| Required | Schema |
| -------- | ------ |
|  No | **application/json**: <br> |

#### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Added/Updated the card status record | **application/json**: <br> |
| 400 | Incomplete or invalid request information | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |
| 401 | Access denied | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |
| 404 | Account information not found | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |
| 500 | Error while processing the request | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |

### [POST] /vcas/v1/cardStatus/lookup
**Look up Card Status**

Get the current card status

#### Request Body

Card status lookup request

| Required | Schema |
| -------- | ------ |
|  No | **application/json**: { **"orgUnitId"**: , **"accountNumber"**:  }<br> |

#### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Successful operation | **application/json**: { **"status"**: <br>**Available values:** "ACTIVE", "BLOCKED", "BYPASS", "FORCED_CHALLENGE", "TIMED_BLOCK", **"orgUnitId"**: , **"statusEndTs"**: undefined (date-time) }<br> |
| 400 | Incomplete or invalid request information | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |
| 401 | Access denied | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |
| 404 | Account information not found | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |
| 500 | Error while processing the request | **application/json**: { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  }<br> |

---
### Schemas

#### Timestamp Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| Timestamp | undefined (date-time) |  |  |

**Example**
<pre>2017-07-21T17:32:28Z</pre>

#### CardStatusUpsertRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| status | <br>**Available values:** "ACTIVE", "BLOCKED", "BYPASS", "FORCED_CHALLENGE", "TIMED_BLOCK" | *Enum:* `"ACTIVE"`, `"BLOCKED"`, `"BYPASS"`, `"FORCED_CHALLENGE"`, `"TIMED_BLOCK"` | No |
| orgUnitId |  | Unique ID given to each issuer<br>*Example:* `"55555551dd3648c5b814d2ed"` | No |
| accountNumber |  | Primary account number (PAN) is the key identifier for the cardholder's account.<br>*Example:* `"1234567890123456"` | No |
| statusDuration |  | Status will be maintained for the given duration and then it will be ACTIVE<br>*Example:* `"15m"` | No |

#### createMarkRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| createMarkRequest |  |  |  |

#### DateWrapper Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| DateWrapper |  |  |  |

**Example**
<pre>2024-08-08T16:23:17.388Z</pre>

#### NumberWrapper Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| NumberWrapper |  |  |  |

**Example**
<pre>5477</pre>

#### clearTransactionRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| clearTransactionRequest |  |  |  |

#### CardStatusLookupRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| orgUnitId |  | Unique ID given to each issuer<br>*Example:* `"55555551dd3648c5b814d2ed"` | No |
| accountNumber |  | Primary account number (PAN) is the key identifier for the cardholder's account.<br>*Example:* `"1234567890123456"` | No |

#### clear Schema

Confimred Marking status for specific transaction to make clear

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| clear |  | Confimred Marking status for specific transaction to make clear |  |

**Example**
<pre>Clear</pre>

#### apiResponseType Schema

Basic API Response

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| errorDetail |  | Detailed error message in case of error response<br>*Example:* `"null"` | No |
| responseCode | <br>**Available values:** "0", "10", "20", "30", "40", "50" | Service response code 0 - Success; 10 - Invalid request; 20 - Parsing error; 30 - forbidden; 40 - Not found; 50 - System error<br>*Enum:* `"0"`, `"10"`, `"20"`, `"30"`, `"40"`, `"50"`<br>*Example:* `"0"` | Yes |
| responseMessage |  | Service response text specific for CRUD operations<br>*Example:* `"Successfully Processed"` | Yes |

#### getMarkingDataRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| pan |  | Cardholder PAN<br>*Example:* `"4012009508724613"` | Yes |
| IssuerID |  | Issuer Id assigned by Cardinal<br>*Example:* `"63ee0c5dc4844d60395c8d37"` | No |
| transactionId |  | Cardholder Transaction Id<br>*Example:* `"f37a6599-0d0a-4fbb-9dbe-aad41da883ab"` | No |

#### encryptedPAN Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| encryptedPAN |  |  |  |

**Example**
<pre>2sDalkHhtwafeL/ZPu3dexFTzxFbGjGeSDT5R44mTEU=</pre>

#### getMarkingDataResponse Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| encryptedPAN |  | *Example:* `"2sDalkHhtwafeL/ZPu3dexFTzxFbGjGeSDT5R44mTEU="` | No |
| confirmedData |  |  | No |

#### commonAttributesType Schema

Basic API Request attributes

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| orgUnitId |  | Issuer Id assigned by Cardinal<br>*Example:* `"63ee0c5dc4844d60395c8d37"` | Yes |

#### createMarkResponse Schema

Confrimed marking response properties

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| createMarkResponse | { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  } | Confrimed marking response properties |  |

#### transactionId Schema

Cardholder Transaction Id

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| transactionId |  | Cardholder Transaction Id |  |

**Example**
<pre>f37a6599-0d0a-4fbb-9dbe-aad41da883ab</pre>

#### clearTransactionResponse Schema

Confrimed marking response properties

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| clearTransactionResponse | { **"errorDetail"**: , **"responseCode"**: <br>**Available values:** "0", "10", "20", "30", "40", "50", **"responseMessage"**:  } | Confrimed marking response properties |  |

#### CardStatusResponse Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| status | <br>**Available values:** "ACTIVE", "BLOCKED", "BYPASS", "FORCED_CHALLENGE", "TIMED_BLOCK" | *Enum:* `"ACTIVE"`, `"BLOCKED"`, `"BYPASS"`, `"FORCED_CHALLENGE"`, `"TIMED_BLOCK"` | No |
| orgUnitId |  | Unique ID given to each issuer<br>*Example:* `"55555551dd3648c5b814d2ed"` | No |
| statusEndTs | undefined (date-time) | *Example:* `"2017-07-21T17:32:28Z"` | No |

#### OrgUnitId Schema

Unique ID given to each issuer

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| OrgUnitId |  | Unique ID given to each issuer |  |

**Example**
<pre>55555551dd3648c5b814d2ed</pre>

#### StatusType Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| StatusType | <br>**Available values:** "ACTIVE", "BLOCKED", "BYPASS", "FORCED_CHALLENGE", "TIMED_BLOCK" |  |  |

#### Response200 Schema

Added/Updated the card status record

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| Response200 | { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  } | Added/Updated the card status record |  |

#### Response400 Schema

Incomplete or invalid request information

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| Response400 | { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  } | Incomplete or invalid request information |  |

#### PAN Schema

Primary account number (PAN) is the key identifier for the cardholder's account.

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| PAN |  | Primary account number (PAN) is the key identifier for the cardholder's account. |  |

**Example**
<pre>1234567890123456</pre>

#### Response401 Schema

Forbidden access to the account information

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| Response401 | { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  } | Forbidden access to the account information |  |

#### Response500 Schema

Internal server error

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| Response500 | { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  } | Internal server error |  |

#### mark Schema

Confimred Marking status for specific transaction[Good,Fraud,Undetermined]

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| mark | <br>**Available values:** "good", "fraud", "Undetermined" | Confimred Marking status for specific transaction[Good,Fraud,Undetermined] |  |

**Example**
<pre>Good</pre>

#### orgUnitIdType Schema

Issuer Id assigned by Cardinal

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| orgUnitIdType |  | Issuer Id assigned by Cardinal |  |

**Example**
<pre>63ee0c5dc4844d60395c8d37</pre>

#### Response404 Schema

Account details not found

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| Response404 | { **"errorDetail"**: , **"responseCode"**: , **"responseMessage"**:  } | Account details not found |  |
