Class: Peddler::APIs::OrdersV0
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::OrdersV0
- Defined in:
- lib/peddler/apis/orders_v0.rb,
lib/peddler/apis/orders_v0/error.rb,
lib/peddler/apis/orders_v0/order.rb,
lib/peddler/apis/orders_v0/address.rb,
lib/peddler/apis/orders_v0/buyer_info.rb,
lib/peddler/apis/orders_v0/error_list.rb,
lib/peddler/apis/orders_v0/order_item.rb,
lib/peddler/apis/orders_v0/order_list.rb,
lib/peddler/apis/orders_v0/measurement.rb,
lib/peddler/apis/orders_v0/order_items.rb,
lib/peddler/apis/orders_v0/orders_list.rb,
lib/peddler/apis/orders_v0/open_interval.rb,
lib/peddler/apis/orders_v0/order_address.rb,
lib/peddler/apis/orders_v0/business_hours.rb,
lib/peddler/apis/orders_v0/buyer_tax_info.rb,
lib/peddler/apis/orders_v0/package_detail.rb,
lib/peddler/apis/orders_v0/tax_collection.rb,
lib/peddler/apis/orders_v0/amazon_programs.rb,
lib/peddler/apis/orders_v0/associated_item.rb,
lib/peddler/apis/orders_v0/exception_dates.rb,
lib/peddler/apis/orders_v0/item_buyer_info.rb,
lib/peddler/apis/orders_v0/order_item_list.rb,
lib/peddler/apis/orders_v0/order_buyer_info.rb,
lib/peddler/apis/orders_v0/order_items_list.rb,
lib/peddler/apis/orders_v0/rejection_reason.rb,
lib/peddler/apis/orders_v0/promotion_id_list.rb,
lib/peddler/apis/orders_v0/get_order_response.rb,
lib/peddler/apis/orders_v0/open_time_interval.rb,
lib/peddler/apis/orders_v0/tax_classification.rb,
lib/peddler/apis/orders_v0/get_orders_response.rb,
lib/peddler/apis/orders_v0/prescription_detail.rb,
lib/peddler/apis/orders_v0/product_info_detail.rb,
lib/peddler/apis/orders_v0/substitution_option.rb,
lib/peddler/apis/orders_v0/delivery_preferences.rb,
lib/peddler/apis/orders_v0/marketplace_tax_info.rb,
lib/peddler/apis/orders_v0/order_regulated_info.rb,
lib/peddler/apis/orders_v0/shipping_constraints.rb,
lib/peddler/apis/orders_v0/verification_details.rb,
lib/peddler/apis/orders_v0/buyer_tax_information.rb,
lib/peddler/apis/orders_v0/order_item_buyer_info.rb,
lib/peddler/apis/orders_v0/points_granted_detail.rb,
lib/peddler/apis/orders_v0/regulated_information.rb,
lib/peddler/apis/orders_v0/buyer_requested_cancel.rb,
lib/peddler/apis/orders_v0/transparency_code_list.rb,
lib/peddler/apis/orders_v0/address_extended_fields.rb,
lib/peddler/apis/orders_v0/fulfillment_instruction.rb,
lib/peddler/apis/orders_v0/preferred_delivery_time.rb,
lib/peddler/apis/orders_v0/confirm_shipment_request.rb,
lib/peddler/apis/orders_v0/get_order_items_response.rb,
lib/peddler/apis/orders_v0/substitution_option_list.rb,
lib/peddler/apis/orders_v0/substitution_preferences.rb,
lib/peddler/apis/orders_v0/valid_verification_detail.rb,
lib/peddler/apis/orders_v0/get_order_address_response.rb,
lib/peddler/apis/orders_v0/order_item_buyer_info_list.rb,
lib/peddler/apis/orders_v0/automated_shipping_settings.rb,
lib/peddler/apis/orders_v0/confirm_shipment_order_item.rb,
lib/peddler/apis/orders_v0/order_items_buyer_info_list.rb,
lib/peddler/apis/orders_v0/regulated_information_field.rb,
lib/peddler/apis/orders_v0/buyer_customized_info_detail.rb,
lib/peddler/apis/orders_v0/get_order_buyer_info_response.rb,
lib/peddler/apis/orders_v0/payment_execution_detail_item.rb,
lib/peddler/apis/orders_v0/update_shipment_status_request.rb,
lib/peddler/apis/orders_v0/confirm_shipment_error_response.rb,
lib/peddler/apis/orders_v0/payment_method_detail_item_list.rb,
lib/peddler/apis/orders_v0/confirm_shipment_order_items_list.rb,
lib/peddler/apis/orders_v0/get_order_regulated_info_response.rb,
lib/peddler/apis/orders_v0/payment_execution_detail_item_list.rb,
lib/peddler/apis/orders_v0/update_verification_status_request.rb,
lib/peddler/apis/orders_v0/get_order_items_buyer_info_response.rb,
lib/peddler/apis/orders_v0/regulated_order_verification_status.rb,
lib/peddler/apis/orders_v0/update_shipment_status_error_response.rb,
lib/peddler/apis/orders_v0/update_verification_status_request_body.rb,
lib/peddler/apis/orders_v0/update_verification_status_error_response.rb,
sig/peddler/apis/orders_v0.rbs
Overview
Selling Partner API for Orders
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).
Defined Under Namespace
Classes: Address, AddressExtendedFields, AmazonPrograms, AssociatedItem, AutomatedShippingSettings, BusinessHours, BuyerCustomizedInfoDetail, BuyerInfo, BuyerRequestedCancel, BuyerTaxInfo, BuyerTaxInformation, ConfirmShipmentErrorResponse, ConfirmShipmentOrderItem, ConfirmShipmentOrderItemsList, ConfirmShipmentRequest, DeliveryPreferences, Error, ErrorList, ExceptionDates, FulfillmentInstruction, GetOrderAddressResponse, GetOrderBuyerInfoResponse, GetOrderItemsBuyerInfoResponse, GetOrderItemsResponse, GetOrderRegulatedInfoResponse, GetOrderResponse, GetOrdersResponse, ItemBuyerInfo, MarketplaceTaxInfo, Measurement, OpenInterval, OpenTimeInterval, Order, OrderAddress, OrderBuyerInfo, OrderItem, OrderItemBuyerInfo, OrderItemBuyerInfoList, OrderItemList, OrderItems, OrderItemsBuyerInfoList, OrderItemsList, OrderList, OrderRegulatedInfo, OrdersList, PackageDetail, PaymentExecutionDetailItem, PaymentExecutionDetailItemList, PaymentMethodDetailItemList, PointsGrantedDetail, PreferredDeliveryTime, PrescriptionDetail, ProductInfoDetail, PromotionIdList, RegulatedInformation, RegulatedInformationField, RegulatedOrderVerificationStatus, RejectionReason, ShippingConstraints, SubstitutionOption, SubstitutionOptionList, SubstitutionPreferences, TaxClassification, TaxCollection, TransparencyCodeList, UpdateShipmentStatusErrorResponse, UpdateShipmentStatusRequest, UpdateVerificationStatusErrorResponse, UpdateVerificationStatusRequest, UpdateVerificationStatusRequestBody, ValidVerificationDetail, VerificationDetails
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #retries
Instance Method Summary collapse
-
#confirm_shipment(order_id, payload, rate_limit: 2.0) ⇒ Peddler::Response
Updates the shipment confirmation status for a specified order.
-
#get_order(order_id, rate_limit: 0.5) ⇒ Peddler::Response
Returns the order that you specify.
-
#get_order_address(order_id, rate_limit: 0.5) ⇒ Peddler::Response
Returns the shipping address for the order that you specify.
-
#get_order_buyer_info(order_id, rate_limit: 0.5) ⇒ Peddler::Response
Returns buyer information for the order that you specify.
-
#get_order_items(order_id, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response
Returns detailed order item information for the order that you specify.
-
#get_order_items_buyer_info(order_id, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response
Returns buyer information for the order items in the order that you specify.
-
#get_order_regulated_info(order_id, rate_limit: 0.5) ⇒ Peddler::Response
Returns regulated information for the order that you specify.
-
#get_orders(marketplace_ids, created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, order_statuses: nil, fulfillment_channels: nil, payment_methods: nil, seller_order_id: nil, max_results_per_page: nil, easy_ship_shipment_statuses: nil, electronic_invoice_statuses: nil, next_token: nil, amazon_order_ids: nil, actual_fulfillment_supply_source_id: nil, is_ispu: nil, store_chain_store_id: nil, earliest_delivery_date_before: nil, earliest_delivery_date_after: nil, latest_delivery_date_before: nil, latest_delivery_date_after: nil, rate_limit: 0.0167) ⇒ Peddler::Response
Returns orders that are created or updated during the specified time period.
-
#update_shipment_status(order_id, payload, rate_limit: 5.0) ⇒ Peddler::Response
Update the shipment status for an order that you specify.
-
#update_verification_status(order_id, payload, rate_limit: 0.5) ⇒ Peddler::Response
Updates (approves or rejects) the verification status of an order containing regulated products.
Methods inherited from Peddler::API
#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#confirm_shipment(order_id, payload, rate_limit: 2.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Updates the shipment confirmation status for a specified order.
266 267 268 269 270 |
# File 'lib/peddler/apis/orders_v0.rb', line 266 def confirm_shipment(order_id, payload, rate_limit: 2.0) path = "/orders/v0/orders/#{percent_encode(order_id)}/shipmentConfirmation" body = payload post(path, body:, rate_limit:) end |
#get_order(order_id, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns the order that you specify.
151 152 153 154 155 |
# File 'lib/peddler/apis/orders_v0.rb', line 151 def get_order(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}" parser = -> { GetOrderResponse } get(path, rate_limit:, parser:) end |
#get_order_address(order_id, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns the shipping address for the order that you specify.
175 176 177 178 179 |
# File 'lib/peddler/apis/orders_v0.rb', line 175 def get_order_address(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/address" parser = -> { GetOrderAddressResponse } get(path, rate_limit:, parser:) end |
#get_order_buyer_info(order_id, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns buyer information for the order that you specify.
163 164 165 166 167 |
# File 'lib/peddler/apis/orders_v0.rb', line 163 def get_order_buyer_info(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/buyerInfo" parser = -> { GetOrderBuyerInfoResponse } get(path, rate_limit:, parser:) end |
#get_order_items(order_id, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns detailed order item information for the order that you specify. If NextToken is provided, it's used to
retrieve the next page of order items.
Note: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order.
196 197 198 199 200 201 202 203 |
# File 'lib/peddler/apis/orders_v0.rb', line 196 def get_order_items(order_id, next_token: nil, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/orderItems" params = { "NextToken" => next_token, }.compact parser = -> { GetOrderItemsResponse } get(path, params:, rate_limit:, parser:) end |
#get_order_items_buyer_info(order_id, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns buyer information for the order items in the order that you specify.
212 213 214 215 216 217 218 219 |
# File 'lib/peddler/apis/orders_v0.rb', line 212 def get_order_items_buyer_info(order_id, next_token: nil, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/orderItems/buyerInfo" params = { "NextToken" => next_token, }.compact parser = -> { GetOrderItemsBuyerInfoResponse } get(path, params:, rate_limit:, parser:) end |
#get_order_regulated_info(order_id, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns regulated information for the order that you specify.
240 241 242 243 244 |
# File 'lib/peddler/apis/orders_v0.rb', line 240 def get_order_regulated_info(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo" parser = -> { GetOrderRegulatedInfoResponse } get(path, rate_limit:, parser:) end |
#get_orders(marketplace_ids, created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, order_statuses: nil, fulfillment_channels: nil, payment_methods: nil, seller_order_id: nil, max_results_per_page: nil, easy_ship_shipment_statuses: nil, electronic_invoice_statuses: nil, next_token: nil, amazon_order_ids: nil, actual_fulfillment_supply_source_id: nil, is_ispu: nil, store_chain_store_id: nil, earliest_delivery_date_before: nil, earliest_delivery_date_after: nil, latest_delivery_date_before: nil, latest_delivery_date_after: nil, rate_limit: 0.0167) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns orders that are created or updated during the specified time period. If you want to return specific
types of orders, you can apply filters to your request. NextToken doesn't affect any filters that you include
in your request; it only impacts the pagination for the filtered orders response.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/peddler/apis/orders_v0.rb', line 110 def get_orders(marketplace_ids, created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, order_statuses: nil, fulfillment_channels: nil, payment_methods: nil, seller_order_id: nil, max_results_per_page: nil, easy_ship_shipment_statuses: nil, electronic_invoice_statuses: nil, next_token: nil, amazon_order_ids: nil, actual_fulfillment_supply_source_id: nil, is_ispu: nil, store_chain_store_id: nil, earliest_delivery_date_before: nil, earliest_delivery_date_after: nil, latest_delivery_date_before: nil, latest_delivery_date_after: nil, rate_limit: 0.0167) path = "/orders/v0/orders" params = { "CreatedAfter" => created_after, "CreatedBefore" => created_before, "LastUpdatedAfter" => last_updated_after, "LastUpdatedBefore" => last_updated_before, "OrderStatuses" => stringify_array(order_statuses), "MarketplaceIds" => stringify_array(marketplace_ids), "FulfillmentChannels" => stringify_array(fulfillment_channels), "PaymentMethods" => stringify_array(payment_methods), "SellerOrderId" => seller_order_id, "MaxResultsPerPage" => max_results_per_page, "EasyShipShipmentStatuses" => stringify_array(easy_ship_shipment_statuses), "ElectronicInvoiceStatuses" => stringify_array(electronic_invoice_statuses), "NextToken" => next_token, "AmazonOrderIds" => stringify_array(amazon_order_ids), "ActualFulfillmentSupplySourceId" => actual_fulfillment_supply_source_id, "IsISPU" => is_ispu, "StoreChainStoreId" => store_chain_store_id, "EarliestDeliveryDateBefore" => earliest_delivery_date_before, "EarliestDeliveryDateAfter" => earliest_delivery_date_after, "LatestDeliveryDateBefore" => latest_delivery_date_before, "LatestDeliveryDateAfter" => latest_delivery_date_after, }.compact parser = -> { GetOrdersResponse } get(path, params:, rate_limit:, parser:) end |
#update_shipment_status(order_id, payload, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Update the shipment status for an order that you specify.
228 229 230 231 232 |
# File 'lib/peddler/apis/orders_v0.rb', line 228 def update_shipment_status(order_id, payload, rate_limit: 5.0) path = "/orders/v0/orders/#{percent_encode(order_id)}/shipment" body = payload post(path, body:, rate_limit:) end |
#update_verification_status(order_id, payload, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Updates (approves or rejects) the verification status of an order containing regulated products.
253 254 255 256 257 |
# File 'lib/peddler/apis/orders_v0.rb', line 253 def update_verification_status(order_id, payload, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo" body = payload patch(path, body:, rate_limit:) end |