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/distance.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/document.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/geocodes.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/handover_location.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,
sig/peddler/apis/external_fulfillment_shipments_2024_09_11.rbs

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: Address, Amount, Cancellation, Cancellations, Charge, ChargeBreakup, Charges, ComplianceAttributes, CourierSupportedAttributes, CustomAttribute, CustomChannelAttribute, Dimension, Distance, Document, DocumentV2, Error, ErrorList, Geocodes, GiftAttributes, HandoverLocation, InvoiceInfo, InvoiceRequirement, InvoiceResponse, LineItem, LineItemWithReason, MarketplaceAttributes, OriginalLineItem, OriginalLineItems, Package, PackageDeliveryStatus, PackageDimensions, PackageLineItem, PackageLineItems, PackageShipLabel, PackageShipLabelList, Packages, PackingSlipRequirement, Pagination, PartyIdentificationInfo, PartyIdentificationInfoList, RecommendedPackage, RecommendedPackageLineItem, RecommendedPackageLineItems, RecommendedPackages, ReplacedShipmentInfo, ShipLabelMetadata, ShipLabelsInput, ShipLabelsResponse, Shipment, ShipmentAcknowledgementRequest, ShipmentInfo, ShipmentLineItem, ShipmentRequirements, ShipmentsResponse, ShippingInfo, ShippingOptions, ShippingOptionsResponse, Tax, TaxRegistrationInfo, TimeWindow, Weight

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

#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.

  • (String)
  • (Hash[untyped, untyped])

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.

  • (String)

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.

  • (String)
  • (String)
  • shipping_option_id: (String, nil) (defaults to: nil)
  • body: (Hash[untyped, untyped], nil) (defaults to: nil)

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.

  • (String)

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.

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 marketplace, refer to Marketplace IDs.

  • 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 shipments, set this value to CREATED or ACCEPTED.

  • last_updated_after (String) (defaults to: nil)

    The response includes shipments whose latest update is after the specified time. In ISO 8601 date-time format.

  • last_updated_before (String) (defaults to: nil)

    The response includes shipments whose latest update is before the specified time. In ISO 8601 date-time format.

  • 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 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.

  • (String)
  • location_id: (String, nil) (defaults to: nil)
  • marketplace_id: (String, nil) (defaults to: nil)
  • channel_name: (String, nil) (defaults to: nil)
  • last_updated_after: (String, nil) (defaults to: nil)
  • last_updated_before: (String, nil) (defaults to: nil)
  • max_results: (Integer, nil) (defaults to: nil)
  • pagination_token: (String, nil) (defaults to: nil)

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.

  • (String)
  • (String)
  • body: (Hash[untyped, untyped], nil) (defaults to: nil)

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.

  • (String)

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.

  • (String)
  • (String)

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.

  • (String)
  • (String)
  • (Hash[untyped, untyped])

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.

  • (String)
  • (String)
  • status: (String, nil) (defaults to: nil)
  • body: (Hash[untyped, untyped], nil) (defaults to: nil)

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