Class: Peddler::APIs::ExternalFulfillmentShipments20240911

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/tax.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/error.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/amount.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/charge.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/weight.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/address.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/charges.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/document.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/packages.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/dimension.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/line_item.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/error_list.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/pagination.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/document_v2.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/time_window.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/cancellation.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/invoice_info.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/cancellations.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment_info.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipping_info.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/charge_breakup.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/gift_attributes.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/custom_attribute.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/invoice_response.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipping_options.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package_line_item.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/ship_labels_input.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/original_line_item.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package_dimensions.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package_line_items.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package_ship_label.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment_line_item.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipments_response.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/invoice_requirement.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/original_line_items.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/recommended_package.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/ship_label_metadata.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/recommended_packages.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/ship_labels_response.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/compliance_attributes.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/line_item_with_reason.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment_requirements.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/tax_registration_info.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/marketplace_attributes.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/replaced_shipment_info.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package_delivery_status.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/package_ship_label_list.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/custom_channel_attribute.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/packing_slip_requirement.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/party_identification_info.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipping_options_response.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/courier_supported_attributes.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/recommended_package_line_item.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/party_identification_info_list.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/recommended_package_line_items.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment_acknowledgement_request.rb

Overview

The Selling Partner API for Amazon External Fulfillment Shipments Processing

You can use the External Fulfillment Shipments API to retrieve, manage, and track shipments processed through Amazon's external fulfillment network. Use this API to get shipment details, monitor status changes, and access fulfillment requirements.

Defined Under Namespace

Classes: Cancellations, Charges, CustomChannelAttribute, OriginalLineItems, PackageLineItems, PackageShipLabelList, PartyIdentificationInfoList, RecommendedPackageLineItems, RecommendedPackages

Constant Summary collapse

Tax =

Information about taxes.

Structure.new do
  # @return [ChargeBreakup] Details of individual tax charges.
  attribute(:charge, ChargeBreakup)

  # @return [String] The rate of the tax.
  attribute?(:rate, String)

  # @return [String] The type of tax.
  attribute?(:type, String)
end
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] 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
Amount =

An amount of money, including units in the form of currency.

Structure.new do
  # @return [String] Three digit currency code in ISO 4217 format.
  attribute(:currency_code, String, from: "currencyCode")

  # @return [String] The amount of money.
  attribute(:value, String)
end
Charge =

A shipment's charge with relevant tax information.

Structure.new do
  # @return [ChargeBreakup] The charge value before taxes.
  attribute(:base_charge, ChargeBreakup, from: "baseCharge")

  # @return [String] The type of charge.
  attribute(:charge_type, String, from: "chargeType")

  # @return [ChargeBreakup] The total charge, including the base charge and taxes.
  attribute(:total_charge, ChargeBreakup, from: "totalCharge")

  # @return [Tax] The sum of all taxes.
  attribute(:total_tax, Tax, from: "totalTax")

  # @return [Array<Tax>] The tax charge details.
  attribute?(:tax_breakup, [Tax], from: "taxBreakup")
end
Weight =

The weight of a package.

Structure.new do
  # @return [String] The numerical value of the weight. Must be a positive value.
  attribute(:value, String)

  # @return [String] The unit of measurement of the weight.
  attribute(:weight_unit, String, from: "weightUnit")
end
Address =

The address.

Structure.new do
  # @return [String] The postal code of the address. It contains a series of letters or digits or both, sometimes
  # including spaces or punctuation.
  attribute(:postal_code, String, from: "postalCode")

  # @return [String] The first line of the address.
  attribute?(:address_line1, String, from: "addressLine1")

  # @return [String] Additional address information, if required.
  attribute?(:address_line2, String, from: "addressLine2")

  # @return [String] Additional address information, if required.
  attribute?(:address_line3, String, from: "addressLine3")

  # @return [String] The type of address.
  attribute?(:address_type, String, from: "addressType")

  # @return [String] The city where the person, business, or institution is located.
  attribute?(:city, String)

  # @return [Array<String>] The email cc addresses of the contact associated with the address.
  attribute?(:copy_emails, [String], from: "copyEmails")

  # @return [String] The two digit country code. In ISO 3166-1 alpha-2 format.
  attribute?(:country_code, String, from: "countryCode")

  # @return [String] The district or state where the person, business, or institution is located.
  attribute?(:district, String)

  # @return [String] The email address of the contact associated with the address.
  attribute?(:email, String)

  # @return [String] The municiplaity where the person, business, or institution is located.
  attribute?(:municipality, String)

  # @return [String] The name of the person, business or institution at that address.
  attribute?(:name, String)

  # @return [String] The phone number of the person, business, or institution located at the address.
  attribute?(:phone_number, String, from: "phoneNumber")

  # @return [String] The state or region where the person, business, or institution is located.
  attribute?(:state, String)
