# Sandbox Testing
source: https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/index.md

## Overview {#overview}

The section describes all use cases that can be tested using the Sandbox environment. The Sandbox contains limited-capacity mock APIs, enabling you to try the APIs quickly to assist with initial integration and solution development. The Sandbox returns mock responses for a defined request. Particular values in the request body, such as path parameters or fields, will give specific predefined responses.
Note: At the beginning of each test case, there might be information (in the form of a table) that you must use in the request to execute the test case. The table displays specific values that are preconfigured in the Sandbox. Otherwise, you can send any values in the request, and the Sandbox will always return the same mock response.

The following test cases are provided:

|                                                                                                             Test case                                                                                                              |                               Test case scenario                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| [Enable a Card for Apple Pay in Issuer's Mobile App](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/enable-card-for-apple-pay/index.md)                                              | Success                                                                        |
|                                                                                                                                                                                                                                    | Fail -- Invalid Card expiry date                                               |
|                                                                                                                                                                                                                                    | Fail -- Missing Card Contract Name                                             |
| [Enable a Card for Google Pay in Issuer's Mobile App](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/enable-card-for-google-pay/index.md)                                            | Success                                                                        |
|                                                                                                                                                                                                                                    | Fail -- Invalid Card expiry date                                               |
|                                                                                                                                                                                                                                    | Fail -- Missing Card Contract Name                                             |
| [Enable a Card for Samsung Pay in Issuer's Mobile App](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/enable-card-for-samsung-pay/index.md)                                          | Success                                                                        |
|                                                                                                                                                                                                                                    | Fail -- Invalid Card expiry date                                               |
|                                                                                                                                                                                                                                    | Fail -- Missing Card Contract Name                                             |
| [Enable a Card for Click to Pay in Issuer's Mobile App (through MDES Token Connect API)](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/enable-card-for-click-to-pay-mdes/index.md)  | Success                                                                        |
|                                                                                                                                                                                                                                    | Fail - Card contract is not active                                             |
|                                                                                                                                                                                                                                    | Fail -- Card contract has no active card plastic                               |
| [Enable a Card for Click to Pay in issuer's Mobile App (through Mastercard Enroll API)](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/enable-card-for-click-to-pay-enroll/index.md) | Success                                                                        |
| [Auto-enable single or multiple cardholders in Click to Pay](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/auto-enable-cardholders-c2p/index.md)                                    | Success                                                                        |
| [Enable a Card in a Wallet App with Token Activation in the Issuer's App](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/enable-card-in-wallet-app/index.md)                         | Success                                                                        |
|                                                                                                                                                                                                                                    | Fail -- Invalid Card expiry date                                               |
| [Change a Token Status](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/change-token-status/index.md)                                                                                 | Success -- Change the status of a single Token                                 |
|                                                                                                                                                                                                                                    | Success -- Change the status of all Tokens linked to a specified Card Contract |
|                                                                                                                                                                                                                                    | Fail -- Token not found or deactivated                                         |
| [Relink a Token to Another Card Contract](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/relink-tokens-to-another-card-contract/index.md)                                            | Success -- Relink a single Token                                               |
|                                                                                                                                                                                                                                    | Success -- Relink all Tokens                                                   |
|                                                                                                                                                                                                                                    | Fail -- No Tokens to relink or one of the Tokens is deactivated                |
|                                                                                                                                                                                                                                    | Fail -- Card Contract in wrong status                                          |
| [Retrieve Token Details](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/retrieve-token-details/index.md)                                                                             | Success -- Retrieve details of a single Token                                  |
|                                                                                                                                                                                                                                    | Success -- Retrieve all Tokens for a Client                                    |
|                                                                                                                                                                                                                                    | Success -- Retrieve all Tokens for a Client - No Tokens                        |
|                                                                                                                                                                                                                                    | Success -- Retrieve all Tokens for a Card Contract                             |
|                                                                                                                                                                                                                                    | Success -- Retrieve all Tokens for a Card Contract -- No Tokens                |

## API configuration {#api-configuration}

There is a predefined API configuration of the Sandbox containing the following:

* Characters allowed in the requests.
* `cardContractnumber` (PAN) masking pattern used in all API responses.
* Input patterns for fields containing e-mail, phone, or fax number.
* Available dictionaries' values.

|            Global parameter             |                                       Value                                        |
|-----------------------------------------|------------------------------------------------------------------------------------|
| PAN masking pattern                     | XXXXXX____XXXX                                                                     |
| Allowed default characters              | abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.,\&#'@+\\\\-\*_=; /1234567890 |
| Allowed characters for technical fields | abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\*#+= /1234567890\\\\-_%;      |
| Technical fields                        | `walletCertificate`                                                                |

| Dictionary name |           Value           |
|-----------------|---------------------------|
| `tokenStatus`   | DEACTIVATE RESUME SUSPEND |

## Global error test cases {#global-error-test-cases}

There are globally predefined main CMS object identifiers (`cardContractId`) which allow getting typical errors during the processing of the request.

| Path parameter name | Path parameter available value |          reasonCode          |              Description               |
|---------------------|--------------------------------|------------------------------|----------------------------------------|
| `client_id`         | 20001                          | CLIENT_DOES_NOT_EXIST        | Client with id 20001 not found.        |
| `card_contract_id`  | 10001                          | CARD_CONTRACT_DOES_NOT_EXIST | Card contract with id 10001 not found. |
| `card_contract_id`  | 101222                         | NOT_CARD_CONTRACT            | Contract with id 101222 is not a card. |
| `token_number`      | 90001                          | TOKEN_DOES_NOT_EXIST         | Token with number 90001 not found.     |

For example, to get the `reasonCode` `CONTRACT_DOES_NOT_EXIST` error, you should define the `card_contract_id` path parameter with the `10001` value in the request. That rule applies to any API endpoints with `card_contract_id` unless it is described differently in the particular test case.
