Class: Peddler::APIs::OrdersV0
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::OrdersV0
- Defined in:
- lib/peddler/apis/orders_v0.rb
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).
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, buyer_email: 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
#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #use, #via
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.
275 276 277 278 279 |
# File 'lib/peddler/apis/orders_v0.rb', line 275 def confirm_shipment(order_id, payload, rate_limit: 2.0) path = "/orders/v0/orders/#{percent_encode(order_id)}/shipmentConfirmation" body = payload meter(rate_limit).post(path, body:) 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.
160 161 162 163 164 |
# File 'lib/peddler/apis/orders_v0.rb', line 160 def get_order(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}" parser = Peddler::Types::OrdersV0::GetOrderResponse if typed? meter(rate_limit).get(path, 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.
184 185 186 187 188 |
# File 'lib/peddler/apis/orders_v0.rb', line 184 def get_order_address(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/address" parser = Peddler::Types::OrdersV0::GetOrderAddressResponse if typed? meter(rate_limit).get(path, 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.
172 173 174 175 176 |
# File 'lib/peddler/apis/orders_v0.rb', line 172 def get_order_buyer_info(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/buyerInfo" parser = Peddler::Types::OrdersV0::GetOrderBuyerInfoResponse if typed? meter(rate_limit).get(path, 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.
205 206 207 208 209 210 211 212 |
# File 'lib/peddler/apis/orders_v0.rb', line 205 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 = Peddler::Types::OrdersV0::GetOrderItemsResponse if typed? meter(rate_limit).get(path, params:, 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.
221 222 223 224 225 226 227 228 |
# File 'lib/peddler/apis/orders_v0.rb', line 221 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 = Peddler::Types::OrdersV0::GetOrderItemsBuyerInfoResponse if typed? meter(rate_limit).get(path, params:, 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.
249 250 251 252 253 |
# File 'lib/peddler/apis/orders_v0.rb', line 249 def get_order_regulated_info(order_id, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo" parser = Peddler::Types::OrdersV0::GetOrderRegulatedInfoResponse if typed? meter(rate_limit).get(path, 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, buyer_email: 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.
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 144 145 146 147 148 149 150 151 152 |
# File 'lib/peddler/apis/orders_v0.rb', line 118 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, buyer_email: 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), "BuyerEmail" => buyer_email, "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 = Peddler::Types::OrdersV0::GetOrdersResponse if typed? meter(rate_limit).get(path, params:, 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.
237 238 239 240 241 |
# File 'lib/peddler/apis/orders_v0.rb', line 237 def update_shipment_status(order_id, payload, rate_limit: 5.0) path = "/orders/v0/orders/#{percent_encode(order_id)}/shipment" body = payload meter(rate_limit).post(path, body:) 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.
262 263 264 265 266 |
# File 'lib/peddler/apis/orders_v0.rb', line 262 def update_verification_status(order_id, payload, rate_limit: 0.5) path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo" body = payload meter(rate_limit).patch(path, body:) end |