Module: Peddler::Notifications::OrderChange
- Defined in:
- lib/peddler/notifications/order_change.rb,
lib/peddler/notifications/order_change/payload.rb,
lib/peddler/notifications/order_change/summary.rb,
lib/peddler/notifications/order_change/order_item.rb,
lib/peddler/notifications/order_change/notification.rb,
lib/peddler/notifications/order_change/order_change_trigger.rb,
lib/peddler/notifications/order_change/order_change_notification.rb
Overview
The root schema
The notification response schema that comprises the entire JSON document for ORDER_CHANGE notification.
Constant Summary collapse
- Payload =
Notification payload that wraps nested notification data
Structure.new do # @return [OrderChangeNotification] attribute(:order_change_notification, OrderChangeNotification, null: false, from: "OrderChangeNotification") end
- Summary =
Information about order and order items that had the change.
Structure.new do # @return [String] The destination postal code. It will be null when there is no related information. attribute(:destination_postal_code, String, from: "DestinationPostalCode") # @return [String] Fulfillment type of the affected order, MFN or AFN. attribute(:fulfillment_type, String, null: false, from: "FulfillmentType") # @return [String] The Amazon marketplace identifier of the order. attribute(:marketplace_id, String, null: false, from: "MarketplaceId") # @return [Array<OrderItem>] Information about order items included in this order. For OrderItemLevel # notification, one payload include one item, while for OrderLevel notification, one payload include all # items. attribute(:order_items, [OrderItem], null: false, from: "OrderItems") # @return [String] The current order status. attribute(:order_status, String, null: false, from: "OrderStatus") # @return [String] The type of the order. attribute(:order_type, String, null: false, from: "OrderType") # @return [String] The purchase date of the order, presented in ISO-8601 date/time format. It will be null when # there is no related information. attribute(:purchase_date, String, from: "PurchaseDate") # @return [String] The end of the time period which you cancel notify for the order, presented in ISO-8601 # date/time format. attribute?(:cancel_notify_date, String, from: "CancelNotifyDate") # @return [String] The start of the time period within which you have committed to fulfill the order, presented # in ISO-8601 date/time format. Returned only for seller-fulfilled orders. attribute?(:earliest_delivery_date, String, from: "EarliestDeliveryDate") # @return [String] The start of the time period within which you have committed to ship the order, presented in # ISO-8601 date/time format. attribute?(:earliest_ship_date, String, from: "EarliestShipDate") # @return [String] The status of the Amazon Easy Ship order. This property is included only for Amazon Easy Ship # orders. attribute?(:easy_ship_shipment_status, String, from: "EasyShipShipmentStatus") # @return [String] The status of the electronic invoice. attribute?(:electronic_invoice_status, String, from: "ElectronicInvoiceStatus") # @return [String] The end of the time period within which you have committed to fulfill the order, presented in # ISO-8601 date/time format. Returned only for seller-fulfilled orders that do not have a PendingAvailability, # Pending, or Canceled status. attribute?(:latest_delivery_date, String, from: "LatestDeliveryDate") # @return [String] The end of the time period within which you have committed to ship the order, presented in # ISO-8601 date/time format. attribute?(:latest_ship_date, String, from: "LatestShipDate") # @return [Integer] The number of items shipped. attribute?(:number_of_items_shipped, Integer, from: "NumberOfItemsShipped") # @return [Integer] The number of items unshipped. attribute?(:number_of_items_unshipped, Integer, from: "NumberOfItemsUnshipped") # @return [Array<String>] The order programs, if any, in which this order participates. attribute?(:order_programs, [String], from: "OrderPrograms") # @return [Array<String>] The shipping programs, if any, in which this order participates. attribute?(:shipping_programs, [String], from: "ShippingPrograms") end
- OrderItem =
Information about every order item.
Structure.new do # @return [String] The Amazon-defined order item identifier. attribute(:order_item_id, String, null: false, from: "OrderItemId") # @return [Integer] The number of items in the order. attribute(:quantity, Integer, null: false, from: "Quantity") # @return [String] The seller-specific SKU identifier for an item. attribute(:seller_sku, String, null: false, from: "SellerSKU") # @return [String] The unique identifier of the supply source. It will be null when there is no related # information. attribute(:supply_source_id, String, from: "SupplySourceId") # @return [:boolean] Information about whether or not a buyer requested cancellation. When true, the buyer has # requested cancellation. attribute?(:buyer_requested_cancel, :boolean, from: "IsBuyerRequestedCancel") # @return [String] The start of the time period within which you have committed to fulfill the order item. attribute?(:item_earliest_delivery_date, String, from: "ItemEarliestDeliveryDate") # @return [String] The end of the time period within which you have committed to fulfill the order item. attribute?(:item_latest_delivery_date, String, from: "ItemLatestDeliveryDate") # @return [String] The current status of the order item. Will display it when items' status are different. attribute?(:order_item_status, String, from: "OrderItemStatus") # @return [Integer] The number of items shipped. attribute?(:quantity_shipped, Integer, from: "QuantityShipped") end
- Notification =
The notification response schema that comprises the entire JSON document for ORDER_CHANGE notification.
Structure.new do # @return [String] The time when this notification was published, presented in ISO-8601 date/time format. attribute(:event_time, String, null: false, from: "EventTime") # @return [Hash] The notification metadata. attribute(:notification_metadata, Hash, null: false, from: "NotificationMetadata") # @return [String] The type of this notification, used to differentiate different notifications. Combined with # payload version controls the structure of payload object. attribute(:notification_type, String, null: false, from: "NotificationType") # @return [String] The notification version. attribute(:notification_version, String, null: false, from: "NotificationVersion") # @return [Payload] The payload for this ORDER_CHANGE notification. It's unique for different event type and # will provide more in-depth information about this notification. attribute(:payload, Payload, null: false, from: "Payload") # @return [String] The payload version of the notification. attribute(:payload_version, String, null: false, from: "PayloadVersion") end
- OrderChangeTrigger =
Details about what triggered this ORDER_CHANGE notification.
Structure.new do # @return [String] The reason for this ORDER_CHANGE notification. attribute(:change_reason, String, null: false, from: "ChangeReason") # @return [String] The timestamp for the change that caused this notification, presented in ISO-8601 date/time # format. It will be null when there is no related timestamp. attribute(:time_of_order_change, String, from: "TimeOfOrderChange") end
- OrderChangeNotification =
Nested notification data
Structure.new do # @return [String] The Amazon order identifier, in 3-7-7 format. attribute(:amazon_order_id, String, null: false, from: "AmazonOrderId") # @return [String] The notification level of current notification. attribute(:notification_level, String, null: false, from: "NotificationLevel") # @return [OrderChangeTrigger] attribute(:order_change_trigger, OrderChangeTrigger, null: false, from: "OrderChangeTrigger") # @return [String] Change type of this notification. The possible values include BuyerRequestedChange, # DeliveryTipChange, OrderStatusChange. attribute(:order_change_type, String, null: false, from: "OrderChangeType") # @return [String] The selling partner identifier. attribute(:seller_id, String, null: false, from: "SellerId") # @return [Summary] attribute(:summary, Summary, null: false, from: "Summary") end
Class Method Summary collapse
Class Method Details
.parse(hash) ⇒ Object
12 13 14 |
# File 'lib/peddler/notifications/order_change.rb', line 12 def parse(hash) Notification.parse(hash) end |