Class: Peddler::APIs::AmazonWarehousingAndDistribution20240509

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb

Overview

The Selling Partner API for Amazon Warehousing and Distribution

The Selling Partner API for Amazon Warehousing and Distribution (AWD) provides programmatic access to information about AWD shipments and inventory.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

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

#cancel_inbound(order_id, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Cancels an AWD Inbound order and its associated shipment.

Parameters:

  • order_id (String)

    The ID of the inbound order you want to cancel.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



66
67
68
69
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 66

def cancel_inbound(order_id, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}/cancellation"
  meter(rate_limit).post(path)
end

#check_inbound_eligibility(body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Determines if the packages you specify are eligible for an AWD inbound order and contains error details for ineligible packages.

Parameters:

  • body (Hash)

    Represents the packages you want to inbound.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



138
139
140
141
142
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 138

def check_inbound_eligibility(body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundEligibility"
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::InboundEligibility if typed?
  meter(rate_limit).post(path, body:, parser:)
end

#confirm_inbound(order_id, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Confirms an AWD inbound order in ‘DRAFT` status.

Parameters:

  • order_id (String)

    The ID of the inbound order that you want to confirm.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



77
78
79
80
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 77

def confirm_inbound(order_id, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}/confirmation"
  meter(rate_limit).post(path)
end

#create_inbound(body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Creates a draft AWD inbound order with a list of packages for inbound shipment. The operation creates one shipment per order.

Parameters:

  • body (Hash)

    Payload for creating an inbound order.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



29
30
31
32
33
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 29

def create_inbound(body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders"
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::InboundOrderReference if typed?
  meter(rate_limit).post(path, body:, parser:)
end

#get_inbound(order_id, rate_limit: 2.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieves an AWD inbound order.

Parameters:

  • order_id (String)

    The ID of the inbound order that you want to retrieve.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



41
42
43
44
45
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 41

def get_inbound(order_id, rate_limit: 2.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}"
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::InboundOrder if typed?
  meter(rate_limit).get(path, parser:)
end

#get_inbound_shipment(shipment_id, sku_quantities: nil, rate_limit: 2.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieves an AWD inbound shipment.

Parameters:

  • shipment_id (String)

    ID for the shipment. A shipment contains the cases being inbounded.

  • sku_quantities (String) (defaults to: nil)

    If equal to ‘SHOW`, the response includes the shipment SKU quantity details. Defaults to `HIDE`, in which case the response does not contain SKU quantities

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



90
91
92
93
94
95
96
97
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 90

def get_inbound_shipment(shipment_id, sku_quantities: nil, rate_limit: 2.0)
  path = "/awd/2024-05-09/inboundShipments/#{percent_encode(shipment_id)}"
  params = {
    "skuQuantities" => sku_quantities,
  }.compact
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::InboundShipment if typed?
  meter(rate_limit).get(path, params:, parser:)
end

#get_inbound_shipment_labels(shipment_id, page_type: nil, format_type: nil, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieves the box labels for a shipment ID that you specify. This is an asynchronous operation. If the label status is ‘GENERATED`, then the label URL is available.

Parameters:

  • shipment_id (String)

    ID for the shipment.

  • page_type (String) (defaults to: nil)

    Page type for the generated labels. The default is ‘PLAIN_PAPER`.

  • format_type (String) (defaults to: nil)

    The format type of the output file that contains your labels. The default format type is ‘PDF`.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



109
110
111
112
113
114
115
116
117
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 109

def get_inbound_shipment_labels(shipment_id, page_type: nil, format_type: nil, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundShipments/#{percent_encode(shipment_id)}/labels"
  params = {
    "pageType" => page_type,
    "formatType" => format_type,
  }.compact
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::ShipmentLabels if typed?
  meter(rate_limit).get(path, params:, parser:)
end

#list_inbound_shipments(sort_by: nil, sort_order: nil, shipment_status: nil, updated_after: nil, updated_before: nil, max_results: 25, next_token: nil, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieves a summary of all the inbound AWD shipments associated with a merchant, with the ability to apply optional filters.

Parameters:

  • sort_by (String) (defaults to: nil)

    Field to sort results by. By default, the response will be sorted by UPDATED_AT.

  • sort_order (String) (defaults to: nil)

    Sort the response in ASCENDING or DESCENDING order. By default, the response will be sorted in DESCENDING order.

  • shipment_status (String) (defaults to: nil)

    Filter by inbound shipment status.

  • updated_after (String) (defaults to: nil)

    List the inbound shipments that were updated after a certain time (inclusive). The date must be in ISO 8601 format.

  • updated_before (String) (defaults to: nil)

    List the inbound shipments that were updated before a certain time (inclusive). The date must be in ISO 8601 format.

  • max_results (Integer) (defaults to: 25)

    Maximum number of results to return.

  • next_token (String) (defaults to: nil)

    A token that is used to retrieve the next page of results. The response includes ‘nextToken` when the number of results exceeds the specified `maxResults` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 164

def list_inbound_shipments(sort_by: nil, sort_order: nil, shipment_status: nil, updated_after: nil,
  updated_before: nil, max_results: 25, next_token: nil, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundShipments"
  params = {
    "sortBy" => sort_by,
    "sortOrder" => sort_order,
    "shipmentStatus" => shipment_status,
    "updatedAfter" => updated_after,
    "updatedBefore" => updated_before,
    "maxResults" => max_results,
    "nextToken" => next_token,
  }.compact
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::ShipmentListing if typed?
  meter(rate_limit).get(path, params:, parser:)
end

#list_inventory(sku: nil, sort_order: nil, details: nil, next_token: nil, max_results: 25, rate_limit: 2.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Lists AWD inventory associated with a merchant with the ability to apply optional filters.

Parameters:

  • sku (String) (defaults to: nil)

    Filter by seller or merchant SKU for the item.

  • sort_order (String) (defaults to: nil)

    Sort the response in ‘ASCENDING` or `DESCENDING` order.

  • details (String) (defaults to: nil)

    Set to ‘SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals.

  • next_token (String) (defaults to: nil)

    A token that is used to retrieve the next page of results. The response includes ‘nextToken` when the number of results exceeds the specified `maxResults` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.

  • max_results (Integer) (defaults to: 25)

    Maximum number of results to return.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 195

def list_inventory(sku: nil, sort_order: nil, details: nil, next_token: nil, max_results: 25, rate_limit: 2.0)
  path = "/awd/2024-05-09/inventory"
  params = {
    "sku" => sku,
    "sortOrder" => sort_order,
    "details" => details,
    "nextToken" => next_token,
    "maxResults" => max_results,
  }.compact
  parser = Peddler::Types::AmazonWarehousingAndDistribution20240509::InventoryListing if typed?
  meter(rate_limit).get(path, params:, parser:)
end

#update_inbound(order_id, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Updates an AWD inbound order that is in ‘DRAFT` status and not yet confirmed. Use this operation to update the `packagesToInbound`, `originAddress` and `preferences` attributes.

Parameters:

  • order_id (String)

    The ID of the inbound order that you want to update.

  • body (Hash)

    Represents an AWD inbound order.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



55
56
57
58
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 55

def update_inbound(order_id, body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}"
  meter(rate_limit).put(path, body:)
end

#update_inbound_shipment_transport_details(shipment_id, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Updates transport details for an AWD shipment.

Parameters:

  • shipment_id (String)

    The shipment ID.

  • body (Hash)

    Transportation details for the shipment.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



126
127
128
129
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 126

def update_inbound_shipment_transport_details(shipment_id, body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundShipments/#{percent_encode(shipment_id)}/transport"
  meter(rate_limit).put(path, body:)
end