Class: Peddler::APIs::AmazonWarehousingAndDistribution20240509

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/error.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/address.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/error_list.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/carrier_code.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/prep_details.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/sku_quantity.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_order.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/package_volume.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/package_weight.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/shipment_labels.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/sku_eligibility.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_packages.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_shipment.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/measurement_data.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/prep_instruction.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/product_quantity.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/shipment_listing.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/tracking_details.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inventory_details.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inventory_listing.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inventory_summary.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/product_attribute.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/expiration_details.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inventory_quantity.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/package_dimensions.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/destination_details.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_eligibility.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_preferences.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/replenishment_order.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/distribution_package.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/distribution_product.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/transportation_details.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_order_reference.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_shipment_summary.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/sku_ineligibility_reason.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_shipment_summary.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/replenishment_preferences.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/order_ineligibility_reason.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/inbound_order_creation_data.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/replenishment_order_listing.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/distribution_package_contents.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/distribution_package_quantity.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/replenishment_order_reference.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/distribution_ineligible_reason.rb,
lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/replenishment_order_creation_data.rb,
sig/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rbs

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.

Defined Under Namespace

Classes: Address, CarrierCode, DestinationDetails, DistributionIneligibleReason, DistributionPackage, DistributionPackageContents, DistributionPackageQuantity, DistributionProduct, Error, ErrorList, ExpirationDetails, InboundEligibility, InboundOrder, InboundOrderCreationData, InboundOrderReference, InboundPackages, InboundPreferences, InboundShipment, InboundShipmentSummary, InventoryDetails, InventoryListing, InventoryQuantity, InventorySummary, MeasurementData, OrderIneligibilityReason, OutboundShipmentSummary, PackageDimensions, PackageVolume, PackageWeight, PrepDetails, PrepInstruction, ProductAttribute, ProductQuantity, ReplenishmentOrder, ReplenishmentOrderCreationData, ReplenishmentOrderListing, ReplenishmentOrderReference, ReplenishmentPreferences, SKUEligibility, SKUIneligibilityReason, SKUQuantity, ShipmentLabels, ShipmentListing, TrackingDetails, TransportationDetails

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

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

#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

  • (String)
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



58
59
60
61
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 58

def cancel_inbound(order_id, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}/cancellation"
  post(path, rate_limit:)
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

  • (Hash[untyped, untyped])
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



130
131
132
133
134
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 130

