Skip to content

Commit

Permalink
Regenerate APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanensari committed Sep 15, 2024
1 parent a6375ca commit ac5edbd
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 47 deletions.
6 changes: 5 additions & 1 deletion lib/peddler/api/fulfillment_outbound_2020_07_01.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,16 @@ def get_features(marketplace_id)
# @param [String] feature_name The name of the feature for which to return a list of eligible inventory.
# @param [String] next_token A string token returned in the response to your previous request that is used to
# return the next response page. A value of null will return the first page.
# @param [String] query_start_date A date that you can use to select inventory that has been updated since a
# specified date. An update is defined as any change in feature-enabled inventory availability. The date must be
# in the format yyyy-MM-ddTHH:mm:ss.sssZ
# @return [Hash] The API response
def get_feature_inventory(marketplace_id, feature_name, next_token: nil)
def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_start_date: nil)
path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}"
params = {
"marketplaceId" => marketplace_id,
"nextToken" => next_token,
"queryStartDate" => query_start_date,
}.compact

rate_limit(2.0).get(path, params:)
Expand Down
32 changes: 32 additions & 0 deletions lib/peddler/api/listings_items_2021_08_01.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,38 @@ def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: nil,

rate_limit(5.0).put(path, body:, params:)
end

# Search for and return list of listings items and respective details for a selling partner.
#
# @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
# @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
# @param [Array<String>] identifiers A comma-delimited list of product identifiers to search for listings items
# by. **Note**: 1. Required when `identifiersType` is provided.
# @param [String] identifiers_type Type of product identifiers to search for listings items by. **Note**: 1.
# Required when `identifiers` is provided.
# @param [Integer] page_size Number of results to be returned per page.
# @param [String] page_token A token to fetch a certain page when there are multiple pages worth of results.
# @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
# summaries.
# @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
# of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
# when a localization is not available in the specified locale.
# @return [Hash] The API response
def search_listings_items(seller_id, marketplace_ids, identifiers: nil, identifiers_type: nil, page_size: nil,
page_token: nil, included_data: nil, issue_locale: nil)
path = "/listings/2021-08-01/items/#{seller_id}"
params = {
"marketplaceIds" => marketplace_ids,
"identifiers" => identifiers,
"identifiersType" => identifiers_type,
"pageSize" => page_size,
"pageToken" => page_token,
"includedData" => included_data,
"issueLocale" => issue_locale,
}.compact

