Class: Google::Apis::ContentV2_1::Order

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/content_v2_1/classes.rb,
lib/google/apis/content_v2_1/representations.rb,
lib/google/apis/content_v2_1/representations.rb

Overview

Order. Production access (all methods) requires the order manager role. Sandbox access does not.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Order

Returns a new instance of Order.



5246
5247
5248
# File 'lib/google/apis/content_v2_1/classes.rb', line 5246

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#acknowledgedBoolean Also known as: acknowledged?

Whether the order was acknowledged. Corresponds to the JSON property acknowledged

Returns:

  • (Boolean)


5114
5115
5116
# File 'lib/google/apis/content_v2_1/classes.rb', line 5114

def acknowledged
  @acknowledged
end

#annotationsArray<Google::Apis::ContentV2_1::OrderOrderAnnotation>

List of key-value pairs that are attached to a given order. Corresponds to the JSON property annotations



5120
5121
5122
# File 'lib/google/apis/content_v2_1/classes.rb', line 5120

def annotations
  @annotations
end

#billing_addressGoogle::Apis::ContentV2_1::OrderAddress

The billing address. Corresponds to the JSON property billingAddress



5125
5126
5127
# File 'lib/google/apis/content_v2_1/classes.rb', line 5125

def billing_address
  @billing_address
end

#customerGoogle::Apis::ContentV2_1::OrderCustomer

The details of the customer who placed the order. Corresponds to the JSON property customer



5130
5131
5132
# File 'lib/google/apis/content_v2_1/classes.rb', line 5130

def customer
  @customer
end

#delivery_detailsGoogle::Apis::ContentV2_1::OrderDeliveryDetails

Delivery details for shipments of type delivery. Corresponds to the JSON property deliveryDetails



5135
5136
5137
# File 'lib/google/apis/content_v2_1/classes.rb', line 5135

def delivery_details
  @delivery_details
end

#idString

The REST ID of the order. Globally unique. Corresponds to the JSON property id

Returns:

  • (String)


5140
5141
5142
# File 'lib/google/apis/content_v2_1/classes.rb', line 5140

def id
  @id
end

#kindString

Identifies what kind of resource this is. Value: the fixed string "content# order" Corresponds to the JSON property kind

Returns:

  • (String)


5146
5147
5148
# File 'lib/google/apis/content_v2_1/classes.rb', line 5146

def kind
  @kind
end

#line_itemsArray<Google::Apis::ContentV2_1::OrderLineItem>

Line items that are ordered. Corresponds to the JSON property lineItems



5151
5152
5153
# File 'lib/google/apis/content_v2_1/classes.rb', line 5151

def line_items
  @line_items
end

#merchant_idFixnum

Corresponds to the JSON property merchantId

Returns:

  • (Fixnum)


5156
5157
5158
# File 'lib/google/apis/content_v2_1/classes.rb', line 5156

def merchant_id
  @merchant_id
end

#merchant_order_idString

Merchant-provided ID of the order. Corresponds to the JSON property merchantOrderId

Returns:

  • (String)


5161
5162
5163
# File 'lib/google/apis/content_v2_1/classes.rb', line 5161

def merchant_order_id
  @merchant_order_id
end

#net_price_amountGoogle::Apis::ContentV2_1::Price

The net amount for the order (price part). For example, if an order was originally for $100 and a refund was issued for $20, the net amount will be $ 80. Corresponds to the JSON property netPriceAmount



5168
5169
5170
# File 'lib/google/apis/content_v2_1/classes.rb', line 5168

def net_price_amount
  @net_price_amount
end

#net_tax_amountGoogle::Apis::ContentV2_1::Price

The net amount for the order (tax part). Note that in certain cases due to taxable base adjustment netTaxAmount might not match to a sum of tax field across all lineItems and refunds. Corresponds to the JSON property netTaxAmount



5175
5176
5177
# File 'lib/google/apis/content_v2_1/classes.rb', line 5175

def net_tax_amount
  @net_tax_amount
end

#payment_statusString

The status of the payment. Acceptable values are: - "paymentCaptured" - " paymentRejected" - "paymentSecured" - "pendingAuthorization" Corresponds to the JSON property paymentStatus

Returns:

  • (String)


5181
5182
5183
# File 'lib/google/apis/content_v2_1/classes.rb', line 5181

def payment_status
  @payment_status
end

#pickup_detailsGoogle::Apis::ContentV2_1::OrderPickupDetails

Pickup details for shipments of type pickup. Corresponds to the JSON property pickupDetails



5186
5187
5188
# File 'lib/google/apis/content_v2_1/classes.rb', line 5186

def pickup_details
  @pickup_details
end

#placed_dateString

The date when the order was placed, in ISO 8601 format. Corresponds to the JSON property placedDate