end
Package =

A package that is created to ship one or more of a shipment's line items.

Structure.new do
  # @return [PackageDimensions] The dimensions of the package.
  attribute(:dimensions, PackageDimensions)

  # @return [String] An ID that uniquely identifies a package within a shipment.
  attribute(:id, String)

  # @return [Array<PackageLineItem>] The list of line items in a package.
  attribute(:package_line_items, [PackageLineItem], from: "packageLineItems")

  # @return [Weight] The weight of the package. The package must weigh at least 5 grams.
  attribute(:weight, Weight)

  # @return [Array<String>] The optional list of HAZMAT labels applied to the package.
  attribute?(:hazmat_labels, [String], from: "hazmatLabels")

  # @return [String] Whether the package requires standard handling or extra care.
  attribute?(:package_handling_requirements, String, from: "packageHandlingRequirements")

  # @return [String] The current status of the package.
  attribute?(:status, String)
end
Document =

A document, described by its file type and data.

Structure.new do
  # @return [String] Base 64 encoded file contents.
  attribute?(:content, String)

  # @return [String] The type of the file.
  attribute?(:format, String)
end
Packages =

The request schema of the createPackages operation.

Structure.new do
  # @return [Array<Package>] A list of packages.
  attribute(:packages, [Package])
end
Shipment =

Information about a shipment.

Structure.new do
  # @return [Array<Charge>] The charges associated with the shipment. The charge amount does not include the tax
  # amount.
  attribute(:charges, [Charge])

  # @return [String] The date and time when the shipment was created.
  attribute(:creation_date_time, String, from: "creationDateTime")

  # @return [String] The shipment's ID.
  attribute(:id, String)

  # @return [String] The date and time when the shipment was last updated.
  attribute(:last_updated_date_time, String, from: "lastUpdatedDateTime")

  # @return [Array<ShipmentLineItem>] The line items in the shipment.
  attribute(:line_items, [ShipmentLineItem], from: "lineItems")

  # @return [String] The location identifier of the seller's location in the marketplace channel to which the
  # shipment has been created for fulfillment.
  attribute(:location_id, String, from: "locationId")

  # @return [MarketplaceAttributes] The marketplace attributes from which the shipment has been created for
  # fulfillment.
  attribute(:marketplace_attributes, MarketplaceAttributes, from: "marketplaceAttributes")

  # @return [ShipmentInfo] High-level details of the shipment.
  attribute(:shipment_info, ShipmentInfo, from: "shipmentInfo")

  # @return [ShipmentRequirements] Whether a specific capabilities are enabled/required for the shipment.
  attribute(:shipment_requirements, ShipmentRequirements, from: "shipmentRequirements")

  # @return [ShippingInfo] Shipping information for the packages in this shipment.
  attribute(:shipping_info, ShippingInfo, from: "shippingInfo")

  # @return [String] The current status of the shipment.
  attribute(:status, String)

  # @return [String] The time when the shipment becomes eligible for processing.
  attribute?(:earliest_pack_date_time, String, from: "earliestPackDateTime")

  # @return [InvoiceInfo] Information about the shipment's invoice.
  attribute?(:invoice_info, InvoiceInfo, from: "invoiceInfo")

  # @return [Array<Package>] The list of packages in the shipment.
  attribute?(:packages, [Package])

  # @return [Array<PartyIdentificationInfo>] All involved party identification and metadata for vendor, buyer,
  # seller. Applicable for direct-fulfillment sellers.
  attribute?(:party_info_list, [PartyIdentificationInfo], from: "partyInfoList")

  # @return [String] The sub status of the shipment.
  attribute?(:sub_status, String, from: "subStatus")
end
Dimension =

A dimension of a package.

Structure.new do
  # @return [String] The unit of measurement of the dimension.
  attribute(:dimension_unit, String, from: "dimensionUnit")

  # @return [String] The numerical value of the dimension. Must be a positive value.
  attribute(:value, String)
end
LineItem =

Information about the line item being confirmed or rejected.

Structure.new do
  # @return [String] The identifier of the line item from the shipment that is being confirmed or rejected by the
  # seller.
  attribute(:id, String)

  # @return [Integer] The quantity of the line item.
  attribute?(:quantity, Integer)
end
ErrorList =

An object containing 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
Pagination =

An object representing data required for pagination of results.