rate_limit(5.0).get(path, params:)
end
end
end
end
101 changes: 55 additions & 46 deletions lib/peddler/api/orders_v0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ module Peddler
class API
# Selling Partner API for Orders
#
# The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you
# develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based
# decision support tools. The Orders API supports orders that are two years old or less. Orders more than two years
# old will not show in the API response. **Note:** The Orders API supports orders from 2016 and after for the JP,
# AU, and SG marketplaces.
# Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop
# fast, flexible, and custom applications to manage order synchronization, perform order research, and create
# demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders
# from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older
# than this don't show up in the response).
class OrdersV0 < API
# Returns orders created or updated during the time frame indicated by the specified parameters. You can also
# apply a range of filtering criteria to narrow the list of orders returned. If NextToken is present, that will be
# used to retrieve the orders instead of other criteria.
# Returns orders that are created or updated during the specified time period. If you want to return specific
# types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include
# in your request; it only impacts the pagination for the filtered orders response.
#
# @param [String] created_after A date used for selecting orders created after (or at) a specified time. Only
# orders placed after the specified time are returned. The date must be in [ISO
# @param [String] created_after Use this date to select orders created after (or at) a specified time. Only orders
# placed after the specified time are returned. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter`
# parameter or the `LastUpdatedAfter` parameter is required. You could specify `CreatedBefore` but not provide
# `LastUpdatedAfter` or `LastUpdatedBefore` when `CreatedAfter` is specified.
# @param [String] created_before A date used for selecting orders created before (or at) a specified time. Only
# parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `LastUpdatedAfter` and
# `LastUpdatedBefore` cannot be set when `CreatedAfter` is set.
# @param [String] created_before Use this date to select orders created before (or at) a specified time. Only
# orders placed before the specified time are returned. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `CreatedBefore` is optional
# when `CreatedAfter` is specified. But if specified, `CreatedBefore` should be equal to or after the
# `CreatedAfter` date and at least 2 minutes before the current time.
# @param [String] last_updated_after A date used for selecting orders that were last updated before (or at) a
# when `CreatedAfter` is set. If specified, `CreatedBefore` must be equal to or after the `CreatedAfter` date
# and at least two minutes before current time.
# @param [String] last_updated_after Use this date to select orders that were last updated after (or at) a
# specified time. An update is defined as any change in order status, including the creation of a new order.
# Includes updates made by Amazon and by the seller. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `LastUpdatedBefore` is
# optional when `LastUpdatedAfter` is specified. But if specified, `LastUpdatedBefore` should be equal to or
# after the `LastUpdatedAfter` date and at least 2 minutes before current time.
# @param [String] last_updated_before A date used for selecting orders that were last updated before (or at) a
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter`
# parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `CreatedAfter` or
# `CreatedBefore` cannot be set when `LastUpdatedAfter` is set.
# @param [String] last_updated_before Use this date to select orders that were last updated before (or at) a
# specified time. An update is defined as any change in order status, including the creation of a new order.
# Includes updates made by Amazon and by the seller. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: LastUpdatedBefore is optional
# when LastUpdatedAfter is set. But if specified, LastUpdatedBefore should be equal to or after the
# LastUpdatedAfter date and at least 2 minutes before current time.
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `LastUpdatedBefore` is
# optional when `LastUpdatedAfter` is set. But if specified, `LastUpdatedBefore` must be equal to or after the
# `LastUpdatedAfter` date and at least two minutes before current time.
# @param [Array<String>] order_statuses A list of `OrderStatus` values used to filter the results. **Possible
# values:** - `PendingAvailability` (This status is available for pre-orders only. The order has been placed,
# payment has not been authorized, and the release date of the item is in the future.) - `Pending` (The order
Expand All @@ -49,19 +49,18 @@ class OrdersV0 < API
# `Unfulfillable` (The order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.)
# @param [Array<String>] marketplace_ids A list of `MarketplaceId` values. Used to select orders that were placed
# in the specified marketplaces. Refer to [Marketplace
# IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `MarketplaceId`
# IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId`
# values.
# @param [Array<String>] fulfillment_channels A list that indicates how an order was fulfilled. Filters the
# results by fulfillment channel. **Possible values**: `AFN` (Fulfillment by Amazon); `MFN` (Fulfilled by the
# seller).
# @param [Array<String>] payment_methods A list of payment method values. Used to select orders paid using the
# specified payment methods. **Possible values**: `COD` (Cash on delivery); `CVS` (Convenience store payment);
# `Other` (Any payment method other than `COD` or `CVS`).
# results by fulfillment channel. **Possible values**: `AFN` (fulfilled by Amazon), `MFN` (fulfilled by seller).
# @param [Array<String>] payment_methods A list of payment method values. Use this field to select orders that
# were paid with the specified payment methods. **Possible values**: `COD` (cash on delivery), `CVS`
# (convenience store), `Other` (Any payment method other than COD or CVS).
# @param [String] buyer_email The email address of a buyer. Used to select orders that contain the specified email
# address.
# @param [String] seller_order_id An order identifier that is specified by the seller. Used to select only the
# orders that match the order identifier. If SellerOrderId is specified, then FulfillmentChannels,
# OrderStatuses, PaymentMethod, LastUpdatedAfter, LastUpdatedBefore, and BuyerEmail cannot be specified.
# orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`,
# `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, LastUpdatedBefore, and `BuyerEmail` cannot be specified.
# @param [Integer] max_results_per_page A number that indicates the maximum number of orders that can be returned
# per page. Value must be 1 - 100. Default 100.
# @param [Array<String>] easy_ship_shipment_statuses A list of `EasyShipShipmentStatus` values. Used to select
Expand All @@ -84,25 +83,25 @@ class OrdersV0 < API
# `Errored` (The last submitted electronic invoice was rejected for this order.) - `Accepted` (The last
# submitted electronic invoice was submitted and accepted.)
# @param [String] next_token A string token returned in the response of your previous request.
# @param [Array<String>] amazon_order_ids A list of AmazonOrderId values. An AmazonOrderId is an Amazon-defined
# order identifier, in 3-7-7 format.
# @param [String] actual_fulfillment_supply_source_id Denotes the recommended sourceId where the order should be
# fulfilled from.
# @param [Array<String>] amazon_order_ids A list of `AmazonOrderId` values. An `AmazonOrderId` is an
# Amazon-defined order identifier, in 3-7-7 format.
# @param [String] actual_fulfillment_supply_source_id The `sourceId` of the location from where you want the order
# fulfilled.
# @param [Boolean] is_ispu When true, this order is marked to be picked up from a store rather than delivered.
# @param [String] store_chain_store_id The store chain store identifier. Linked to a specific store in a store
# chain.
# @param [String] earliest_delivery_date_before A date used for selecting orders with a earliest delivery date
# @param [String] earliest_delivery_date_before Use this date to select orders with a earliest delivery date
# before (or at) a specified time. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
# @param [String] earliest_delivery_date_after A date used for selecting orders with a earliest delivery date
# after (or at) a specified time. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
# @param [String] latest_delivery_date_before A date used for selecting orders with a latest delivery date before
# @param [String] earliest_delivery_date_after Use this date to select orders with a earliest delivery date after
# (or at) a specified time. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
# @param [String] latest_delivery_date_after A date used for selecting orders with a latest delivery date after
# @param [String] latest_delivery_date_before Use this date to select orders with a latest delivery date before
# (or at) a specified time. The date must be in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
# @param [String] latest_delivery_date_after Use this date to select orders with a latest delivery date after (or
# at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
# format.
# @return [Hash] The API response
def get_orders(
marketplace_ids, created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil,
Expand Down Expand Up @@ -171,12 +170,22 @@ def get_order_address(order_id)
rate_limit(0.5).get(path)
end

# Returns the fulfillment instructions for the order that you specify.
#
# @param [String] order_id An Amazon-defined order identifier, in 3-7-7 format.
# @return [Hash] The API response
def get_order_fulfillment_instructions(order_id)
path = "/orders/v0/orders/#{order_id}/fulfillmentInstructions"

rate_limit(0.5).get(path)
end

# Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to
# retrieve the next page of order items. **Note**: When an order is in the Pending state (the order has been
# placed but payment has not been authorized), the `getOrderItems` operation does not return information about
# retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been
# placed but payment has not been authorized), the getOrderItems operation does not return information about
# pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order
# leaves the Pending state (this occurs when payment has been authorized) and enters the `Unshipped`, `Partially
# Shipped`, or `Shipped` state, the `getOrderItems` operation returns information about pricing, taxes, shipping
# leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially
# Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping
# charges, gift status and promotions for the order items in the order.
#
# @param [String] order_id An Amazon-defined order identifier, in 3-7-7 format.
Expand Down Expand Up @@ -242,7 +251,7 @@ def update_verification_status(order_id, payload)
# Updates the shipment confirmation status for a specified order.
#
# @param [String] order_id An Amazon-defined order identifier, in 3-7-7 format.
# @param [Hash] payload The request body of the `confirmShipment` operation.
# @param [Hash] payload Request body of `confirmShipment`.
# @return [Hash] The API response
def confirm_shipment(order_id, payload)
path = "/orders/v0/orders/#{order_id}/shipmentConfirmation"
Expand Down

0 comments on commit ac5edbd

Please sign in to comment.