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

# CreateSpendPermissionRequest

> CreateSpendPermissionRequest API reference.

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

```java theme={null}
public final class CreateSpendPermissionRequest 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.

### `getNetwork`

```java theme={null}
public SpendPermissionNetwork getNetwork()
```

**Returns:**

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

### `getSpender`

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

**Returns:**

`String` - Entity that can spend account's tokens. Can be either a Smart Account or an EOA.

### `getToken`

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

**Returns:**

`String` - ERC-7528 native token address (e.g. "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" for native ETH), or an ERC-20 contract address.

### `getAllowance`

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

**Returns:**

`String` - Maximum allowed value to spend, in atomic units for the specified token, within each period.

### `getPeriod`

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

**Returns:**

`String` - Time duration for resetting used allowance on a recurring basis (seconds).

### `getStart`

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

**Returns:**

`String` - The start time for this spend permission, in Unix seconds.

### `getEnd`

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

**Returns:**

`String` - The expiration time for this spend permission, in Unix seconds.

### `getSalt`

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

**Returns:**

`Optional<String>` - An arbitrary salt to differentiate unique spend permissions with otherwise identical data.

### `getExtraData`

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

**Returns:**

`Optional<String>` - Arbitrary data to include in the permission.

### `getPaymasterUrl`

```java theme={null}
public Optional<Url> getPaymasterUrl()
```

**Returns:**

`Optional`\<[Url](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/Url)> - The paymaster URL of the spend permission.

### `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 CreateSpendPermissionRequest.NetworkStage builder()
```

**Returns:**

[CreateSpendPermissionRequest](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/resources/evmsmartaccounts/requests/CreateSpendPermissionRequest).`NetworkStage`