Structure.new do
  # @return [String] A token that you use to retrieve the next page of results. The response includes `nextToken`
  # when there are multiple pages of results. To get the next page of results, call the operation with this token
  # and include the same arguments as the call that produced the token. To get a complete list, call this
  # operation until `nextToken` is null. Note that this operation can return empty pages.
  attribute?(:next_token, String, from: "nextToken")
end
DocumentV2 =

An S3-Presigned URL you can use to retrieve file contents.

Structure.new do
  # @return [String] A presigned URL to fetch the ship label file using an HTTP GET request. To determine file
  # type, use the `contentType` header of the file response. The file retrieved will be in one of the following
  # supported formats:
  #
  # - **ZPL**: `x.application/zpl`
  # - **PDF**: `application/pdf`
  # - **PNG**: `image/png`
  # - **Plain Text**: `text/plain`
  attribute(:url, String)
end
TimeWindow =

Time duration used to specify the interval of an event, such as pick up and delivery.

Structure.new do
  # @return [Integer] The end time of the window.
  attribute(:end_time, Integer, from: "endTime")

  # @return [Integer] The start time of the window.
  attribute(:start_time, Integer, from: "startTime")

  # @return [String] Whether the seller picks up from Amazon Logistics or drops off to Amazon Logistics.
  attribute?(:handover_method, String, from: "handoverMethod")
end
Cancellation =

A shipment item's cancellation details.

Structure.new do
  # @return [String] The type of cancellation of the item in the shipment.
  attribute(:cancellation_type, String, from: "cancellationType")

  # @return [Integer] The number of items of this particular item which have been cancelled.
  attribute(:cancelled_quantity, Integer, from: "cancelledQuantity")

  # @return [String] The UNIX timestamp of when the line item was cancelled.
  attribute(:cancelled_timestamp, String, from: "cancelledTimestamp")

  # @return [String] The reason for the cancellation of the shipment.
  attribute?(:cancellation_reason, String, from: "cancellationReason")
end
InvoiceInfo =

Information about the shipment's invoice.

Structure.new do
  # @return [String] When the invoice was created.
  attribute(:creation_date_time, String, from: "creationDateTime")

  # @return [String] The unique ID of the invoice that corresponds to the shipment.
  attribute(:invoice_id, String, from: "invoiceId")
end
ShipmentInfo =

High-level details of the shipment.

Structure.new do
  # @return [String] The buyer's order ID.
  attribute(:buyer_order_id, String, from: "buyerOrderId")

  # @return [Integer] Total number of units in the shipment.
  attribute(:number_of_units, Integer, from: "numberOfUnits")

  # @return [String] The priority of the order.
  attribute(:priority, String)

  # @return [String] The type of shipment.
  attribute(:shipment_type, String, from: "shipmentType")

  # @return [String] The timestamp of when the order was placed, in UTC
  attribute?(:order_placed_timestamp, String, from: "orderPlacedTimestamp")

  # @return [Array<String>] A list of order statuses for which the marketplace allows order rejection (seller
  # cancellation). If the order has a status that does not belong to this list, then seller cancellation is not
  # possible.
  attribute?(:order_states_eligible_for_rejection, [String], from: "orderStatesEligibleForRejection")

  # @return [ReplacedShipmentInfo] This field contains details of the original shipment if `shipmentType` is
  # either `REPLACEMENT` or `EXCHANGE`.
  attribute?(:original_shipment_info, ReplacedShipmentInfo, from: "originalShipmentInfo")

  # @return [String] The source of the order operation.
  attribute?(:processing_source, String, from: "processingSource")
end
ShippingInfo =

Shipping information for the packages in a shipment.

Structure.new do
  # @return [String] The date and time when Amazon expects the seller to ship the packages.
  attribute(:expected_shipping_date_time_in_utc, String, from: "expectedShippingDateTimeInUTC")

  # @return [Array<RecommendedPackage>]
  attribute?(:recommended_packages, [RecommendedPackage], from: "recommendedPackages")

  # @return [String] The ship method recommended by the Amazon Fulfillment Network for the packages in this
  # shipment.
  attribute?(:recommended_ship_method, String, from: "recommendedShipMethod")

  # @return [Address] The address to which the packages must be shipped. Provide only basic information about the
  # buyer's address needed for taxation purposes.
  attribute?(:ship_to_address, Address, from: "shipToAddress")

  # @return [String] The type of shipping that the seller uses to deliver a customer order.
  attribute?(:shipping_type, String, from: "shippingType")
end
ChargeBreakup =

The composition of the charge.

