Struct Order

Source
pub struct Order {
Show 41 fields pub id: i32, pub parent_id: Option<i32>, pub number: String, pub order_key: String, pub created_via: String, pub version: String, pub status: OrderStatus, pub currency: CurrencyISO, pub date_created: Option<NaiveDateTime>, pub date_created_gmt: Option<NaiveDateTime>, pub date_modified: Option<NaiveDateTime>, pub date_modified_gmt: Option<NaiveDateTime>, pub discount_total: String, pub discount_tax: String, pub shipping_total: String, pub shipping_tax: String, pub cart_tax: String, pub total: String, pub total_tax: String, pub prices_include_tax: bool, pub customer_id: i32, pub customer_ip_address: String, pub customer_user_agent: String, pub customer_note: String, pub billing: Billing, pub shipping: Shipping, pub payment_method: String, pub payment_method_title: String, pub transaction_id: String, pub date_paid: Option<NaiveDateTime>, pub date_paid_gmt: Option<NaiveDateTime>, pub date_completed: Option<NaiveDateTime>, pub date_completed_gmt: Option<NaiveDateTime>, pub cart_hash: String, pub meta_data: Vec<MetaData>, pub line_items: Vec<OrderLineItemProperties>, pub tax_lines: Vec<OrderTaxLineProperties>, pub shipping_lines: Vec<ShippingLineProperties>, pub fee_lines: Vec<OrderFeeLineProperties>, pub coupon_lines: Vec<OrderCouponLineProperties>, pub refunds: Vec<OrderRefundProperties>,
}

Fields§

§id: i32

Unique identifier for the resource.

§parent_id: Option<i32>

Parent order ID.

§number: String

Order number.

§order_key: String

Order key.

§created_via: String

Shows where the order was created.

§version: String

Version of WooCommerce which last updated the order.

§status: OrderStatus

Order status.

§currency: CurrencyISO

Currency the order was created with, in ISO format.

§date_created: Option<NaiveDateTime>

The date the order was created, in the site’s timezone.

§date_created_gmt: Option<NaiveDateTime>

The date the order was created, as GMT.

§date_modified: Option<NaiveDateTime>

The date the order was last modified, in the site’s timezone.

§date_modified_gmt: Option<NaiveDateTime>

The date the order was last modified, as GMT

§discount_total: String

Total discount amount for the order.

§discount_tax: String

Total discount tax amount for the order.

§shipping_total: String

Total shipping amount for the order.

§shipping_tax: String

Total shipping tax amount for the order.

§cart_tax: String

Sum of line item taxes only.

§total: String

Grand total.

§total_tax: String

Sum of all taxes.

§prices_include_tax: bool

True the prices included tax during checkout.

§customer_id: i32

User ID who owns the order. 0 for guests. Default is 0.

§customer_ip_address: String

Customer’s IP address.

§customer_user_agent: String

User agent of the customer.

§customer_note: String

Note left by customer during checkout.

§billing: Billing

Billing address.

§shipping: Shipping

Shipping address.

§payment_method: String

Payment method ID.

§payment_method_title: String

Payment method title.

§transaction_id: String

Unique transaction ID.

§date_paid: Option<NaiveDateTime>

The date the order was paid, in the site’s timezone.

§date_paid_gmt: Option<NaiveDateTime>

The date the order was paid, as GMT.

§date_completed: Option<NaiveDateTime>

The date the order was completed, in the site’s timezone.

§date_completed_gmt: Option<NaiveDateTime>

The date the order was completed, as GMT.

§cart_hash: String

MD5 hash of cart items to ensure orders are not modified.

§meta_data: Vec<MetaData>

Meta data.

§line_items: Vec<OrderLineItemProperties>

Line items data.

§tax_lines: Vec<OrderTaxLineProperties>

Tax lines data.

§shipping_lines: Vec<ShippingLineProperties>

Shipping lines data.

§fee_lines: Vec<OrderFeeLineProperties>

Fee lines data.

§coupon_lines: Vec<OrderCouponLineProperties>

Coupons line data.

§refunds: Vec<OrderRefundProperties>

List of refunds.

Implementations§

Source§

impl Order

Source

pub fn create() -> CreateOrderBuilder

Source

pub fn update() -> UpdateOrderBuilder

Trait Implementations§

Source§

impl Clone for Order

Source§

fn clone(&self) -> Order

Returns a copy 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 Order

Source§

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

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

impl<'de> Deserialize<'de> for Order

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 Serialize for Order

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

Auto Trait Implementations§

§

impl Freeze for Order

§

impl RefUnwindSafe for Order

§

impl Send for Order

§

impl Sync for Order

§

impl Unpin for Order

§

impl UnwindSafe for Order

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> 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,