pub struct CreateOnrampOrderBody {Show 14 fields
pub agreement_accepted_at: DateTime<Utc>,
pub destination_address: String,
pub destination_network: String,
pub email: String,
pub is_quote: bool,
pub partner_order_ref: Option<String>,
pub partner_user_ref: String,
pub payment_amount: Option<String>,
pub payment_currency: String,
pub payment_method: OnrampOrderPaymentMethodTypeId,
pub phone_number: String,
pub phone_number_verified_at: DateTime<Utc>,
pub purchase_amount: Option<String>,
pub purchase_currency: String,
}
Expand description
CreateOnrampOrderBody
JSON schema
{
"type": "object",
"required": [
"agreementAcceptedAt",
"destinationAddress",
"destinationNetwork",
"email",
"partnerUserRef",
"paymentCurrency",
"paymentMethod",
"phoneNumber",
"phoneNumberVerifiedAt",
"purchaseCurrency"
],
"properties": {
"agreementAcceptedAt": {
"description": "The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy).",
"examples": [
"2025-04-24T00:00:00Z"
],
"type": "string",
"format": "date-time"
},
"destinationAddress": {
"description": "The address the purchased crypto will be sent to.",
"examples": [
"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
],
"type": "string"
},
"destinationNetwork": {
"description": "The name of the crypto network the purchased currency will be sent on.\n\nUse the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location.",
"examples": [
"base"
],
"type": "string"
},
"email": {
"description": "The verified email address of the user requesting the onramp transaction. This email must be verified by your app (via OTP) before being used with the Onramp API.",
"examples": [
"test@example.com"
],
"type": "string"
},
"isQuote": {
"description": "If true, this API will return a quote without creating any transaction.",
"default": false,
"type": "boolean"
},
"partnerOrderRef": {
"description": "Optional partner order reference ID.",
"examples": [
"order-1234"
],
"type": "string"
},
"partnerUserRef": {
"description": "A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. \"sandbox-user-1234\") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds.\n\nThis value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user.",
"examples": [
"user-1234"
],
"type": "string"
},
"paymentAmount": {
"description": "A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency.",
"examples": [
"100.00"
],
"type": "string"
},
"paymentCurrency": {
"description": "The fiat currency to be converted to crypto.",
"examples": [
"USD"
],
"type": "string"
},
"paymentMethod": {
"$ref": "#/components/schemas/OnrampOrderPaymentMethodTypeId"
},
"phoneNumber": {
"description": "The phone number of the user requesting the onramp transaction in E.164 format. This phone number must be verified by your app (via OTP) before being used with the Onramp API.\n\nPlease refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api) for more details on phone number verification requirements and best practices.",
"examples": [
"+12055555555"
],
"type": "string"
},
"phoneNumberVerifiedAt": {
"description": "Timestamp of when the user's phone number was verified via OTP. User phone number must be verified every 60 days. If this timestamp is older than 60 days, an error will be returned.",
"examples": [
"2025-04-24T00:00:00Z"
],
"type": "string",
"format": "date-time"
},
"purchaseAmount": {
"description": "A string representing the amount of crypto the user wishes to purchase. When using this parameter the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency.",
"examples": [
"10.000000"
],
"type": "string"
},
"purchaseCurrency": {
"description": "The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`) of the crypto asset to be purchased.\n\nUse the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location.",
"examples": [
"USDC"
],
"type": "string"
}
}
}
Fields§
§agreement_accepted_at: DateTime<Utc>
The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy).
destination_address: String
The address the purchased crypto will be sent to.
destination_network: String
The name of the crypto network the purchased currency will be sent on.
Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location.
email: String
The verified email address of the user requesting the onramp transaction. This email must be verified by your app (via OTP) before being used with the Onramp API.
is_quote: bool
If true, this API will return a quote without creating any transaction.
partner_order_ref: Option<String>
Optional partner order reference ID.
partner_user_ref: String
A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. “sandbox-user-1234”) to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds.
This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user.
payment_amount: Option<String>
A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency.
payment_currency: String
The fiat currency to be converted to crypto.
payment_method: OnrampOrderPaymentMethodTypeId
§phone_number: String
The phone number of the user requesting the onramp transaction in E.164 format. This phone number must be verified by your app (via OTP) before being used with the Onramp API.
Please refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api) for more details on phone number verification requirements and best practices.
phone_number_verified_at: DateTime<Utc>
Timestamp of when the user’s phone number was verified via OTP. User phone number must be verified every 60 days. If this timestamp is older than 60 days, an error will be returned.
purchase_amount: Option<String>
A string representing the amount of crypto the user wishes to purchase. When using this parameter the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency.
purchase_currency: String
The ticker (e.g. BTC
, USDC
, SOL
) or the Coinbase UUID (e.g. d85dce9b-5b73-5c3c-8978-522ce1d1c1b4
) of the crypto asset to be purchased.
Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location.
Implementations§
Source§impl CreateOnrampOrderBody
impl CreateOnrampOrderBody
pub fn builder() -> CreateOnrampOrderBody
Trait Implementations§
Source§impl Clone for CreateOnrampOrderBody
impl Clone for CreateOnrampOrderBody
Source§fn clone(&self) -> CreateOnrampOrderBody
fn clone(&self) -> CreateOnrampOrderBody
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more