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

# X402V2PaymentRequirements

> X402V2PaymentRequirements API reference.

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

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

## Method Details

### `getScheme`

```java theme={null}
public X402V2PaymentRequirementsScheme getScheme()
```

**Returns:**

[X402V2PaymentRequirementsScheme](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/X402V2PaymentRequirementsScheme) - The scheme of the payment protocol to use. Supported schemes are `exact`, `upto`, and `batch-settlement`.

### `getNetwork`

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

**Returns:**

[X402V2Network](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/X402V2Network) - The network of the blockchain to send payment on in CAIP-2 format.

### `getAsset`

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

**Returns:**

[BlockchainAddress](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/BlockchainAddress) - The asset to pay with.

For EVM networks, the asset will be a 0x-prefixed, checksum EVM address.

For Solana-based networks, the asset will be a base58-encoded Solana address.

### `getAmount`

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

**Returns:**

`String` - The amount to pay for the resource in atomic units of the payment asset.

### `getPayTo`

```java theme={null}
public BlockchainAddress getPayTo()
```

**Returns:**

[BlockchainAddress](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/BlockchainAddress) - The destination to pay value to.

For EVM networks, `payTo` will be a 0x-prefixed, checksum EVM address.

For Solana-based networks, `payTo` will be a base58-encoded Solana address.

### `getMaxTimeoutSeconds`

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

**Returns:**

`int` - The maximum time in seconds for the resource server to respond.

### `getExtra`

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

**Returns:**

`Optional<Map<String,Object>>` - The optional additional scheme-specific payment info.

### `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 X402V2PaymentRequirements.SchemeStage builder()
```

**Returns:**

[X402V2PaymentRequirements](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/X402V2PaymentRequirements).`SchemeStage`
