# Withdraw Rewards Transaction

## Parameters

### network
- **Type:** string  
- **Enum:** `mainnet`, `preprod`  
- **Required:** Network to stake on.

### delegator_address
- **Type:** string  
- **Required:** Delegator address that will receive the rewards if no target address is provided.

### target_address
- **Type:** string  
- **Optional:** Address to withdraw rewards to. If no target address is provided, the rewards will be sent to the delegator address.

## Example Request

```bash
curl --request POST \
     --url https://api.figment.io/cardano/withdraw_rewards \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-api-key: your-api-key-here' \
     --data '{
  "network": "mainnet"
}'
```

## Example Response

```json
{
  "data": {
    "network": "preprod",
    "unsigned_transaction_serialized": "84a4008182582055e97e4581db985557fd6f3eb0cbd3637d82e9ad1abb3e676cd594f193c19e35010181825839004341e2150af2a533abcb9104f18fd89c7386c2f2c27914988efc502994857be3e9281e1b394125b069bedd8cd9ef63d2f237ce79484dfd5b1b0000000253a9a4c2021a00029d2d05a1581de094857be3e9281e1b394125b069bedd8cd9ef63d2f237ce79484dfd5b00a0f5f6",
    "signing_payload": "8af4e801d3023835fd709c1623df3a6103bc682871a5ab5b9563815cb2c30340",
    "amount": "307120.360000"
  }
}
```

## Error Responses

- **400** Bad Request
- **422** Unsupported Network