Structure.new do
  # @return [Amount] The base amount charged.
  attribute(:base_amount, Amount, from: "baseAmount")

  # @return [Amount] The offer or coupon amount.
  attribute(:discount_amount, Amount, from: "discountAmount")

  # @return [Amount] The total amount after discount.
  attribute(:net_amount, Amount, from: "netAmount")
end
GiftAttributes =

Information about any gift wrapping that is needed for this line item.

Structure.new do
  # @return [String] When true, there is a gift message that must be printed on the wrapped gift.
  attribute(:gift_message_presence, String, from: "giftMessagePresence")

  # @return [String] When true, the line item must be gift wrapped.
  attribute(:gift_wrap_requirement, String, from: "giftWrapRequirement")

  # @return [Document] The gift message that is to be printed on the wrapped gift.
  attribute?(:gift_message, Document, from: "giftMessage")

  # @return [String] The label to be printed on the wrapped gift.
  attribute?(:gift_wrap_label, String, from: "giftWrapLabel")
end
CustomAttribute =

A custom attribute that is loosely typed, modeled through a key-value pair and its data type.

Structure.new do
  # @return [String] The key of the custom attribute. Must be unique.
  attribute?(:key, String)

  # @return [String]
  attribute?(:type, String)

  # @return [String] The value of the custom attribute.
  attribute?(:value, String)
end
InvoiceResponse =

The response of the generateInvoice operation.

Structure.new do
  # @return [Document] The invoice.
  attribute(:document, Document)
end
ShippingOptions =

Shipping options for a single package.

Structure.new do
  # @return [String] The shipper type.
  attribute(:ship_by, String, from: "shipBy")

  # @return [String] An identifier for the shipping option.
  attribute(:shipping_option_id, String, from: "shippingOptionId")

  # @return [String] The carrier name for the offering.
  attribute?(:carrier_name, String, from: "carrierName")

  # @return [TimeWindow] The time window during which the package will be picked up.
  attribute?(:pickup_window, TimeWindow, from: "pickupWindow")

  # @return [TimeWindow] A time window to hand over the package to or from Amazon Logistics.
  attribute?(:time_slot, TimeWindow, from: "timeSlot")
end
PackageLineItem =

A line item in a package.

Structure.new do
  # @return [String] The line item ID.
  attribute(:package_line_item_id, String, from: "packageLineItemId")

  # @return [Integer] The number of items of a particular line item of a shipment that are packed into the
  # package.
  attribute(:quantity, Integer)

  # @return [String] The country of origin provided by the seller, represented by a two-letter country code in
  # ISO-3166 alpha-2 format. You must pass this field when `countryOfOriginRequirement` is `REQUIRED` in the
  # `getShipment` or `getShipments` response.
  attribute?(:country_of_origin, String, from: "countryOfOrigin")

  # @return [Amount] The value of the item being shipped, as provided by the seller. This serves as the basis for
  # import duty/tax calculations. You must pass this field when `itemValueRequirement` is `REQUIRED` in the
  # `getShipment` or `getShipments` response.
  attribute?(:item_value, Amount, from: "itemValue")

  # @return [Integer] The number of pieces of a multi-piece item that are in this package. This is applicable only
  # for items that are shipped in multiple pieces.
  attribute?(:pieces, Integer)

  # @return [Array<SerialNumber>] The list of serial numbers of items in the package, if required to be provided.
  attribute?(:serial_numbers, Array, from: "serialNumbers")
end
ShipLabelsInput =

Tracking details for multiple packages.

Structure.new do
  # @return [Array<String>] The subset of package IDs used to generate a label.
  attribute(:package_ids, [String], from: "packageIds")

  # @return [CourierSupportedAttributes]
  attribute?(:courier_supported_attributes, CourierSupportedAttributes, from: "courierSupportedAttributes")
end
OriginalLineItem =

A line item from the original shipment that corresponds to this shipment.

Structure.new do
  # @return [Array<Charge>] The charge details at the shipment level.
  attribute(:charges, [Charge])

  # @return [String] The SKU ID for the original shipment.
  attribute(:original_sku, String, from: "originalSku")

  # @return [String] The SKU ID for this shipment
  attribute(:replacing_sku, String, from: "replacingSku")
end
PackageDimensions =

The dimensions of a package.

Structure.new do
  # @return [Dimension] The height of the package.
  attribute(:height, Dimension)

  # @return [Dimension] The length of the package.
  attribute(:length, Dimension)

  # @return [Dimension] The width of the package.
  attribute(:width, Dimension)
end
PackageShipLabel =

A shipping label with a label document for a single package. If label generation fails, you can use the status and errorDetails attributes to determine the cause of failure.

