Class: Peddler::APIs::ProductFeesV0
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::ProductFeesV0
- Defined in:
- lib/peddler/apis/product_fees_v0.rb,
lib/peddler/apis/product_fees_v0/error.rb,
lib/peddler/apis/product_fees_v0/points.rb,
lib/peddler/apis/product_fees_v0/error_list.rb,
lib/peddler/apis/product_fees_v0/fee_detail.rb,
lib/peddler/apis/product_fees_v0/fees_estimate.rb,
lib/peddler/apis/product_fees_v0/fee_detail_list.rb,
lib/peddler/apis/product_fees_v0/fees_estimate_error.rb,
lib/peddler/apis/product_fees_v0/included_fee_detail.rb,
lib/peddler/apis/product_fees_v0/fees_estimate_result.rb,
lib/peddler/apis/product_fees_v0/fees_estimate_request.rb,
lib/peddler/apis/product_fees_v0/price_to_estimate_fees.rb,
lib/peddler/apis/product_fees_v0/fees_estimate_identifier.rb,
lib/peddler/apis/product_fees_v0/included_fee_detail_list.rb,
lib/peddler/apis/product_fees_v0/fees_estimate_error_detail.rb,
lib/peddler/apis/product_fees_v0/fees_estimate_by_id_request.rb,
lib/peddler/apis/product_fees_v0/get_my_fees_estimate_result.rb,
lib/peddler/apis/product_fees_v0/get_my_fees_estimate_request.rb,
lib/peddler/apis/product_fees_v0/get_my_fees_estimate_response.rb,
lib/peddler/apis/product_fees_v0/get_my_fees_estimates_request.rb,
lib/peddler/apis/product_fees_v0/get_my_fees_estimates_response.rb,
lib/peddler/apis/product_fees_v0/get_my_fees_estimates_error_list.rb
Overview
Selling Partner API for Product Fees
The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing.
Defined Under Namespace
Classes: ErrorList, FeeDetailList, FeesEstimateErrorDetail, GetMyFeesEstimatesRequest, GetMyFeesEstimatesResponse, IncludedFeeDetailList
Constant Summary collapse
- Error =
An object representing an error that occurred during the API operation.
Structure.new do # @return [String] An error code that identifies the type of error that occurred. attribute(:code, String) # @return [String] A message that describes the error condition. attribute(:message, String) # @return [String] Additional details that can help the caller understand or fix the issue. attribute?(:details, String) end
- Points =
The number of Amazon Points offered with the purchase of an item.The Amazon Points program is only available in Japan.
Structure.new do # @return [Money] attribute?(:points_monetary_value, Money, from: "PointsMonetaryValue") # @return [Integer] The number of Amazon Points attribute?(:points_number, Integer, from: "PointsNumber") end
- FeeDetail =
The type of fee, fee amount, and other details.
Structure.new do # @return [Money] The amount charged for a given fee. attribute(:fee_amount, Money, from: "FeeAmount") # @return [String] The type of fee charged to a seller. attribute(:fee_type, String, from: "FeeType") # @return [Money] The final fee amount for a given fee. attribute(:final_fee, Money, from: "FinalFee") # @return [Money] The promotion amount for a given fee. attribute?(:fee_promotion, Money, from: "FeePromotion") # @return [Array<IncludedFeeDetail>] attribute?(:included_fee_detail_list, [IncludedFeeDetail], from: "IncludedFeeDetailList") # @return [Money] The tax amount for a given fee. attribute?(:tax_amount, Money, from: "TaxAmount") end
- FeesEstimate =
The total estimated fees for an item and a list of details.
Structure.new do # @return [Time] The time at which the fees were estimated. This defaults to the time the request is made. attribute(:time_of_fees_estimation, Time, from: "TimeOfFeesEstimation") # @return [Array<FeeDetail>] attribute?(:fee_detail_list, [FeeDetail], from: "FeeDetailList") # @return [Money] Total estimated fees for a given item, price, and fulfillment channel. attribute?(:total_fees_estimate, Money, from: "TotalFeesEstimate") end
- FeesEstimateError =
An unexpected error occurred during this operation.
Structure.new do # @return [String] An error code that identifies the type of error that occurred. attribute(:code, String, from: "Code") # @return [Array<Object>] attribute(:detail, Array, from: "Detail") # @return [String] A message that describes the error condition. attribute(:message, String, from: "Message") # @return [String] An error type, identifying either the receiver or the sender as the originator of the error. attribute(:type, String, from: "Type") end
- IncludedFeeDetail =
The type of fee, fee amount, and other details.
Structure.new do # @return [Money] The amount charged for a given fee. attribute(:fee_amount, Money, from: "FeeAmount") # @return [String] The type of fee charged to a seller. attribute(:fee_type, String, from: "FeeType") # @return [Money] The final fee amount for a given fee. attribute(:final_fee, Money, from: "FinalFee") # @return [Money] The promotion amount for a given fee. attribute?(:fee_promotion, Money, from: "FeePromotion") # @return [Money] The tax amount for a given fee. attribute?(:tax_amount, Money, from: "TaxAmount") end
- FeesEstimateResult =
An item identifier and the estimated fees for the item.
Structure.new do # @return [FeesEstimateError] An error object with a type, code, and message. attribute?(:error, FeesEstimateError, from: "Error") # @return [FeesEstimate] The total estimated fees for an item and a list of details. attribute?(:fees_estimate, FeesEstimate, from: "FeesEstimate") # @return [FeesEstimateIdentifier] Information used to identify a fees estimate request. attribute?(:fees_estimate_identifier, FeesEstimateIdentifier, from: "FeesEstimateIdentifier") # @return [String] The status of the fee request. Possible values: Success, ClientError, ServiceError. attribute?(:status, String, from: "Status") end
- FeesEstimateRequest =
A product, marketplace, and proposed price used to request estimated fees.
Structure.new do # @return [String] A unique identifier provided by the caller to track this request. attribute(:identifier, String, from: "Identifier") # @return [String] A marketplace identifier. attribute(:marketplace_id, String, from: "MarketplaceId") # @return [PriceToEstimateFees] The product price that the fee estimate is based on. attribute(:price_to_estimate_fees, PriceToEstimateFees, from: "PriceToEstimateFees") # @return [:boolean] When true, the offer is fulfilled by Amazon. attribute?(:amazon_fulfilled, :boolean, from: "IsAmazonFulfilled") # @return [String] attribute?(:optional_fulfillment_program, String, from: "OptionalFulfillmentProgram") end
- PriceToEstimateFees =
Price information for an item, used to estimate fees.
Structure.new do # @return [Money] The price of the item. attribute(:listing_price, Money, from: "ListingPrice") # @return [Points] The number of Amazon Points offered with the purchase of an item. attribute?(:points, Points, from: "Points") # @return [Money] The shipping cost. attribute?(:shipping, Money, from: "Shipping") end
- FeesEstimateIdentifier =
An item identifier, marketplace, time of request, and other details that identify an estimate.
Structure.new do # @return [String] attribute?(:id_type, String, from: "IdType") # @return [String] The item identifier. attribute?(:id_value, String, from: "IdValue") # @return [:boolean] When true, the offer is fulfilled by Amazon. attribute?(:amazon_fulfilled, :boolean, from: "IsAmazonFulfilled") # @return [String] A marketplace identifier. attribute?(:marketplace_id, String, from: "MarketplaceId") # @return [String] attribute?(:optional_fulfillment_program, String, from: "OptionalFulfillmentProgram") # @return [PriceToEstimateFees] The item price on which the fee estimate is based. attribute?(:price_to_estimate_fees, PriceToEstimateFees, from: "PriceToEstimateFees") # @return [String] The seller identifier. attribute?(:seller_id, String, from: "SellerId") # @return [String] A unique identifier provided by the caller to track this request. attribute?(:seller_input_identifier, String, from: "SellerInputIdentifier") end
- FeesEstimateByIdRequest =
A product, marketplace, and proposed price used to request estimated fees.
Structure.new do # @return [String] attribute(:id_type, String, from: "IdType") # @return [String] The item identifier. attribute(:id_value, String, from: "IdValue") # @return [FeesEstimateRequest] attribute?(:fees_estimate_request, FeesEstimateRequest, from: "FeesEstimateRequest") end
- GetMyFeesEstimateResult =
Response schema.
Structure.new do # @return [FeesEstimateResult] The item's estimated fees. attribute?(:fees_estimate_result, FeesEstimateResult, from: "FeesEstimateResult") end
- GetMyFeesEstimateRequest =
Request schema.
Structure.new do # @return [FeesEstimateRequest] attribute?(:fees_estimate_request, FeesEstimateRequest, from: "FeesEstimateRequest") end
- GetMyFeesEstimateResponse =
The response object for the GetMyFeesEstimate operation.
Structure.new do # @return [Array<Error>] A list of errors that may have occurred during the GetMyFeesEstimate operation. attribute?(:errors, [Error]) # @return [GetMyFeesEstimateResult] The payload for the operation. attribute?(:payload, GetMyFeesEstimateResult) end
- GetMyFeesEstimatesErrorList =
A list of error responses returned when a request is unsuccessful.
Structure.new do # @return [Array<Error>] A list of error responses returned when a request is unsuccessful. attribute(:errors, [Error]) end
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #retries
Instance Method Summary collapse
-
#get_my_fees_estimate_for_asin(body, asin, rate_limit: 1.0) ⇒ Peddler::Response
Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body.
-
#get_my_fees_estimate_for_sku(body, seller_sku, rate_limit: 1.0) ⇒ Peddler::Response
Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body.
-
#get_my_fees_estimates(body, rate_limit: 0.5) ⇒ Peddler::Response
Returns the estimated fees for a list of products.
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_my_fees_estimate_for_asin(body, asin, rate_limit: 1.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body.
You can call getMyFeesEstimateForASIN
for an item on behalf of a selling partner before the selling partner
sets the item's price. The selling partner can then take estimated fees into account. Each fees request must
include an original identifier. This identifier is included in the fees estimate so you can correlate a fees
estimate with the original request.
Note: This identifier value is used to identify an estimate. Actual costs may vary. Search "fees" in Seller Central and consult the store-specific fee schedule for the most up-to-date information.
Note: When using the getMyFeesEstimateForASIN
operation with an ASIN, the fee estimates might be
different. This is because these estimates use the item's catalog size, which might not always match the actual
size of the item sent to Amazon.
66 67 68 69 70 |
# File 'lib/peddler/apis/product_fees_v0.rb', line 66 def get_my_fees_estimate_for_asin(body, asin, rate_limit: 1.0) path = "/products/fees/v0/items/#{percent_encode(asin)}/feesEstimate" parser = -> { GetMyFeesEstimateResponse } meter(rate_limit).post(path, body:, parser:) end |
#get_my_fees_estimate_for_sku(body, seller_sku, rate_limit: 1.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body.
Note: The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to URL Encoding.
You can call getMyFeesEstimateForSKU
for an item on behalf of a selling partner before the selling partner
sets the item's price. The selling partner can then take any estimated fees into account. Each fees estimate
request must include an original identifier. This identifier is included in the fees estimate so that you can
correlate a fees estimate with the original request.
Note: This identifier value is used to identify an estimate. Actual costs may vary. Search "fees" in Seller Central and consult the store-specific fee schedule for the most up-to-date information.
Note: When sellers use the getMyFeesEstimateForSKU
operation with their SellerSKU
, they get accurate
fees based on real item measurements, but only after they've sent their items to Amazon.
seller's SellerId, which is included with every operation that you submit.
39 40 41 42 43 |
# File 'lib/peddler/apis/product_fees_v0.rb', line 39 def get_my_fees_estimate_for_sku(body, seller_sku, rate_limit: 1.0) path = "/products/fees/v0/listings/#{percent_encode(seller_sku)}/feesEstimate" parser = -> { GetMyFeesEstimateResponse } meter(rate_limit).post(path, body:, parser:) end |
#get_my_fees_estimates(body, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns the estimated fees for a list of products.
78 79 80 81 82 |
# File 'lib/peddler/apis/product_fees_v0.rb', line 78 def get_my_fees_estimates(body, rate_limit: 0.5) path = "/products/fees/v0/feesEstimate" parser = -> { GetMyFeesEstimatesResponse } meter(rate_limit).post(path, body:, parser:) end |