amazon_spapi/models/orders_v0/
order_item.rs

1/*
2 * Selling Partner API for Orders
3 *
4 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// OrderItem : A single order item.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OrderItem {
17    /// The item's Amazon Standard Identification Number (ASIN).
18    #[serde(rename = "ASIN")]
19    pub asin: String,
20    /// The item's seller stock keeping unit (SKU).
21    #[serde(rename = "SellerSKU", skip_serializing_if = "Option::is_none")]
22    pub seller_sku: Option<String>,
23    /// An Amazon-defined order item identifier.
24    #[serde(rename = "OrderItemId")]
25    pub order_item_id: String,
26    /// A list of associated items that a customer has purchased with a product. For example, a tire installation service purchased with tires.
27    #[serde(rename = "AssociatedItems", skip_serializing_if = "Option::is_none")]
28    pub associated_items: Option<Vec<models::orders_v0::AssociatedItem>>,
29    /// The item's name.
30    #[serde(rename = "Title", skip_serializing_if = "Option::is_none")]
31    pub title: Option<String>,
32    /// The number of items in the order. 
33    #[serde(rename = "QuantityOrdered")]
34    pub quantity_ordered: i32,
35    /// The number of items shipped.
36    #[serde(rename = "QuantityShipped", skip_serializing_if = "Option::is_none")]
37    pub quantity_shipped: Option<i32>,
38    #[serde(rename = "ProductInfo", skip_serializing_if = "Option::is_none")]
39    pub product_info: Option<Box<models::orders_v0::ProductInfoDetail>>,
40    #[serde(rename = "PointsGranted", skip_serializing_if = "Option::is_none")]
41    pub points_granted: Option<Box<models::orders_v0::PointsGrantedDetail>>,
42    #[serde(rename = "ItemPrice", skip_serializing_if = "Option::is_none")]
43    pub item_price: Option<Box<models::orders_v0::Money>>,
44    #[serde(rename = "ShippingPrice", skip_serializing_if = "Option::is_none")]
45    pub shipping_price: Option<Box<models::orders_v0::Money>>,
46    #[serde(rename = "ItemTax", skip_serializing_if = "Option::is_none")]
47    pub item_tax: Option<Box<models::orders_v0::Money>>,
48    #[serde(rename = "ShippingTax", skip_serializing_if = "Option::is_none")]
49    pub shipping_tax: Option<Box<models::orders_v0::Money>>,
50    #[serde(rename = "ShippingDiscount", skip_serializing_if = "Option::is_none")]
51    pub shipping_discount: Option<Box<models::orders_v0::Money>>,
52    #[serde(rename = "ShippingDiscountTax", skip_serializing_if = "Option::is_none")]
53    pub shipping_discount_tax: Option<Box<models::orders_v0::Money>>,
54    #[serde(rename = "PromotionDiscount", skip_serializing_if = "Option::is_none")]
55    pub promotion_discount: Option<Box<models::orders_v0::Money>>,
56    #[serde(rename = "PromotionDiscountTax", skip_serializing_if = "Option::is_none")]
57    pub promotion_discount_tax: Option<Box<models::orders_v0::Money>>,
58    /// A list of promotion identifiers provided by the seller when the promotions were created.
59    #[serde(rename = "PromotionIds", skip_serializing_if = "Option::is_none")]
60    pub promotion_ids: Option<Vec<String>>,
61    #[serde(rename = "CODFee", skip_serializing_if = "Option::is_none")]
62    pub cod_fee: Option<Box<models::orders_v0::Money>>,
63    #[serde(rename = "CODFeeDiscount", skip_serializing_if = "Option::is_none")]
64    pub cod_fee_discount: Option<Box<models::orders_v0::Money>>,
65    /// Indicates whether the item is a gift.  **Possible values**: `true` and `false`.
66    #[serde(rename = "IsGift", skip_serializing_if = "Option::is_none")]
67    pub is_gift: Option<String>,
68    /// The condition of the item, as described by the seller.
69    #[serde(rename = "ConditionNote", skip_serializing_if = "Option::is_none")]
70    pub condition_note: Option<String>,
71    /// The condition of the item.  **Possible values**: `New`, `Used`, `Collectible`, `Refurbished`, `Preorder`, and `Club`.
72    #[serde(rename = "ConditionId", skip_serializing_if = "Option::is_none")]
73    pub condition_id: Option<String>,
74    /// The subcondition of the item.  **Possible values**: `New`, `Mint`, `Very Good`, `Good`, `Acceptable`, `Poor`, `Club`, `OEM`, `Warranty`, `Refurbished Warranty`, `Refurbished`, `Open Box`, `Any`, and `Other`.
75    #[serde(rename = "ConditionSubtypeId", skip_serializing_if = "Option::is_none")]
76    pub condition_subtype_id: Option<String>,
77    /// The start date of the scheduled delivery window in the time zone for the order destination. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
78    #[serde(rename = "ScheduledDeliveryStartDate", skip_serializing_if = "Option::is_none")]
79    pub scheduled_delivery_start_date: Option<String>,
80    /// The end date of the scheduled delivery window in the time zone for the order destination. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
81    #[serde(rename = "ScheduledDeliveryEndDate", skip_serializing_if = "Option::is_none")]
82    pub scheduled_delivery_end_date: Option<String>,
83    /// Indicates that the selling price is a special price that is only available for Amazon Business orders. For more information about the Amazon Business Seller Program, refer to the [Amazon Business website](https://www.amazon.com/b2b/info/amazon-business).   **Possible values**: `BusinessPrice`
84    #[serde(rename = "PriceDesignation", skip_serializing_if = "Option::is_none")]
85    pub price_designation: Option<String>,
86    #[serde(rename = "TaxCollection", skip_serializing_if = "Option::is_none")]
87    pub tax_collection: Option<Box<models::orders_v0::TaxCollection>>,
88    /// When true, the product type for this item has a serial number.   Only returned for Amazon Easy Ship orders.
89    #[serde(rename = "SerialNumberRequired", skip_serializing_if = "Option::is_none")]
90    pub serial_number_required: Option<bool>,
91    /// When true, the ASIN is enrolled in Transparency. The Transparency serial number that you must submit is determined by:  **1D or 2D Barcode:** This has a **T** logo. Submit either the 29-character alpha-numeric identifier beginning with **AZ** or **ZA**, or the 38-character Serialized Global Trade Item Number (SGTIN). **2D Barcode SN:** Submit the 7- to 20-character serial number barcode, which likely has the prefix **SN**. The serial number is applied to the same side of the packaging as the GTIN (UPC/EAN/ISBN) barcode. **QR code SN:** Submit the URL that the QR code generates.
92    #[serde(rename = "IsTransparency", skip_serializing_if = "Option::is_none")]
93    pub is_transparency: Option<bool>,
94    /// The IOSS number of the marketplace. Sellers shipping to the EU from outside the EU must provide this IOSS number to their carrier when Amazon has collected the VAT on the sale.
95    #[serde(rename = "IossNumber", skip_serializing_if = "Option::is_none")]
96    pub ioss_number: Option<String>,
97    /// The store chain store identifier. Linked to a specific store in a store chain.
98    #[serde(rename = "StoreChainStoreId", skip_serializing_if = "Option::is_none")]
99    pub store_chain_store_id: Option<String>,
100    /// The category of deemed reseller. This applies to selling partners that are not based in the EU and is used to help them meet the VAT Deemed Reseller tax laws in the EU and UK.
101    #[serde(rename = "DeemedResellerCategory", skip_serializing_if = "Option::is_none")]
102    pub deemed_reseller_category: Option<DeemedResellerCategory>,
103    #[serde(rename = "BuyerInfo", skip_serializing_if = "Option::is_none")]
104    pub buyer_info: Option<Box<models::orders_v0::ItemBuyerInfo>>,
105    #[serde(rename = "BuyerRequestedCancel", skip_serializing_if = "Option::is_none")]
106    pub buyer_requested_cancel: Option<Box<models::orders_v0::BuyerRequestedCancel>>,
107    /// A list of serial numbers for electronic products that are shipped to customers. Returned for FBA orders only.
108    #[serde(rename = "SerialNumbers", skip_serializing_if = "Option::is_none")]
109    pub serial_numbers: Option<Vec<String>>,
110    #[serde(rename = "SubstitutionPreferences", skip_serializing_if = "Option::is_none")]
111    pub substitution_preferences: Option<Box<models::orders_v0::SubstitutionPreferences>>,
112    #[serde(rename = "Measurement", skip_serializing_if = "Option::is_none")]
113    pub measurement: Option<Box<models::orders_v0::Measurement>>,
114    #[serde(rename = "ShippingConstraints", skip_serializing_if = "Option::is_none")]
115    pub shipping_constraints: Option<Box<models::orders_v0::ShippingConstraints>>,
116    #[serde(rename = "AmazonPrograms", skip_serializing_if = "Option::is_none")]
117    pub amazon_programs: Option<Box<models::orders_v0::AmazonPrograms>>,
118}
119
120impl OrderItem {
121    /// A single order item.
122    pub fn new(asin: String, order_item_id: String, quantity_ordered: i32) -> OrderItem {
123        OrderItem {
124            asin,
125            seller_sku: None,
126            order_item_id,
127            associated_items: None,
128            title: None,
129            quantity_ordered,
130            quantity_shipped: None,
131            product_info: None,
132            points_granted: None,
133            item_price: None,
134            shipping_price: None,
135            item_tax: None,
136            shipping_tax: None,
137            shipping_discount: None,
138            shipping_discount_tax: None,
139            promotion_discount: None,
140            promotion_discount_tax: None,
141            promotion_ids: None,
142            cod_fee: None,
143            cod_fee_discount: None,
144            is_gift: None,
145            condition_note: None,
146            condition_id: None,
147            condition_subtype_id: None,
148            scheduled_delivery_start_date: None,
149            scheduled_delivery_end_date: None,
150            price_designation: None,
151            tax_collection: None,
152            serial_number_required: None,
153            is_transparency: None,
154            ioss_number: None,
155            store_chain_store_id: None,
156            deemed_reseller_category: None,
157            buyer_info: None,
158            buyer_requested_cancel: None,
159            serial_numbers: None,
160            substitution_preferences: None,
161            measurement: None,
162            shipping_constraints: None,
163            amazon_programs: None,
164        }
165    }
166}
167/// The category of deemed reseller. This applies to selling partners that are not based in the EU and is used to help them meet the VAT Deemed Reseller tax laws in the EU and UK.
168#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
169pub enum DeemedResellerCategory {
170    #[serde(rename = "IOSS")]
171    Ioss,
172    #[serde(rename = "UOSS")]
173    Uoss,
174}
175
176impl Default for DeemedResellerCategory {
177    fn default() -> DeemedResellerCategory {
178        Self::Ioss
179    }
180}
181