Structure.new do
  # @return [Error]
  attribute?(:error_details, Error, from: "errorDetails")

  # @return [DocumentV2]
  attribute?(:file_data, DocumentV2, from: "fileData")

  # @return [String] The package ID of the package.
  attribute?(:package_id, String, from: "packageId")

  # @return [ShipLabelMetadata]
  attribute?(:ship_label_metadata, ShipLabelMetadata, from: "shipLabelMetadata")

  # @return [String] Whether label generation failed for the current package. If `FAILURE`, use `errorDetails` to
  # determine details of the failure.
  attribute?(:status, String)
end
ShipmentLineItem =

Information about a line item in a shipment.

Structure.new do
  # @return [Array<Charge>] The charges associated with the line item. The charge amount does not include the tax
  # amount.
  attribute(:charges, [Charge])

  # @return [ComplianceAttributes] All necessary compliance attributes specific to the line item.
  attribute(:compliance_attributes, ComplianceAttributes, from: "complianceAttributes")

  # @return [String] The seller's identifier for the SKU in this line item.
  attribute(:merchant_sku, String, from: "merchantSku")

  # @return [Integer] The number of items of the SKU in this line item.
  attribute(:number_of_units, Integer, from: "numberOfUnits")

  # @return [String] An identifier for a shipment's line item. This identifier is guaranteed to be unique within
  # the scope of its containing shipment.
  attribute(:shipment_line_item_id, String, from: "shipmentLineItemId")

  # @return [Array<Cancellation>] A list of cancellations for the given line item.
  attribute?(:cancellations, [Cancellation])

  # @return [String] The country of origin provided by the seller, represented by a two-letter country code in
  # ISO-3166 alpha-2 format. You must pass this field when `countryOfOriginRequirement` is `REQUIRED` in the
  # `getShipment` or `getShipments` response.
  attribute?(:country_of_origin, String, from: "countryOfOrigin")

  # @return [Array<CustomAttribute>] A list of custom passthrough attributes. For details on these attributes,
  # reach out to your respective program teams at Amazon.
  attribute?(:custom_attributes, [CustomAttribute], from: "customAttributes")

  # @return [GiftAttributes] Information about any gift wrapping that is needed for this line item.
  attribute?(:gift_attributes, GiftAttributes, from: "giftAttributes")

  # @return [Array<String>] A list of HAZMAT label identifiers that must be applied to the packages for this line
  # item.
  attribute?(:hazmat_labels, [String], from: "hazmatLabels")

  # @return [String] The HSN code of SKU in this line item.
  attribute?(:hsn_code, String, from: "hsnCode")

  # @return [Amount] The value of the item being shipped, as provided by the seller. This serves as the basis for
  # import duty/tax calculations. You must pass this field when `itemValueRequirement` is `REQUIRED` in the
  # `getShipment` or `getShipments` response.
  attribute?(:item_value, Amount, from: "itemValue")

  # @return [String] Whether the line item has multiple pieces.
  attribute?(:piece_type, String, from: "pieceType")

  # @return [String] The country of origin recommended by the marketplace, represented as a two-letter country
  # code following the ISO-3166 alpha-2 standard.
  attribute?(:recommended_country_of_origin, String, from: "recommendedCountryOfOrigin")

  # @return [String] The three digit currency code of the currency recommended by the marketplace, in ISO 4217
  # format.
  attribute?(:recommended_currency_code, String, from: "recommendedCurrencyCode")

  # @return [Array<SerialNumber>] The serial numbers for each item in this line item.
  attribute?(:serial_numbers, Array, from: "serialNumbers")
end
ShipmentsResponse =

The response of the getShipments operation.

Structure.new do
  # @return [Pagination] How to manage multiple pages of data.
  attribute?(:pagination, Pagination)

  # @return [Array<Shipment>] A list of shipments.
  attribute?(:shipments, [Shipment])
end
InvoiceRequirement =

Whether the invoice document is required to be attached to the shipment and its corresponding status.

Structure.new do
  # @return [String] Whether the invoice document is required to be attached to the shipment.
  attribute?(:requirement, String)

  # @return [String] The status of the of the invoice document that is attached to the shipment.
  attribute?(:status, String)
end
RecommendedPackage =

Recommendations for a package

Structure.new do
  # @return [PackageDimensions]
  attribute(:dimensions, PackageDimensions)

  # @return [Array<RecommendedPackageLineItem>]
  attribute(:line_items, [RecommendedPackageLineItem], from: "lineItems")

  # @return [Weight]
  attribute(:weight, Weight)
end
ShipLabelMetadata =

Metadata for a ship label document.

