pub struct TransferRequest {
pub amount: PositiveDecimal,
pub amount_type: TransferRequestAmountType,
pub asset: Asset,
pub execute: bool,
pub metadata: Option<Metadata>,
pub source: CreateTransferSource,
pub target: TransferTarget,
pub travel_rule: Option<TravelRule>,
pub validate_only: bool,
}Expand description
A request to create a transfer.
JSON schema
{
"description": "A request to create a transfer.",
"type": "object",
"required": [
"amount",
"asset",
"execute",
"source",
"target"
],
"properties": {
"amount": {
"description": "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).",
"examples": [
"100.00"
],
"allOf": [
{
"$ref": "#/components/schemas/PositiveDecimal"
}
]
},
"amountType": {
"description": "Specifies whether the given amount is to be received by the target or taken from the source.\n\n- `target`: The transfer `target` receives the exact value specified in `amount`. Fees are added to the amount taken from the transfer `source`.\n- `source`: The transfer `target` receives the value specified in `amount`, minus any fees.\n",
"default": "source",
"examples": [
"source"
],
"type": "string",
"enum": [
"target",
"source"
]
},
"asset": {
"description": "The symbol of the asset for the amount. This must be one of the assets of the source or target.",
"examples": [
"usd"
],
"allOf": [
{
"$ref": "#/components/schemas/Asset"
}
]
},
"execute": {
"description": "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.",
"examples": [
true
],
"type": "boolean"
},
"metadata": {
"$ref": "#/components/schemas/Metadata"
},
"source": {
"$ref": "#/components/schemas/CreateTransferSource"
},
"target": {
"$ref": "#/components/schemas/TransferTarget"
},
"travelRule": {
"description": "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.",
"examples": [
{
"beneficiary": {
"name": "Jane Smith",
"walletType": "custodial"
},
"isIntermediary": false,
"isSelf": false,
"originator": {
"address": {
"city": "San Francisco",
"countryCode": "US",
"line1": "123 Main St",
"postCode": "94105",
"state": "CA"
},
"name": "John Doe"
}
}
],
"allOf": [
{
"$ref": "#/components/schemas/TravelRule"
}
]
},
"validateOnly": {
"description": "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.",
"default": false,
"examples": [
false
],
"type": "boolean"
}
}
}Fields§
§amount: PositiveDecimalThe 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).
amount_type: TransferRequestAmountTypeSpecifies 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.asset: AssetThe symbol of the asset for the amount. This must be one of the assets of the source or target.
execute: boolWhether to immediately execute the transfer. If false, the transfer will be created in quoted status and must be executed manually via the /execute endpoint.
metadata: Option<Metadata>§source: CreateTransferSource§target: TransferTarget§travel_rule: Option<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.
validate_only: boolIf 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.