> ## Documentation Index
> Fetch the complete documentation index at: https://docs.treasuryprime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

# Digital Wallet Token Simulations

Digital Wallet Token simulations are intended to mock the usage of provisioning a card to a digital wallet. A successful simulation call will return a 202 status. An object id will not be returned, but you will receive a `digital_wallet_token.create` webhook with the object id. This object id can be used on the [/digital\_wallet\_token/`{id}`](/reference/digital-wallet-token) endpoint. There is currently one simulation below.

| Simulation type                     | Token message type | Explanation                                       |
| ----------------------------------- | ------------------ | ------------------------------------------------- |
| digital\_wallet\_token.provisioning | provisioning       | Simulate a card getting added to a digital wallet |

## Create a Digital Wallet Token Simulation

Initiate a Digital Wallet Token simulation.

<CodeGroup>
  ```bash bash theme={null}
  POST https://api.sandbox.treasuryprime.com/simulation
  ```
</CodeGroup>

### Digital Wallet Token Request Body

#### Provisioning

| Parameter                | Type   | Required? | Description                                                            |
| ------------------------ | ------ | --------- | ---------------------------------------------------------------------- |
| card\_id                 | string | Required  | ID of the card to use as the source for simulated tokens.              |
| fulfillment              | object |           | An object that defines additional fields for fulfillment of the token. |
| token\_service\_provider | object |           | An object that defines additional fields for requestor of the token.   |

#### Fulfillment Sub-Object

| Parameter | Type   | Description                                                                                                                 |
| --------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| status    | string | Provisioning status of the token. One of `decision_green`, `decision_red`, `decision_yellow`, `rejected`, or `provisioned`. |

#### Token Service Provider Sub-Object

| Parameter              | Type   | Description                                                                                                                                                                                                                         |
| ---------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token\_requestor\_name | string | Name of the token requestor within the card network. One of `APPLE_PAY` or `ANDROID_PAY`.                                                                                                                                           |
| token\_requestor\_id   | string | Unique numerical identifier of the digital wallet token requestor within the card network. These IDs map to a token\_requestor\_name. `50110030273` for Apple Pay, `50120834693` for Google Pay, and `50139059239` for Samsung Pay. |

### Example Request

<CodeGroup>
  ```bash bash theme={null}
  $ curl -u $API_KEY_ID:$API_SECRET_KEY https://api.sandbox.treasuryprime.com/simulation \
      -H 'Content-Type: application/json' \
      -d '{
            "type": "digital_wallet_token.provisioning",
            "simulation": {
              "card_id": "card_104",
              "fulfillment": {
                   "status": "provisioned"
              },
              "token_service_provider": {
                  "token_requestor_name": "APPLE_PAY",
                  "token_requestor_id": "50110030273"
              }
            }
          }'
  ```
</CodeGroup>

### Example Response

#### Success

There will be no response body. The response code will be a `202 - accepted`

#### Error

<CodeGroup>
  ```bash bash theme={null}
  {
   "error": "Simulation not implemented for digital_wallet_token.not_implemented_event"
  }
  ```
</CodeGroup>