Structure.new do
  # @return [String] The name of the carrier.
  attribute(:carrier_name, String, from: "carrierName")

  # @return [String] The tracking number of the package.
  attribute(:tracking_id, String, from: "trackingId")

  # @return [TimeWindow] The time window during which the package was picked up.
  attribute?(:pickup_window, TimeWindow, from: "pickupWindow")

  # @return [String] The selected slot for the ship label.
  attribute?(:shipping_option_id, String, from: "shippingOptionId")

  # @return [TimeWindow] A time window during which to hand over the package to Amazon Logistics.
  attribute?(:time_slot, TimeWindow, from: "timeSlot")
end
ShipLabelsResponse =

The response to the generateShipLabels operation.

Structure.new do
  # @return [Array<PackageShipLabel>]
  attribute(:package_ship_label_list, [PackageShipLabel], from: "packageShipLabelList")
end
ComplianceAttributes =

All necessary compliance attributes specific to the line item.

Structure.new do
  # @return [String] Whether the country of origin must be provided for this line item.
  attribute(:country_of_origin_requirement, String, from: "countryOfOriginRequirement")

  # @return [String] Whether hazardous material labels must be applied on packages containing this line item.
  attribute(:hazmat_labels_requirement, String, from: "hazmatLabelsRequirement")

  # @return [String] Whether the item value must be provided for this line item.
  attribute(:item_value_requirement, String, from: "itemValueRequirement")

  # @return [String] Whether serial numbers must be provided for this line item.
  attribute(:serial_number_requirement, String, from: "serialNumberRequirement")
end
LineItemWithReason =

Information about the line item being confirmed or rejected and the reason for the rejection.

Structure.new do
  # @return [LineItem]
  attribute(:line_item, LineItem, from: "lineItem")

  # @return [String] The reason for the rejection of the line item.
  attribute?(:reason, String)
end
ShipmentRequirements =

Whether specific capabilities are enabled or required for the shipment.

Structure.new do
  # @return [InvoiceRequirement] Whether the invoice must be attached to the shipment.
  attribute(:invoice, InvoiceRequirement)

  # @return [PackingSlipRequirement] Whether the packing slip must be attached to the shipment.
  attribute(:p_slip, PackingSlipRequirement, from: "pSlip")
end
TaxRegistrationInfo =

Tax registration details of the entity. Applicable to direct fulfillment shipments.

Structure.new do
  # @return [Address] The address associated with the tax registration number.
  attribute?(:address, Address)

  # @return [String] Tax registration message that can be used for additional tax related details.
  attribute?(:messages, String)

  # @return [String] The tax registration number for the party. For example, their VAT ID.
  attribute?(:number, String)

  # @return [String] Tax registration type for the entity
  attribute?(:type, String)
end
MarketplaceAttributes =

The marketplace attributes associated with the location.

Structure.new do
  # @return [String] The channel name associated with the location.
  attribute(:channel_name, String, from: "channelName")

  # @return [String] The marketplace ID associated with the location. To find the ID for your marketplace, refer
  # to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
  attribute(:marketplace_id, String, from: "marketplaceId")

  # @return [Array<String>] Marketplace channel-specific custom attributes for the order. These attributes are not
  # mandatory and each channel can provide them differently.
  attribute?(:custom_attributes, [String], from: "customAttributes")

  # @return [String] The ID of the merchant or seller to whom this order is created.
  attribute?(:merchant_id, String, from: "merchantId")
end
ReplacedShipmentInfo =

Details of the original shipment if shipmentType is either REPLACEMENT or EXCHANGE.

Structure.new do
  # @return [String] The original shipment's ID.
  attribute(:id, String)

  # @return [String] The original shipment's location ID.
  attribute(:location_id, String, from: "locationId")

  # @return [MarketplaceAttributes] marketplace attributes for the shipment
  attribute(:marketplace_attributes, MarketplaceAttributes, from: "marketplaceAttributes")

  # @return [Array<OriginalLineItem>] The line items from the original shipment that corresponds to this shipment.
  attribute?(:original_line_items, [OriginalLineItem], from: "originalLineItems")
end
PackageDeliveryStatus =

The delivery status of the package.

Structure.new do
  # @return [String] The reason for the sub-status.
  attribute?(:reason, String)

  # @return [String] The status of the package.
  attribute?(:status, String)

  # @return [String] The sub-status of the package.
  attribute?(:sub_status, String, from: "subStatus")
end
PackingSlipRequirement =

Whether the packing slip is required to be attached to the shipment, and its corresponding status.