Returns:

  • (String)


5191
5192
5193
# File 'lib/google/apis/content_v2_1/classes.rb', line 5191

def placed_date
  @placed_date
end

#promotionsArray<Google::Apis::ContentV2_1::OrderPromotion>

Promotions associated with the order. To determine which promotions apply to which products, check the Promotions[].appliedItems[].lineItemId field against the LineItems[].id field for each promotion. If a promotion is applied to more than 1 offerId, divide the discount value by the number of affected offers to determine how much discount to apply to each offerId. Examples: 1. To calculate price paid by the customer for a single line item including the discount: For each promotion, subtract the LineItems[]. adjustments[].priceAdjustment.value amount from the LineItems[].Price.value.

  1. To calculate price paid by the customer for a single line item including the discount in case of multiple quantity: For each promotion, divide the LineItems[].adjustments[].priceAdjustment.value by the quantity of products then subtract the resulting value from the LineItems[].Product.Price.value for each quantity item. Only 1 promotion can be applied to an offerId in a given order. To refund an item which had a promotion applied to it, make sure to refund the amount after first subtracting the promotion discount from the item price. More details about the program are here. Corresponds to the JSON property promotions


5211
5212
5213
# File 'lib/google/apis/content_v2_1/classes.rb', line 5211

def promotions
  @promotions
end

#refundsArray<Google::Apis::ContentV2_1::OrderRefund>

Refunds for the order. Corresponds to the JSON property refunds



5216
5217
5218
# File 'lib/google/apis/content_v2_1/classes.rb', line 5216

def refunds
  @refunds
end

#shipmentsArray<Google::Apis::ContentV2_1::OrderShipment>

Shipments of the order. Corresponds to the JSON property shipments



5221
5222
5223
# File 'lib/google/apis/content_v2_1/classes.rb', line 5221

def shipments
  @shipments
end

#shipping_costGoogle::Apis::ContentV2_1::Price

The total cost of shipping for all items. Corresponds to the JSON property shippingCost



5226
5227
5228
# File 'lib/google/apis/content_v2_1/classes.rb', line 5226

def shipping_cost
  @shipping_cost
end

#shipping_cost_taxGoogle::Apis::ContentV2_1::Price

The tax for the total shipping cost. Corresponds to the JSON property shippingCostTax



5231
5232
5233
# File 'lib/google/apis/content_v2_1/classes.rb', line 5231

def shipping_cost_tax
  @shipping_cost_tax
end

#statusString

The status of the order. Acceptable values are: - "canceled" - "delivered"

  • "inProgress" - "partiallyDelivered" - "partiallyReturned" - " partiallyShipped" - "pendingShipment" - "returned" - "shipped" Corresponds to the JSON property status

Returns:

  • (String)


5238
5239
5240
# File 'lib/google/apis/content_v2_1/classes.rb', line 5238

def status
  @status
end

#tax_collectorString

The party responsible for collecting and remitting taxes. Acceptable values are: - "marketplaceFacilitator" - "merchant" Corresponds to the JSON property taxCollector

Returns:

  • (String)


5244
5245
5246
# File 'lib/google/apis/content_v2_1/classes.rb', line 5244

def tax_collector
  @tax_collector
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
# File 'lib/google/apis/content_v2_1/classes.rb', line 5251

def update!(**args)
  @acknowledged = args[:acknowledged] if args.key?(:acknowledged)
  @annotations = args[:annotations] if args.key?(:annotations)
  @billing_address = args[:billing_address] if args.key?(:billing_address)
  @customer = args[:customer] if args.key?(:customer)
  @delivery_details = args[:delivery_details] if args.key?(:delivery_details)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @line_items = args[:line_items] if args.key?(:line_items)
  @merchant_id = args[:merchant_id] if args.key?(:merchant_id)
  @merchant_order_id = args[:merchant_order_id] if args.key?(:merchant_order_id)
  @net_price_amount = args[:net_price_amount] if args.key?(:net_price_amount)
  @net_tax_amount = args[:net_tax_amount] if args.key?(:net_tax_amount)
  @payment_status = args[:payment_status] if args.key?(:payment_status)
  @pickup_details = args[:pickup_details] if args.key?(:pickup_details)
  @placed_date = args[:placed_date] if args.key?(:placed_date)
  @promotions = args[:promotions] if args.key?(:promotions)
  @refunds = args[:refunds] if args.key?(:refunds)
  @shipments = args[:shipments] if args.key?(:shipments)
  @shipping_cost = args[:shipping_cost] if args.key?(:shipping_cost)
  @shipping_cost_tax = args[:shipping_cost_tax] if args.key?(:shipping_cost_tax)
  @status = args[:status] if args.key?(:status)
  @tax_collector = args[:tax_collector] if args.key?(:tax_collector)
end