Class: Peddler::APIs::FBAInboundEligibilityV1

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/fba_inbound_eligibility_v1.rb,
lib/peddler/apis/fba_inbound_eligibility_v1/error.rb,
lib/peddler/apis/fba_inbound_eligibility_v1/error_list.rb,
lib/peddler/apis/fba_inbound_eligibility_v1/item_eligibility_preview.rb,
lib/peddler/apis/fba_inbound_eligibility_v1/get_item_eligibility_preview_response.rb

Overview

Selling Partner API for FBA Inbound Eligibilty

With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers.

Defined Under Namespace

Classes: ErrorList

Constant Summary collapse

Error =

Error response returned when the request is unsuccessful.

Structure.new do
  # @return [String] An error code that identifies the type of error that occurred.
  attribute(:code, String)

  # @return [String] Additional information that can help the caller understand or fix the issue.
  attribute?(:details, String)

  # @return [String] A message that describes the error condition in a human-readable form.
  attribute?(:message, String)
end
ItemEligibilityPreview =

The response object which contains the ASIN, marketplaceId if required, eligibility program, the eligibility status (boolean), and a list of ineligibility reason codes.

Structure.new do
  # @return [String] The ASIN for which eligibility was determined.
  attribute(:asin, String)

  # @return [:boolean] Indicates if the item is eligible for the program.
  attribute(:eligible_for_program, :boolean, from: "isEligibleForProgram")

  # @return [String] The program for which eligibility was determined.
  attribute(:program, String)

  # @return [Array<String>] Potential Ineligibility Reason Codes.
  attribute?(:ineligibility_reason_list, [String], from: "ineligibilityReasonList")

  # @return [String] The marketplace for which eligibility was determined.
  attribute?(:marketplace_id, String, from: "marketplaceId")
end
GetItemEligibilityPreviewResponse =

The response schema for the getItemEligibilityPreview operation.

Structure.new do
  # @return [Array<Error>] An unexpected condition occurred during the GetItemEligibilityPreview operation.
  attribute?(:errors, [Error])

  # @return [ItemEligibilityPreview] The payload for the getItemEligibilityPreview operation.
  attribute?(:payload, ItemEligibilityPreview)
end

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?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#get_item_eligibility_preview(asin, program, marketplace_ids: nil, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item's eligibility.

eligibility. Required only when program=INBOUND.

Parameters:

  • marketplace_ids (Array<String>) (defaults to: nil)

    The identifier for the marketplace in which you want to determine

  • asin (String)

    The ASIN of the item for which you want an eligibility preview.

  • program (String)

    The program that you want to check eligibility against.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



28
29
30
31
32
33
34
35
36
37
# File 'lib/peddler/apis/fba_inbound_eligibility_v1.rb', line 28

def get_item_eligibility_preview(asin, program, marketplace_ids: nil, rate_limit: 1.0)
  path = "/fba/inbound/v1/eligibility/itemPreview"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
    "asin" => asin,
    "program" => program,
  }.compact
  parser = -> { GetItemEligibilityPreviewResponse }
  meter(rate_limit).get(path, params:, parser:)
end