Structure.new do
  # @return [String] Whether the packing slip is required to be attached to the shipment.
  attribute?(:requirement, String)

  # @return [String] The status of the packing slip that is attached to the shipment.
  attribute?(:status, String)
end
PartyIdentificationInfo =

Party identification details for the shipment, applicable to direct fulfillment shipments.

Structure.new do
  # @return [String] Assigned identification for the party. For example, a warehouse code or vendor code.
  attribute(:party_id, String, from: "partyId")

  # @return [String] Assigned identification for the party. For example, a warehouse code or vendor code.
  attribute(:party_type, String, from: "partyType")

  # @return [Address] Address details of the party.
  attribute?(:address, Address)

  # @return [TaxRegistrationInfo] Tax registration details of the entity.
  attribute?(:tax_info, TaxRegistrationInfo, from: "taxInfo")
end
ShippingOptionsResponse =

The response to the retrieveShippingOptions operation. The response contains shipping options on a per-package basis from which the seller has to select one shipping option while they retrieve the shipping label. If the particular marketplace channel does not support scheduled shipping options, then this response will be empty.

Structure.new do
  # @return [ShippingOptions] The recommended shipping options that a marketplace channel provides to the seller.
  attribute?(:recommended_shipping_option, ShippingOptions, from: "recommendedShippingOption")

  # @return [Array<ShippingOptions>] A list of shipping options.
  attribute?(:shipping_options, [ShippingOptions], from: "shippingOptions")
end
CourierSupportedAttributes =

The tracking details of the package if it is shipped by a third party courier. This attribute should only be provided when the value of shipBy is THIRD_PARTY_CARRIER.

Structure.new do
  # @return [String] The name of the courier service used to ship the package
  attribute(:carrier_name, String, from: "carrierName")

  # @return [String] The tracking number of the package.
  attribute(:tracking_id, String, from: "trackingId")
end
RecommendedPackageLineItem =

A line item to be contained in a recommended package. This attribute is provided only for orders that come with a specific recommendation of line-item distribution within the package recommendations.

Structure.new do
  # @return [String] An ID for a line item in an order. The line item should be present in the recommended
  # package. This identifier has the same value as the ID of the line item present in the order.
  attribute(:line_item_id, String, from: "lineItemId")
end
ShipmentAcknowledgementRequest =

Information about the shipment and its line items, used to confirm or reject line items.

Structure.new do
  # @return [Array<LineItemWithReason>] Details about the line items from the shipment that are being confirmed or
  # rejected by the seller.
  attribute(:line_items, [LineItemWithReason], from: "lineItems")

  # @return [String] A unique identifier for every shipment rejection.
  attribute?(:reference_id, String, from: "referenceId")
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

#create_packages(shipment_id, body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Provide details about the packages in the specified shipment.

Parameters:

  • shipment_id (String)

    The ID of the shipment.

  • body (Hash)

    A list of packages in the shipment.

Returns:



84
85
86
87
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 84

def create_packages(shipment_id, body)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/packages"
  post(path, body:)
end

#generate_invoice(shipment_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Get invoices for the shipment you specify.

Parameters:

  • shipment_id (String)

    The ID of the shipment whose invoice you want.

Returns:



138
139
140
141
142
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 138

def generate_invoice(shipment_id)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/invoice"
  parser = -> { InvoiceResponse }
  post(path, parser:)
end

#generate_ship_labels(shipment_id, operation, shipping_option_id: nil, body: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Generate and retrieve all shipping labels for one or more packages in the shipment you specify.

Parameters:

  • shipment_id (String)

    The ID of the shipment whose shipping labels you want to generate and retrieve.

  • shipping_option_id (String) (defaults to: nil)

    The ID of the shipping option whose shipping labels you want.

  • operation (String)

    Specify whether you want to generate or regenerate a label.

  • body (Hash) (defaults to: nil)

    Shipping details for when shipping is not done by the marketplace channel.

Returns:



163
164
165
166
167
168
169
170
171
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 163

def generate_ship_labels(shipment_id, operation, shipping_option_id: nil, body: nil)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/shipLabels"
  params = {
    "shippingOptionId" => shipping_option_id,
    "operation" => operation,
  }.compact
  parser = -> { ShipLabelsResponse }
  put(path, body:, params:, parser:)
end

#get_shipment(shipment_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Get a single shipment with the ID you specify.

Parameters:

  • shipment_id (String)

    The ID of the shipment you want to retrieve.

Returns:



57
58
59
60
61
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 57

def get_shipment(shipment_id)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}"
  parser = -> { Shipment }
  get(path, parser:)
end

