# Verify a PIN for a PAN-less Issuer
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/pin-management/verify-pin-for-panless-issuer/index.md

## Test case -- Success {#test-case--success}

This test case describes verifying a PIN by sending a PIN block in ISO-1 format encrypted with the Mastercard Processing Public RSA key retrieved by using a dedicated `/public-keys` endpoint.

Note: The test case does not describe the end-to-end payload encryption used for every API operation in the Sandbox environment. Refer to [Encryption](https://developer.mastercard.com/mastercard-processing-core/documentation/api-basics-section/encryption/index.md) for more information. For this test case, use the following information in the request:

<br />

|  Header   | Available value (DER format) |
|-----------|------------------------------|
| Key-Index | A1564386531162               |

|   Path parameter   | Available value |
|--------------------|-----------------|
| `card_contract_id` | 70001           |
|                    | 70002           |
|                    | 70003           |
|                    | 70004           |
|                    | 70005           |


Note: To generate an encrypted value of the `pinBlock` field, use the PIN assigned to the `card_contract_id` value which you want to use in the request.

| card_contract_id | PIN  |
|------------------|------|
| 70001            | 7580 |
| 70002            | 5336 |
| 70003            | 2360 |
| 70004            | 3011 |
| 70005            | 4041 |

And encrypt it with the following Public RSA key (the `Key-Index` = A1564386531162)
`30820122300D06092A864886F70D01010105000382010F003082010A0282010100A7D079A8769BCD340574E8E6C0A2810C377279E5EA0B422B9132F955860730E7637DFAB0A1C6F117B25E3DB3D2A5A9F2691BBC7E0178ADFD12908C3E6E6D3A77AA26E25A6570FCC423561628879E918DC0C798527318308C70BBE2BC4597B83B96CB3680FE6F8E60D68B465E2B30558712A2D63A544239BE7B5F2A49C82FB3388A22644741A945EC9ACB3F219C3B6826241BE1706EF384100EC83D0D7FAE6CCF4E69E0EE02BF84C21553FA1999A8DB91C4193D1E671D5A22B1876E1DC81F1ED7033F3A26FF62E492A63ADA58AAE248D5E47896592CB9A7023CB8B8700882B4DCBF34C16F7FA00DF4C3931A4612E0E2A09586780E89D28FAAA195C07ADE88286F0203010001`
**Sample request**

<br />

`POST /cards/70001/pins/verifications -H "Key-Index: A1564386531162"`

```JSON
{
  "cardExpiryDate": "3004",
  "cardSequenceNumber": "2",
  "pinBlock": "
69DF3BAA5CAF165A940FC1F8AE68573B8AF93F5EDB20E208953E87CC50C19F0BB11A448AE76FA87A8940EE290FEBC2518DDAAB85BF4AA393FAE060F4CD30CC73AAFF3755680E59FC59BF8D2303B7990C1EC648A0D24D66D57DAB0147434B54955FEA38890C1AFDE6C60EE6D9174BC567D151669576D0395A1B235AF4CD7C581EF238FD26E1DF53085B09DDA9A81EE9DA02D7C7C9E0C266B60C7E9BAC046DCF704EC6CA31486CF6B562C28D47CD6ED124CAE28D3A2E590CFBAA90604090F601B16423E375D6CC01FAC5E0125F7BCC735ED53F88CB7D34FDEFBB19A0EE09F156E337150CE96B2A16419D0F0981CCE44EC8A946CEA69A238AA04EC46FDFFE91A03D
"
}
```

**Sample response**

`200`

```JSON
{
    "verificationResult": "PIN_CORRECT"
}
```

## Test case -- Success -- Incorrect PIN {#test-case--success--incorrect-pin}

This test case describes verifying a PIN by sending a PIN block in ISO-1 format encrypted with the Mastercard Processing Public RSA key (retrieved by using a dedicated `/public-keys` endpoint) where PIN is incorrect.

This test case describes verifying a PIN by sending PIN block in ISO-1 format encrypted with Mastercard Processing Public RSA key retrieved by using a dedicated operation `getPublicRsaKey`.

For this test case, use the following information in the request:

|   Field   |       Available value        |
|-----------|------------------------------|
| Header    | Available value (DER format) |
| Key-Index | A1564386531162               |

|   Field    |                                                                                                                                                                                                                                                          Available value                                                                                                                                                                                                                                                           |
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pinBlock` | `78193A0E1053587FF63741C21B089C69CB448E9C0DBE07BFA739C80D81C4997046643740E0BB50D1EE2093F38AFE00C6B0A258515BCC272900087C10217F8C277E7E4112FD632AD35B4D62482FA322E3AA6617409B2B34D69694547A0FA5C9A1801834FAEE97F5EADE86750493369F84823AB15981DF4A55258FED13D70CAF217AEF2CB1350EBD07A1F021883E66D8B4760EEB03E529492BBE25F41B7A43042C51054B66F0C50BD272F14ED4C3F6B067843D4A516D7C79DE50FF28DA63AF21106DA3206E1F8539351E8E0B0BF680A0E64FA7DBAEB4FBE826630029CE45A1D000B99A56F92425B7F6239E9C677127A5363088B02D98A95C323D14C70B5DDDCFE6` |

**Sample request**

`POST /cards/70001/pins/verifications -H "Key-Index: A1564386531162"`

```JSON
{ 
  "cardExpiryDate": "3004",
  "cardSequenceNumber": "2",
  "pinBlock": "78193A0E1053587FF63741C21B089C69CB448E9C0DBE07BFA739C80D81C4997046643740E0BB50D1EE2093F38AFE00C6B0A258515BCC272900087C10217F8C277E7E4112FD632AD35B4D62482FA322E3AA6617409B2B34D69694547A0FA5C9A1801834FAEE97F5EADE86750493369F84823AB15981DF4A55258FED13D70CAF217AEF2CB1350EBD07A1F021883E66D8B4760EEB03E529492BBE25F41B7A43042C51054B66F0C50BD272F14ED4C3F6B067843D4A516D7C79DE50FF28DA63AF21106DA3206E1F8539351E8E0B0BF680A0E64FA7DBAEB4FBE826630029CE45A1D000B99A56F92425B7F6239E9C677127A5363088B02D98A95C323D14C70B5DDDCFE6"
}
```

**Sample response**

`200`

```JSON
{
  "verificationResult": "PIN_NOT_CORRECT"
}
```

## Test case -- Success -- Incorrect PIN block {#test-case--success--incorrect-pin-block}

This test case describes verifying PIN by sending PIN block in ISO-1 format encrypted with the Mastercard Processing Public RSA key (retrieved by using a dedicated `/public-keys` endpoint) where PIN block is incorrect.

For this test case, use the following information in the request:

|   Header    | Available value |
|-------------|-----------------|
| `Key-Index` | A1564386531162  |

|   Field    | Available value |
|------------|-----------------|
| `pinBlock` | 0000123456789A  |

**Sample request**

`POST /cards/70001/pins/verifications -H "Key-Index: A1564386531162"`

```JSON
{
  "cardExpiryDate": "3004",
  "cardSequenceNumber": "2",
 "pinBlock": "0000123456789A"
}
```

**Sample response**

`200`

```JSON
{
  "verificationResult": "VERIFICATION_ERROR"
}
```

## Test case -- Fail -- Incorrect Card expiry date {#test-case--fail--incorrect-card-expiry-date}

This test case describes an attempt to verify a PIN by sending a PIN block in ISO-1 format with the invalid `cardExpiryDate` value in the request.

For this test case, use the following information in the request:

|   Header    | Available value |
|-------------|-----------------|
| `Key-Index` | A1564386531162  |

|      Field       | Available value |
|------------------|-----------------|
| `cardExpiryDate` | 2101            |

**Sample request**

`POST /cards/70001/pins/verifications -H "Key-Index: A1564386531162"`

```JSON
{
  "cardExpiryDate": "2101",
  "cardSequenceNumber": "2",
  "pinBlock": "
69DF3BAA5CAF165A940FC1F8AE68573B8AF93F5EDB20E208953E87CC50C19F0BB11A448AE76FA87A8940EE290FEBC2518DDAAB85BF4AA393FAE060F4CD30CC73AAFF3755680E59FC59BF8D2303B7990C1EC648A0D24D66D57DAB0147434B54955FEA38890C1AFDE6C60EE6D9174BC567D151669576D0395A1B235AF4CD7C581EF238FD26E1DF53085B09DDA9A81EE9DA02D7C7C9E0C266B60C7E9BAC046DCF704EC6CA31486CF6B562C28D47CD6ED124CAE28D3A2E590CFBAA90604090F601B16423E375D6CC01FAC5E0125F7BCC735ED53F88CB7D34FDEFBB19A0EE09F156E337150CE96B2A16419D0F0981CCE44EC8A946CEA69A238AA04EC46FDFFE91A03D
"
}
```

**Sample response**

`404`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "INVALID_EXPIRY_DATE",
        "Description": "Expiry date 2101 does not match for the card contract with id 70001.",
        "Recoverable": false
      }
    ]
  }
}
```

