> ## 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

Green Dot Cash Load simulations allow developers to simulate the flow of events that would happen when an end user
attempts to deposit cash through the Green Dot network.

The flow of these deposits follows the following steps:

1. The deposit is created, this results in a "barcode number" that the end user would provide to a cashier to scan in
   production. In Sandbox though, this barcode number is randomized.
2. The developer simulates an "authorization", this authorizes the deposit for an arbitrary amount of money. Simulating
   the end user giving the cashier cash to deposit into their account. When this event is simulated the user's account
   is credited and a hold is placed on the credit until the authorization is finalized.
3. The developer can then simulate a "commit" which finalizes the authorization and releases the hold on the funds and
   makes those funds available to the end user. Or the developer can simulate a "void" which will reverse the hold and
   the credit transactions and mark the deposit as voided.

## Green Dot Simulation Types

| Simulation Type    | Explanation                                                                                                                                                                                                   |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| greendot.authorize | Simulate a cash load being authorized for an arbitrary amount of money.                                                                                                                                       |
| greendot.void      | Simulate a cash load being voided, this can be done when a cash load is in the `pending` or `authorized` status. It will have no affect on deposits in other statuses.                                        |
| greendot.commit    | Simulate finalizing a deposit, this will release funds to the end user to be used. The status of the deposit will transition to `available` and then the following business day will be marked as `complete`. |

## Create a Green Dot Authorization simulation

Initiate a `greendot.authorize` simulation event.

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

### Green Dot Authorization Request Body

| Parameter  | Type   | Required? | Description                        |
| ---------- | ------ | --------- | ---------------------------------- |
| type       | string | Required  | `greendot.authorize`               |
| simulation | object | Required  | The simulation request sub-object. |

##### Simulation Sub-Object

| Parameter    | Type   | Required? | Description                                                        |
| ------------ | ------ | --------- | ------------------------------------------------------------------ |
| greendot\_id | string | Required  | ID of the cash load object created, must be in a `pending` status. |
| amount       | string | Required  | Amount of cash to authorize for the cash load.                     |

##### Response

No response body is returned. A `202` HTTP status indicates a successful simulation.

#### Verifying a Successful Simulation

To ensure that the simulation was run successfully, call the `GET /greendot/:id` endpoint to confirm that the status of
the cash load has been updated to `authorized`. You should also see transactions for that account and the current
balance of the acount having been increased the amount that you authorized in your simulation.

## Create a Green Dot Void or Commit simulation

Initiate a `greendot.void` or `greendot.commit` simulation event.

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

### Green Dot Authorization Request Body

| Parameter  | Type   | Required? | Description                          |
| ---------- | ------ | --------- | ------------------------------------ |
| type       | string | Required  | `greendot.void` or `greendot.commit` |
| simulation | object | Required  | The simulation request sub-object.   |

##### Simulation Sub-Object

| Parameter    | Type   | Required? | Description                                                                                                                                                              |
| ------------ | ------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| greendot\_id | string | Required  | ID of the cash load object you created. For voiding, the object must be in a `pending` or `authorized` status. For commit, the object must be in an `authorized` status. |

##### Response

No response body is returned. A `202` HTTP status indicates a successful simulation.