#get_shipments(status, location_id: nil, marketplace_id: nil, channel_name: nil, last_updated_after: nil, last_updated_before: nil, max_results: nil, pagination_token: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Get a list of shipments created for the seller in the status you specify. Shipments can be further filtered based on the fulfillment node or the time of the shipments' last update.

marketplace, refer to Marketplace IDs. shipments, set this value to ACCEPTED. time. In ISO 8601 date-time format. time. In ISO 8601 date-time format. includes nextToken when there are multiple pages of results. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextToken is null. Note that this operation can return empty pages.

Parameters:

  • location_id (String) (defaults to: nil)

    The Amazon channel location identifier for the shipments you want to retrieve.

  • marketplace_id (String) (defaults to: nil)

    The marketplace ID associated with the location. To find the ID for your

  • channel_name (String) (defaults to: nil)

    The channel name associated with the location.

  • status (String)

    The status of shipment you want to include in the response. To retrieve all new

  • last_updated_after (String) (defaults to: nil)

    The response includes shipments whose latest update is after the specified

  • last_updated_before (String) (defaults to: nil)

    The response includes shipments whose latest update is before the specified

  • max_results (Integer) (defaults to: nil)

    The maximum number of shipments to include in the response.

  • pagination_token (String) (defaults to: nil)

    A token that you use to retrieve the next page of results. The response

Returns:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 35

def get_shipments(status, location_id: nil, marketplace_id: nil, channel_name: nil, last_updated_after: nil,
  last_updated_before: nil, max_results: nil, pagination_token: nil)
  path = "/externalFulfillment/2024-09-11/shipments"
  params = {
    "locationId" => location_id,
    "marketplaceId" => marketplace_id,
    "channelName" => channel_name,
    "status" => status,
    "lastUpdatedAfter" => last_updated_after,
    "lastUpdatedBefore" => last_updated_before,
    "maxResults" => max_results,
    "paginationToken" => pagination_token,
  }.compact
  parser = -> { ShipmentsResponse }
  get(path, params:, parser:)
end

#process_shipment(shipment_id, operation, body: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Confirm or reject the specified shipment.

Parameters:

  • shipment_id (String)

    The ID of the shipment you want to confirm or reject.

  • operation (String)

    The status of the shipment.

  • body (Hash) (defaults to: nil)

    Information about the shipment and its line items.

Returns:



70
71
72
73
74
75
76
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 70

def process_shipment(shipment_id, operation, body: nil)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}"
  params = {
    "operation" => operation,
  }.compact
  post(path, body:, params:)
end

#retrieve_invoice(shipment_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve invoices for the shipment you specify.

Parameters:

  • shipment_id (String)

    The ID of the shipment whose invoice you want to retrieve.

Returns:



149
150
151
152
153
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 149

def retrieve_invoice(shipment_id)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/invoice"
  parser = -> { InvoiceResponse }
  get(path, parser:)
end

#retrieve_shipping_options(shipment_id, package_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Get a list of shipping options for a package in a shipment given the shipment's marketplace and channel. If the marketplace and channel have a pre-determined shipping option, then this operation returns an empty response.

Parameters:

  • shipment_id (String)

    The ID of the shipment to which the package belongs.

  • package_id (String)

    The ID of the package for which you want to retrieve shipping options.

Returns:



124
125
126
127
128
129
130
131
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 124

def retrieve_shipping_options(shipment_id, package_id)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/shippingOptions"
  params = {
    "packageId" => package_id,
  }.compact
  parser = -> { ShippingOptionsResponse }
  get(path, params:, parser:)
end

#update_package(shipment_id, package_id, body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Updates the details about the packages that will be used to fulfill the specified shipment.

Parameters:

  • shipment_id (String)

    The ID of the shipment to which the package belongs.

  • package_id (String)

    The ID of the package whose information you want to update.

  • body (Hash)

    The body of the request.

Returns:



96
97
98
99
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 96

def update_package(shipment_id, package_id, body)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/packages/#{percent_encode(package_id)}"
  put(path, body:)
end

#update_package_status(shipment_id, package_id, status: nil, body: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Updates the status of the packages.

Parameters:

  • shipment_id (String)

    The ID of the shipment to which the package belongs.

  • package_id (String)

    The ID of the package whose status you want to update.

  • status (String) (defaults to: nil)

    DEPRECATED. Do not use. Package status is defined in the body parameter.

  • body (Hash) (defaults to: nil)

    The body of the request.

Returns:



109
110
111
112
113
114
115
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 109

def update_package_status(shipment_id, package_id, status: nil, body: nil)
  path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/packages/#{percent_encode(package_id)}"
  params = {
    "status" => status,
  }.compact
  patch(path, body:, params:)
end