pub struct Coupon {Show 27 fields
pub id: i32,
pub code: String,
pub amount: String,
pub date_created: NaiveDateTime,
pub date_created_gmt: NaiveDateTime,
pub date_modified: NaiveDateTime,
pub date_modified_gmt: NaiveDateTime,
pub discount_type: DiscountType,
pub description: String,
pub date_expires: Option<String>,
pub date_expires_gmt: Option<String>,
pub usage_count: i32,
pub individual_use: bool,
pub product_ids: Vec<i32>,
pub excluded_product_ids: Vec<i32>,
pub usage_limit: Option<i32>,
pub usage_limit_per_user: Option<i32>,
pub limit_usage_to_x_items: Option<i32>,
pub free_shipping: bool,
pub product_categories: Vec<i32>,
pub excluded_product_categories: Vec<i32>,
pub exclude_sale_items: bool,
pub minimum_amount: String,
pub maximum_amount: String,
pub email_restrictions: Vec<String>,
pub used_by: Vec<String>,
pub meta_data: Vec<MetaData>,
}
Fields§
§id: i32
Unique identifier for the object.
code: String
Coupon code.
amount: String
The amount of discount. Should always be numeric, even if setting a percentage.
date_created: NaiveDateTime
The date the coupon was created, in the site’s timezone.
date_created_gmt: NaiveDateTime
The date the coupon was created, as GMT.
date_modified: NaiveDateTime
The date the coupon was last modified, in the site’s timezone.
date_modified_gmt: NaiveDateTime
The date the coupon was last modified, as GMT.
discount_type: DiscountType
Determines the type of discount that will be applied. Options: percent, fixed_cart and fixed_product. Default is fixed_cart.
description: String
Coupon description.
date_expires: Option<String>
The date the coupon expires, in the site’s timezone.
date_expires_gmt: Option<String>
The date the coupon expires, as GMT.
usage_count: i32
Number of times the coupon has been used already.
individual_use: bool
If true, the coupon can only be used individually. Other applied coupons will be removed from the cart. Default is false.
product_ids: Vec<i32>
List of product IDs the coupon can be used on.
excluded_product_ids: Vec<i32>
List of product IDs the coupon cannot be used on.
usage_limit: Option<i32>
How many times the coupon can be used in total.
usage_limit_per_user: Option<i32>
How many times the coupon can be used per customer.
limit_usage_to_x_items: Option<i32>
Max number of items in the cart the coupon can be applied to.
free_shipping: bool
If true and if the free shipping method requires a coupon, this coupon will enable free shipping. Default is false.
product_categories: Vec<i32>
List of category IDs the coupon applies to.
excluded_product_categories: Vec<i32>
List of category IDs the coupon does not apply to.
exclude_sale_items: bool
If true, this coupon will not be applied to items that have sale prices. Default is false.
minimum_amount: String
Minimum order amount that needs to be in the cart before coupon applies.
maximum_amount: String
Maximum order amount allowed when using the coupon.
email_restrictions: Vec<String>
List of email addresses that can use this coupon.
used_by: Vec<String>
List of user IDs (or guest email addresses) that have used the coupon.
meta_data: Vec<MetaData>
Meta data.