Class: Peddler::APIs::ExternalFulfillmentShipments20240911
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::ExternalFulfillmentShipments20240911
- 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/sandbox_shipment_updates.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/create_sandbox_shipment_request.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/update_sandbox_shipment_request.rb,
lib/peddler/apis/external_fulfillment_shipments_2024_09_11/create_sandbox_shipment_response.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, CreateSandboxShipmentRequest, CreateSandboxShipmentResponse, 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, SandboxShipmentUpdates, ShipLabelMetadata, ShipLabelsInput, ShipLabelsResponse, Shipment, ShipmentAcknowledgementRequest, ShipmentInfo, ShipmentLineItem, ShipmentRequirements, ShipmentsResponse, ShippingInfo, ShippingOptions, ShippingOptionsResponse, Tax, TaxRegistrationInfo, TimeWindow, UpdateSandboxShipmentRequest, Weight
Constant Summary
Constants inherited from Peddler::API
Peddler::API::TRANSIENT_STATUSES
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #base_url, #endpoint, #retries
Instance Method Summary collapse
-
#create_packages(shipment_id, body) ⇒ Peddler::Response
Provide details about the packages in the specified shipment.
-
#create_sandbox_shipment(body) ⇒ Peddler::Response
Creates a sandbox shipment to simulate order creation in the test environment.
-
#generate_invoice(shipment_id) ⇒ Peddler::Response
Get invoices for the shipment you specify.
-
#generate_ship_labels(shipment_id, operation, shipping_option_id: nil, body: nil) ⇒ Peddler::Response
Generate and retrieve all shipping labels for one or more packages in the shipment you specify.
-
#get_shipment(shipment_id) ⇒ Peddler::Response
Get a single shipment with the ID you specify.
-
#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
Get a list of shipments created for the seller in the status you specify.
-
#process_shipment(shipment_id, operation, body: nil) ⇒ Peddler::Response
Confirm or reject the specified shipment.
-
#retrieve_invoice(shipment_id) ⇒ Peddler::Response
Retrieve invoices for the shipment you specify.
-
#retrieve_shipping_options(shipment_id, package_id) ⇒ Peddler::Response
Get a list of shipping options for a package in a shipment given the shipment's marketplace and channel.
-
#update_package(shipment_id, package_id, body) ⇒ Peddler::Response
Updates the details about the packages that will be used to fulfill the specified shipment.
-
#update_package_status(shipment_id, package_id, status: nil, body: nil) ⇒ Peddler::Response
Updates the status of the packages.
-
#update_sandbox_shipment(shipment_id, body) ⇒ Peddler::Response
Updates a sandbox shipment on marketplace behalf.
Methods inherited from Peddler::API
#cannot_sandbox!, #delete, #endpoint_uri, #get, #host_header, #http, #initialize, #must_sandbox!, #parse_base_url, #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
This operation can make a dynamic sandbox call.
Provide details about the packages in the specified shipment.
113 114 115 116 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 113 def create_packages(shipment_id, body) path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}/packages" post(path, body:) end |
#create_sandbox_shipment(body) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Creates a sandbox shipment to simulate order creation in the test environment. This operation is available only in the sandbox environment. The shipment is created with the specified configuration including shipping type and order type.
59 60 61 62 63 64 65 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 59 def create_sandbox_shipment(body) must_sandbox! path = "/externalFulfillment/2024-09-11/shipments" parser = -> { CreateSandboxShipmentResponse } post(path, body:, parser:) end |
#generate_invoice(shipment_id) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Get invoices for the shipment you specify.
168 169 170 171 172 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 168 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
This operation can make a dynamic sandbox call.
Generate and retrieve all shipping labels for one or more packages in the shipment you specify.
193 194 195 196 197 198 199 200 201 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 193 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
This operation can make a dynamic sandbox call.
Get a single shipment with the ID you specify.
86 87 88 89 90 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 86 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
This operation can make a dynamic 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.
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
This operation can make a dynamic sandbox call.
Confirm or reject the specified shipment.
99 100 101 102 103 104 105 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 99 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
This operation can make a dynamic sandbox call.
Retrieve invoices for the shipment you specify.
179 180 181 182 183 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 179 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
This operation can make a dynamic 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.
154 155 156 157 158 159 160 161 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 154 def (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
This operation can make a dynamic sandbox call.
Updates the details about the packages that will be used to fulfill the specified shipment.
125 126 127 128 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 125 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
This operation can make a dynamic sandbox call.
Updates the status of the packages.
139 140 141 142 143 144 145 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 139 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 |
#update_sandbox_shipment(shipment_id, body) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Updates a sandbox shipment on marketplace behalf. Supports status changes, invoice availability, and transport capacity updates.
74 75 76 77 78 79 |
# File 'lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb', line 74 def update_sandbox_shipment(shipment_id, body) must_sandbox! path = "/externalFulfillment/2024-09-11/shipments/#{percent_encode(shipment_id)}" patch(path, body:) end |