CreateOnrampOrderBody

Struct CreateOnrampOrderBody 

Source
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§

Trait Implementations§

Source§

impl Clone for CreateOnrampOrderBody

Source§

fn clone(&self) -> CreateOnrampOrderBody

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateOnrampOrderBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateOnrampOrderBody

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&CreateOnrampOrderBody> for CreateOnrampOrderBody

Source§

fn from(value: &CreateOnrampOrderBody) -> Self

Converts to this type from the input type.
Source§

impl From<CreateOnrampOrderBody> for CreateOnrampOrderBody

Source§

fn from(value: CreateOnrampOrderBody) -> Self

Converts to this type from the input type.
Source§

impl Serialize for CreateOnrampOrderBody

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<CreateOnrampOrderBody> for CreateOnrampOrderBody

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: CreateOnrampOrderBody) -> Result<Self, ConversionError>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,