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

# TransferRequest

> TransferRequest API reference.

Package: [`com.coinbase.cdp.resources.transfers.requests`](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/resources/transfers/requests/index)

```java theme={null}
public final class TransferRequest extends Object
```

## Method Details

### `getIdempotencyKey`

```java theme={null}
public Optional<String> getIdempotencyKey()
```

**Returns:**

`Optional<String>` - An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.

### `getSource`

```java theme={null}
public CreateTransferSource getSource()
```

**Returns:**

[CreateTransferSource](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/CreateTransferSource)

### `getTarget`

```java theme={null}
public TransferTarget getTarget()
```

**Returns:**

[TransferTarget](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/TransferTarget)

### `getAmount`

```java theme={null}
public PositiveDecimal getAmount()
```

**Returns:**

[PositiveDecimal](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/PositiveDecimal) - The amount of the transfer, as a decimal string in standard unit denomination of the asset specified by `asset` (e.g., "100.00" for 100 USD, "0.05" for 0.05 ETH).

### `getAsset`

```java theme={null}
public Asset getAsset()
```

**Returns:**

[Asset](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/Asset) - The symbol of the asset for the amount. This must be one of the assets of the source or target.

### `getAmountType`

```java theme={null}
public Optional<TransferRequestAmountType> getAmountType()
```

**Returns:**

`Optional`\<[TransferRequestAmountType](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/resources/transfers/types/TransferRequestAmountType)> - Specifies whether the given amount is to be received by the target or taken from the source.

`target`: The transfer `target` receives the exact value specified in `amount`. Fees are added to the amount taken from the transfer `source`. `source`: The transfer `target` receives the value specified in `amount`, minus any fees.

### `getValidateOnly`

```java theme={null}
public Optional<Boolean> getValidateOnly()
```

**Returns:**

`Optional<Boolean>` - If true, validates the transfer without initiating it. If the request is valid, a 2xx will be returned. If the request is invalid, a 4xx error will be returned. The response will include an `errorType`, for e.g. invalid\_target if the specified target cannot receive funds.

### `getExecute`

```java theme={null}
public boolean getExecute()
```

**Returns:**

`boolean` - Whether to immediately execute the transfer. If false, the transfer will be created in quoted status and must be executed manually via the /execute endpoint.

### `getMetadata`

```java theme={null}
public Optional<Metadata> getMetadata()
```

**Returns:**

`Optional`\<[Metadata](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/Metadata)>

### `getTravelRule`

```java theme={null}
public Optional<TravelRule> getTravelRule()
```

**Returns:**

`Optional`\<[TravelRule](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/TravelRule)> - Travel Rule compliance information for this transfer. Required for transfers to external wallets above regulatory thresholds. Fields required differ by region and Coinbase contracting entity.

### `equals`

```java theme={null}
public boolean equals(Object other)
```

**Overrides:**

`[equals](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals\(java.lang.Object\) "class or interface in java.lang")` in class `[Object](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html "class or interface in java.lang")`

**Parameters:**

`other` - `Object`

**Returns:**

`boolean`

### `getAdditionalProperties`

```java theme={null}
public Map<String,Object> getAdditionalProperties()
```

**Returns:**

`Map<String,Object>`

### `hashCode`

```java theme={null}
public int hashCode()
```

**Overrides:**

`[hashCode](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode\(\) "class or interface in java.lang")` in class `[Object](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html "class or interface in java.lang")`

**Returns:**

`int`

### `toString`

```java theme={null}
public String toString()
```

**Overrides:**

`[toString](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString\(\) "class or interface in java.lang")` in class `[Object](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html "class or interface in java.lang")`

**Returns:**

`String`

### `builder`

```java theme={null}
public static TransferRequest.SourceStage builder()
```

**Returns:**

[TransferRequest](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/resources/transfers/requests/TransferRequest).`SourceStage`
