Class: Peddler::APIs::Orders20260101

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/orders_2026_01_01.rb,
lib/peddler/apis/orders_2026_01_01/alias.rb,
lib/peddler/apis/orders_2026_01_01/buyer.rb,
lib/peddler/apis/orders_2026_01_01/error.rb,
lib/peddler/apis/orders_2026_01_01/order.rb,
lib/peddler/apis/orders_2026_01_01/item_tax.rb,
lib/peddler/apis/orders_2026_01_01/order_tax.rb,
lib/peddler/apis/orders_2026_01_01/recipient.rb,
lib/peddler/apis/orders_2026_01_01/error_list.rb,
lib/peddler/apis/orders_2026_01_01/item_price.rb,
lib/peddler/apis/orders_2026_01_01/order_item.rb,
lib/peddler/apis/orders_2026_01_01/pagination.rb,
lib/peddler/apis/orders_2026_01_01/gift_option.rb,
lib/peddler/apis/orders_2026_01_01/hour_minute.rb,
lib/peddler/apis/orders_2026_01_01/measurement.rb,
lib/peddler/apis/orders_2026_01_01/time_window.rb,
lib/peddler/apis/orders_2026_01_01/item_expense.rb,
lib/peddler/apis/orders_2026_01_01/item_packing.rb,
lib/peddler/apis/orders_2026_01_01/item_picking.rb,
lib/peddler/apis/orders_2026_01_01/item_product.rb,
lib/peddler/apis/orders_2026_01_01/package_item.rb,
lib/peddler/apis/orders_2026_01_01/business_hour.rb,
lib/peddler/apis/orders_2026_01_01/item_proceeds.rb,
lib/peddler/apis/orders_2026_01_01/item_shipping.rb,
lib/peddler/apis/orders_2026_01_01/order_package.rb,
lib/peddler/apis/orders_2026_01_01/order_payment.rb,
lib/peddler/apis/orders_2026_01_01/sales_channel.rb,
lib/peddler/apis/orders_2026_01_01/exception_date.rb,
lib/peddler/apis/orders_2026_01_01/item_condition.rb,
lib/peddler/apis/orders_2026_01_01/item_promotion.rb,
lib/peddler/apis/orders_2026_01_01/order_proceeds.rb,
lib/peddler/apis/orders_2026_01_01/package_status.rb,
lib/peddler/apis/orders_2026_01_01/points_granted.rb,
lib/peddler/apis/orders_2026_01_01/date_time_range.rb,
lib/peddler/apis/orders_2026_01_01/associated_order.rb,
lib/peddler/apis/orders_2026_01_01/customer_address.rb,
lib/peddler/apis/orders_2026_01_01/item_fulfillment.rb,
lib/peddler/apis/orders_2026_01_01/item_points_cost.rb,
lib/peddler/apis/orders_2026_01_01/merchant_address.rb,
lib/peddler/apis/orders_2026_01_01/item_cancellation.rb,
lib/peddler/apis/orders_2026_01_01/order_fulfillment.rb,
lib/peddler/apis/orders_2026_01_01/payment_execution.rb,
lib/peddler/apis/orders_2026_01_01/get_order_response.rb,
lib/peddler/apis/orders_2026_01_01/item_customization.rb,
lib/peddler/apis/orders_2026_01_01/delivery_preference.rb,
lib/peddler/apis/orders_2026_01_01/item_tax_collection.rb,
lib/peddler/apis/orders_2026_01_01/order_tax_invoicing.rb,
lib/peddler/apis/orders_2026_01_01/associated_order_item.rb,
lib/peddler/apis/orders_2026_01_01/order_tax_registration.rb,
lib/peddler/apis/orders_2026_01_01/search_orders_response.rb,
lib/peddler/apis/orders_2026_01_01/address_extended_fields.rb,
lib/peddler/apis/orders_2026_01_01/item_proceeds_breakdown.rb,
lib/peddler/apis/orders_2026_01_01/preferred_delivery_time.rb,
lib/peddler/apis/orders_2026_01_01/item_promotion_breakdown.rb,
lib/peddler/apis/orders_2026_01_01/item_substitution_option.rb,
lib/peddler/apis/orders_2026_01_01/item_cancellation_request.rb,
lib/peddler/apis/orders_2026_01_01/item_shipping_constraints.rb,
lib/peddler/apis/orders_2026_01_01/serial_number_requirement.rb,
lib/peddler/apis/orders_2026_01_01/tax_registration_attribute.rb,
lib/peddler/apis/orders_2026_01_01/item_international_shipping.rb,
lib/peddler/apis/orders_2026_01_01/item_substitution_preference.rb,
lib/peddler/apis/orders_2026_01_01/item_tax_calculation_breakdown.rb,
lib/peddler/apis/orders_2026_01_01/item_proceeds_detailed_breakdown.rb,
sig/peddler/apis/orders_2026_01_01.rbs

Overview

The Selling Partner API for Orders

The Selling Partner API for Orders returns orders information. This API supports the following types of orders:

  • FBM (Fulfilled by Merchant) - FBA (Fulfilled by Amazon) - read only - Amazon Fresh

This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available.

Defined Under Namespace

