Withdraw ADA Rewards :

- **Delegator Address:** The address to which ADA will be transferred from the Reward Account.
- Please note the **Withdraw Rewards Flow** will withdraw the whole amount. _**Partial withdrawals are not supported.**_

In the following guide we will illustrate how to withdraw ADA rewards accrued in a Reward Account.

# Create New Withdraw Rewards Flow

To initiate the Withdraw Rewards process, create a new flow with a `POST` request to `/flows`.

### URL

`POST https://api.figment.io/flows`

### Request
- `protocol`\* : `string` Protocol this flow operates on (ex. `cardano`).
- `network`\* : `string` Network this flow operates on (ex. `preprod`).
- `operation`\* : `string` The operation to perform (ex. `withdraw_rewards`).

JSON

```json
{
  "protocol": "cardano",
  "network": "preprod",
  "operation": "withdraw_rewards"
}
```

### Response
- `id` : `string` ID of the flow.
- `operation` : `string` The Staking API operation being performed by this flow.
- `state` : `string` The current state of the flow.
- `actions` : `array` It includes the `name` & `inputs` of all next possible actions.
  - `create_withdraw_tx`: Use this action to withdraw ADA rewards.
    - `delegator_address` : The delegator address to which ADA will be transferred from the Reward Account.
- `data` : `object` Flow & transaction data.

JSON

```json
{
    "id": "b31a3ccb-24c2-40d6-a89f-bf565b9f918e",
    "operation": "withdraw_rewards",
    "state": "initialized",
    "actions": [
        {
            "name": "create_withdraw_tx",
            "inputs": [
                {
                    "name": "delegator_address",
                    "display": "Delegator Address",
                    "description": "",
                    "type": "string",
                    "validations": [
                        {
                            "type": "presence",
                            "options": {}
                        }
                    ],
                    "array": false,
                    "default_value": null
                }
            ]
        }
    ],
    "data": {
        "delegator_address": null,
        "withdraw_transaction": null
    },
    "protocol": "cardano",
    "network": "preprod",
    "created_at": "2023-09-27T20:03:57.329Z",
    "updated_at": "2023-09-27T20:03:57.329Z"
}
```

# Submit Withdraw Rewards Transaction Data

After collecting the required inputs, send a `PUT` request to `/flows/[:flow_id]/next` to proceed to the next step.

### URL

`PUT https://api.figment.io/flows/[:flow_id]/next`

### Request
- `name`\* : `create_withdraw_tx`
- `inputs`\* : `object`
  - `delegator_address\
