Class: Peddler::APIs::FBAInventoryV1
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::FBAInventoryV1
- Defined in:
- lib/peddler/apis/fba_inventory_v1.rb
Overview
Selling Partner API for FBA Inventory
The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network.
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #parser, #retries
Instance Method Summary collapse
-
#add_inventory(x_amzn_idempotency_token, add_inventory_request_body) ⇒ Peddler::Response
Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment.
-
#create_inventory_item(create_inventory_item_request_body) ⇒ Peddler::Response
Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment.
-
#delete_inventory_item(seller_sku, marketplace_id) ⇒ Peddler::Response
Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment.
-
#get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil, rate_limit: 2.0) ⇒ Peddler::Response
Returns a list of inventory summaries.
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
#add_inventory(x_amzn_idempotency_token, add_inventory_request_body) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to Selling Partner API sandbox for more information.
109 110 111 112 113 114 115 116 |
# File 'lib/peddler/apis/fba_inventory_v1.rb', line 109 def add_inventory(x_amzn_idempotency_token, add_inventory_request_body) must_sandbox! path = "/fba/inventory/v1/items/inventory" body = add_inventory_request_body post(path, body:) end |
#create_inventory_item(create_inventory_item_request_body) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to Selling Partner API sandbox for more information.
72 73 74 75 76 77 78 79 |
# File 'lib/peddler/apis/fba_inventory_v1.rb', line 72 def create_inventory_item(create_inventory_item_request_body) must_sandbox! path = "/fba/inventory/v1/items" body = create_inventory_item_request_body post(path, body:) end |
#delete_inventory_item(seller_sku, marketplace_id) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to Selling Partner API sandbox for more information.
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/peddler/apis/fba_inventory_v1.rb', line 89 def delete_inventory_item(seller_sku, marketplace_id) must_sandbox! path = "/fba/inventory/v1/items/#{seller_sku}" params = { "marketplaceId" => marketplace_id, }.compact delete(path, params:) end |
#get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil, rate_limit: 2.0) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to URL Encoding.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/peddler/apis/fba_inventory_v1.rb', line 48 def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil, rate_limit: 2.0) path = "/fba/inventory/v1/summaries" params = { "details" => details, "granularityType" => granularity_type, "granularityId" => granularity_id, "startDateTime" => start_date_time, "sellerSkus" => seller_skus, "sellerSku" => seller_sku, "nextToken" => next_token, "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).get(path, params:) end |