Class: Peddler::APIs::EasyShip20220323

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/easy_ship_2022_03_23.rb

Overview

Selling Partner API for Easy Ship

The Selling Partner API for Easy Ship helps you build applications that help sellers manage and ship Amazon Easy Ship orders. Your Easy Ship applications can: * Get available time slots for packages to be scheduled for delivery. * Schedule, reschedule, and cancel Easy Ship orders. * Print labels, invoices, and warranties. See the Marketplace Support Table for the differences in Easy Ship operations by marketplace.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #parser, #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_scheduled_package(create_scheduled_package_request, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling createScheduledPackage also generates a warranty document if you specify a SerialNumber value. To get these documents, see href="https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide">https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide How to get invoice, shipping label, and warranty documents. * Shows the status of Easy Ship orders when you call the getOrders operation of the Selling Partner API for Orders and examine the EasyShipShipmentStatus property in the response body. See the Shipping Label, Invoice, and Warranty columns in the Marketplace Support Table to see which documents are supported in each marketplace.

Parameters:

  • create_scheduled_package_request (Hash)

    The request schema for the createScheduledPackage operation.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



75
76
77
78
79
80
# File 'lib/peddler/apis/easy_ship_2022_03_23.rb', line 75

def create_scheduled_package(create_scheduled_package_request, rate_limit: 1.0)
  path = "/easyShip/2022-03-23/package"
  body = create_scheduled_package_request

  meter(rate_limit).post(path, body:)
end

#create_scheduled_package_bulk(create_scheduled_packages_request, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

This operation automatically schedules a time slot for all specified amazonOrderId values and generates the associated shipping labels and compliance documents based on the marketplace. For more information, refer to the marketplace support table. You can optionally assign a packageDetails object to input a preferred time slot for each order in your request. In such cases, Amazon schedules the respective packages using the specified optional settings. If you don't specify a time slot, Amazon assigns the earliest available time slot. You can choose PDF or ZPL for your shipping label's file format and Amazon creates the label accordingly. This operation returns an array that contains the scheduled packages, and a temporary URL that you can use to access a ZIP file. The ZIP file includes the generated shipping labels and any other documents that are required for your marketplace. If an order can't be scheduled, Amazon adds the rejectedOrders list in the response. The response contains an entry for each order that could not be processed. Each entry contains an error message that describes the reason for the failure. The following table contains the supported request and burst maximum rates:

Parameters:

  • create_scheduled_packages_request (Hash)

    The request schema for the createScheduledPackageBulk operation.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



118
119
120
121
122
123
# File 'lib/peddler/apis/easy_ship_2022_03_23.rb', line 118

def create_scheduled_package_bulk(create_scheduled_packages_request, rate_limit: 1.0)
  path = "/easyShip/2022-03-23/packages/bulk"
  body = create_scheduled_packages_request

  meter(rate_limit).post(path, body:)
end

#get_scheduled_package(amazon_order_id, marketplace_id, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.

Parameters:

  • amazon_order_id (String)

    An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.

  • marketplace_id (String)

    An identifier for the marketplace in which the seller is selling.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



50
51
52
53
54
55
56
57
58
# File 'lib/peddler/apis/easy_ship_2022_03_23.rb', line 50

def get_scheduled_package(amazon_order_id, marketplace_id, rate_limit: 1.0)
  path = "/easyShip/2022-03-23/package"
  params = {
    "amazonOrderId" => amazon_order_id,
    "marketplaceId" => marketplace_id,
  }.compact

  meter(rate_limit).get(path, params:)
end

#list_handover_slots(list_handover_slots_request: nil, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See Get Time Slots in the Marketplace Support Table. This operation can return time slots that have either pickup or drop-off handover methods - see Supported Handover Methods in the Marketplace Support Table.

Parameters:

  • list_handover_slots_request (Hash) (defaults to: nil)

    The request schema for the listHandoverSlots operation.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



34
35
36
37
38
39
# File 'lib/peddler/apis/easy_ship_2022_03_23.rb', line 34

def list_handover_slots(list_handover_slots_request: nil, rate_limit: 1.0)
  path = "/easyShip/2022-03-23/timeSlot"
  body = list_handover_slots_request

  meter(rate_limit).post(path, body:)
end

#update_scheduled_packages(update_scheduled_packages_request: nil, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Updates the time slot for handing over the package indicated by the specified scheduledPackageId. You can get the new slotId value for the time slot by calling the listHandoverSlots operation before making another patch call. See the Update Package column in the Marketplace Support Table to see which marketplaces this operation is supported in.

Parameters:

  • update_scheduled_packages_request (Hash) (defaults to: nil)

    The request schema for the updateScheduledPackages operation.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



92
93
94
95
96
97
# File 'lib/peddler/apis/easy_ship_2022_03_23.rb', line 92

def update_scheduled_packages(update_scheduled_packages_request: nil, rate_limit: 1.0)
  path = "/easyShip/2022-03-23/package"
  body = update_scheduled_packages_request

  meter(rate_limit).patch(path, body:)
end