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, #parser

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#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:



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

def get_inbound_shipment(shipment_id, sku_quantities: nil, rate_limit: 2.0)
  path = "/awd/2024-05-09/inboundShipments/#{shipment_id}"
  params = {
    "skuQuantities" => sku_quantities,
  }.compact

  meter(rate_limit).get(path, params:)
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)

    Token to retrieve the next set of paginated results.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb', line 51

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

  meter(rate_limit).get(path, params:)
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)

    Token to retrieve the next set of paginated results.

  • max_results (Integer) (defaults to: 25)

    Maximum number of results to return.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



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

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

  meter(rate_limit).get(path, params:)
end