Classes: AddressExtendedFields, Alias, AssociatedOrder, AssociatedOrderItem, BusinessHour, Buyer, CustomerAddress, DateTimeRange, DeliveryPreference, Error, ErrorList, ExceptionDate, GetOrderResponse, GiftOption, HourMinute, ItemCancellation, ItemCancellationRequest, ItemCondition, ItemCustomization, ItemExpense, ItemFulfillment, ItemInternationalShipping, ItemPacking, ItemPicking, ItemPointsCost, ItemPrice, ItemProceeds, ItemProceedsBreakdown, ItemProceedsDetailedBreakdown, ItemProduct, ItemPromotion, ItemPromotionBreakdown, ItemShipping, ItemShippingConstraints, ItemSubstitutionOption, ItemSubstitutionPreference, ItemTax, ItemTaxCalculationBreakdown, ItemTaxCollection, Measurement, MerchantAddress, Order, OrderFulfillment, OrderItem, OrderPackage, OrderPayment, OrderProceeds, OrderTax, OrderTaxInvoicing, OrderTaxRegistration, PackageItem, PackageStatus, Pagination, PaymentExecution, PointsGranted, PreferredDeliveryTime, Recipient, SalesChannel, SearchOrdersResponse, SerialNumberRequirement, TaxRegistrationAttribute, TimeWindow

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#get_order(order_id, included_data: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the order that you specify.

Parameters:

  • order_id (String)

    An Amazon-defined order identifier.

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

    A list of datasets to include in the response.

  • rate_limit (Float) (defaults to: 0.5)

    Requests per second

  • (String)
  • included_data: (Array[String], nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 0.5)

Returns:



85
86
87
88
89
90
91
92
# File 'lib/peddler/apis/orders_2026_01_01.rb', line 85

def get_order(order_id, included_data: nil, rate_limit: 0.5)
  path = "/orders/2026-01-01/orders/#{percent_encode(order_id)}"
  params = {
    "includedData" => stringify_array(included_data),
  }.compact
  parser = -> { GetOrderResponse }
  get(path, params:, rate_limit:, parser:)
end

#search_orders(created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, fulfillment_statuses: nil, marketplace_ids: nil, fulfilled_by: nil, max_results_per_page: nil, pagination_token: nil, included_data: nil, rate_limit: 0.0056) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns orders created or updated during the time period that you specify. You can filter the response for specific types of orders.

Parameters:

  • created_after (String) (defaults to: nil)

    The response includes orders created at or after this time. The date must be in ISO 8601 format. Note: You must provide exactly one of createdAfter and lastUpdatedAfter in your request. If createdAfter is provided, neither lastUpdatedAfter nor lastUpdatedBefore may be provided.

  • created_before (String) (defaults to: nil)

    The response includes orders created at or before this time. The date must be in ISO 8601 format. Note: If you include createdAfter in the request, createdBefore is optional, and if provided must be equal to or after the createdAfter date and at least two minutes before the time of the request. If createdBefore is provided, neither lastUpdatedAfter nor lastUpdatedBefore may be provided.

  • last_updated_after (String) (defaults to: nil)

    The response includes orders updated at or after this time. An update is any change made by Amazon or the seller, including changes to order status. The date must be in ISO 8601 format. Note: You must provide exactly one of createdAfter and lastUpdatedAfter. If lastUpdatedAfter is provided, neither createdAfter nor createdBefore may be provided.

  • last_updated_before (String) (defaults to: nil)

    The response includes orders updated at or before this time. An update is any change made by Amazon or the seller, including changes to order status. The date must be in ISO 8601 format. Note: If you include lastUpdatedAfter in the request, lastUpdatedBefore is optional, and if provided must be equal to or after the lastUpdatedAfter date and at least two minutes before the time of the request. If lastUpdatedBefore is provided, neither createdAfter nor createdBefore may be provided.

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

    A list of FulfillmentStatus values you can use to filter the results.

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

    The response includes orders that were placed in marketplaces you include in this list. Refer to Marketplace IDs for a complete list of marketplaceId values.

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

    The response includes orders that are fulfilled by the parties that you include in this list.

  • max_results_per_page (Integer) (defaults to: nil)

    The maximum number of orders that can be returned per page. The value must be between 1 and 100. Default: 100.

  • pagination_token (String) (defaults to: nil)

    Pagination occurs when a request produces a response that exceeds the maxResultsPerPage. This means that the response is divided into individual pages. To retrieve the next page, you must pass the nextToken value as the paginationToken query parameter in the next request. You will not receive a nextToken value on the last page.

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

    A list of datasets to include in the response.

  • rate_limit (Float) (defaults to: 0.0056)

    Requests per second

  • created_after: (String, nil) (defaults to: nil)
  • created_before: (String, nil) (defaults to: nil)
  • last_updated_after: (String, nil) (defaults to: nil)
  • last_updated_before: (String, nil) (defaults to: nil)
  • fulfillment_statuses: (Array[String], nil) (defaults to: nil)
  • marketplace_ids: (Array[String], nil) (defaults to: nil)
  • fulfilled_by: (Array[String], nil) (defaults to: nil)
  • max_results_per_page: (Integer, nil) (defaults to: nil)
  • pagination_token: (String, nil) (defaults to: nil)
  • included_data: (Array[String], nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 0.0056)

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/peddler/apis/orders_2026_01_01.rb', line 58

def search_orders(created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil,
  fulfillment_statuses: nil, marketplace_ids: nil, fulfilled_by: nil, max_results_per_page: nil,
  pagination_token: nil, included_data: nil, rate_limit: 0.0056)
  path = "/orders/2026-01-01/orders"
  params = {
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "lastUpdatedAfter" => last_updated_after,
    "lastUpdatedBefore" => last_updated_before,
    "fulfillmentStatuses" => stringify_array(fulfillment_statuses),
    "marketplaceIds" => stringify_array(marketplace_ids),
    "fulfilledBy" => stringify_array(fulfilled_by),
    "maxResultsPerPage" => max_results_per_page,
    "paginationToken" => pagination_token,
    "includedData" => stringify_array(included_data),
  }.compact
  parser = -> { SearchOrdersResponse }
  get(path, params:, rate_limit:, parser:)
end