def check_inbound_eligibility(body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundEligibility"
  parser = -> { InboundEligibility }
  post(path, body:, rate_limit:, 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

  • (String)
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



69
70
71
72
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 69

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

#confirm_replenishment_order(order_id) ⇒ Peddler::Response

Confirms an AWD replenishment order in ELIGIBLE state with a set of shipments containing items that are needed to be replenished to an FBA node. Order can only be confirmed in ELIGIBLE state.

Parameters:

  • order_id (String)

    ID of the replenishment order to be confirmed.

  • (String)

Returns:



263
264
265
266
267
268
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 263

def confirm_replenishment_order(order_id)
  cannot_sandbox!

  path = "/awd/2024-05-09/replenishmentOrders/#{percent_encode(order_id)}/confirmation"
  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

  • (Hash[untyped, untyped])
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



21
22
23
24
25
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 21

def create_inbound(body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders"
  parser = -> { InboundOrderReference }
  post(path, body:, rate_limit:, parser:)
end

#create_replenishment_order(body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Creates an AWD replenishment order with given products to replenish. The API will return the order ID of the newly created order and also start an async validation check on the products to e. The order status will transition to ELIGIBLE/INELIGIBLE status from VALIDATING post validation check

Parameters:

  • body (Hash)

    Payload for creating a replenishment order.

  • (Hash[untyped, untyped])

Returns:



239
240
241
242
243
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 239

def create_replenishment_order(body)
  path = "/awd/2024-05-09/replenishmentOrders"
  parser = -> { ReplenishmentOrderReference }
  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

  • (String)
  • rate_limit: (Float) (defaults to: 2.0)

Returns:



33
34
35
36
37
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 33

def get_inbound(order_id, rate_limit: 2.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}"
  parser = -> { InboundOrder }
  get(path, rate_limit:, 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

  • (String)
  • sku_quantities: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 2.0)

Returns:



82
83
84
85
86
87
88
89
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 82

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 = -> { InboundShipment }
  get(path, params:, rate_limit:, 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

  • (String)
  • page_type: (String, nil) (defaults to: nil)
  • format_type: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



101
102
103
104
105
106
107
108
109
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 101

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 = -> { ShipmentLabels }
  get(path, params:, rate_limit:, parser:)
end

#get_replenishment_order(order_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieves an AWD Replenishment order with a set of shipments containing items that is/was planned to be replenished into an FBA node.

Parameters:

  • order_id (String)

    ID of the replenishment order to be retrieved.

  • (String)

Returns:



251
252
253
254
255
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 251

def get_replenishment_order(order_id)
  path = "/awd/2024-05-09/replenishmentOrders/#{percent_encode(order_id)}"
  parser = -> { ReplenishmentOrder }
  get(path, 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

  • sort_by: (String, nil) (defaults to: nil)
  • sort_order: (String, nil) (defaults to: nil)
  • shipment_status: (String, nil) (defaults to: nil)
  • updated_after: (String, nil) (defaults to: nil)
  • updated_before: (String, nil) (defaults to: nil)
  • max_results: (Integer, nil) (defaults to: 25)
  • next_token: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 156

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 = -> { ShipmentListing }
  get(path, params:, rate_limit:, 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

  • sku: (String, nil) (defaults to: nil)
  • sort_order: (String, nil) (defaults to: nil)
  • details: (String, nil) (defaults to: nil)
  • next_token: (String, nil) (defaults to: nil)
  • max_results: (Integer, nil) (defaults to: 25)
  • rate_limit: (Float) (defaults to: 2.0)

Returns:



187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 187

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 = -> { InventoryListing }
  get(path, params:, rate_limit:, parser:)
end

#list_replenishment_orders(updated_after: nil, updated_before: nil, sort_order: nil, max_results: 25, next_token: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieves all the AWD replenishment orders pertaining to a merchant with optional filters. API by default will sort orders by updatedAt attribute in descending order.

Parameters:

  • updated_after (String) (defaults to: nil)

    Get the replenishment orders updated after certain time (Inclusive) Date should be in ISO 8601 format as defined by date-time in - https://www.rfc-editor.org/rfc/rfc3339.

  • updated_before (String) (defaults to: nil)

    Get the replenishment orders updated before certain time (Inclusive) Date should be in ISO 8601 format as defined by date-time in - https://www.rfc-editor.org/rfc/rfc3339.

  • sort_order (String) (defaults to: nil)

    Sort the response in ASCENDING or DESCENDING order. The default sort order is DESCENDING.

  • max_results (Integer) (defaults to: 25)

    Maximum results to be returned in a single response.

  • 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.

  • updated_after: (String, nil) (defaults to: nil)
  • updated_before: (String, nil) (defaults to: nil)
  • sort_order: (String, nil) (defaults to: nil)
  • max_results: (Integer, nil) (defaults to: 25)
  • next_token: (String, nil) (defaults to: nil)

Returns:



217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 217

def list_replenishment_orders(updated_after: nil, updated_before: nil, sort_order: nil, max_results: 25,
  next_token: nil)
  path = "/awd/2024-05-09/replenishmentOrders"
  params = {
    "updatedAfter" => updated_after,
    "updatedBefore" => updated_before,
    "sortOrder" => sort_order,
    "maxResults" => max_results,
    "nextToken" => next_token,
  }.compact
  parser = -> { ReplenishmentOrderListing }
  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

  • (String)
  • (Hash[untyped, untyped])
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



47
48
49
50
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 47

def update_inbound(order_id, body, rate_limit: 1.0)
  path = "/awd/2024-05-09/inboundOrders/#{percent_encode(order_id)}"
  put(path, body:, rate_limit:)
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

  • (String)
  • (Hash[untyped, untyped])
  • rate_limit: (Float) (defaults to: 1.0)

Returns:



118
119
120
121
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 118

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