Class: Peddler::APIs::VendorDirectFulfillmentShippingV1

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb

Overview

Selling Partner API for Direct Fulfillment Shipping

The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #parser

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

#get_customer_invoice(purchase_order_number, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a customer invoice based on the purchaseOrderNumber that you specify.

Parameters:

  • purchase_order_number (String)

    Purchase order number of the shipment for which to return the invoice.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



139
140
141
142
143
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 139

def get_customer_invoice(purchase_order_number, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/customerInvoices/#{purchase_order_number}"

  meter(rate_limit).get(path)
end

#get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil, next_token: nil, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days.

Parameters:

  • ship_from_party_id (String) (defaults to: nil)

    The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.

  • limit (Integer) (defaults to: nil)

    The limit to the number of records returned

  • created_after (String)

    Orders that became available after this date and time will be included in the result. Must be in ISO 8601 date/time format.

  • created_before (String)

    Orders that became available before this date and time will be included in the result. Must be in ISO 8601 date/time format.

  • sort_order (String) (defaults to: nil)

    Sort ASC or DESC by order creation date.

  • next_token (String) (defaults to: nil)

    Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 118

def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
  next_token: nil, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/customerInvoices"
  params = {
    "shipFromPartyId" => ship_from_party_id,
    "limit" => limit,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
  }.compact

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

#get_packing_slip(purchase_order_number, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a packing slip based on the purchaseOrderNumber that you specify.

Parameters:

  • purchase_order_number (String)

    The purchaseOrderNumber for the packing slip you want.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



182
183
184
185
186
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 182

def get_packing_slip(purchase_order_number, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/packingSlips/#{purchase_order_number}"

  meter(rate_limit).get(path)
end

#get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC", next_token: nil, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search must not be more than 7 days.

Parameters:

  • ship_from_party_id (String) (defaults to: nil)

    The vendor warehouseId for order fulfillment. If not specified the result will contain orders for all warehouses.

  • limit (Integer) (defaults to: nil)

    The limit to the number of records returned

  • created_after (String)

    Packing slips that became available after this date and time will be included in the result. Must be in ISO 8601 date/time format.

  • created_before (String)

    Packing slips that became available before this date and time will be included in the result. Must be in ISO 8601 date/time format.

  • sort_order (String) (defaults to: "ASC")

    Sort ASC or DESC by packing slip creation date.

  • next_token (String) (defaults to: nil)

    Used for pagination when there are more packing slips than the specified result size limit. The token value is returned in the previous API call.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 161

def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
  next_token: nil, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/packingSlips"
  params = {
    "shipFromPartyId" => ship_from_party_id,
    "limit" => limit,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
  }.compact

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

#get_shipping_label(purchase_order_number, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a shipping label for the purchaseOrderNumber that you specify.

Parameters:

  • purchase_order_number (String)

    The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



69
70
71
72
73
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 69

def get_shipping_label(purchase_order_number, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/shippingLabels/#{purchase_order_number}"

  meter(rate_limit).get(path)
end

#get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC", next_token: nil, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days.

Parameters:

  • ship_from_party_id (String) (defaults to: nil)

    The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.

  • limit (Integer) (defaults to: nil)

    The limit to the number of records returned.

  • created_after (String)

    Shipping labels that became available after this date and time will be included in the result. Must be in ISO 8601 date/time format.

  • created_before (String)

    Shipping labels that became available before this date and time will be included in the result. Must be in ISO 8601 date/time format.

  • sort_order (String) (defaults to: "ASC")

    Sort ASC or DESC by order creation date.

  • next_token (String) (defaults to: nil)

    Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



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

def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
  next_token: nil, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
  params = {
    "shipFromPartyId" => ship_from_party_id,
    "limit" => limit,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
  }.compact

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

#submit_shipment_confirmations(body, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Submits one or more shipment confirmations for vendor orders.

Parameters:

  • body (Hash)

    Request body containing the shipment confirmations data.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



81
82
83
84
85
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 81

def submit_shipment_confirmations(body, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/shipmentConfirmations"

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

#submit_shipment_status_updates(body, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

This API call is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API will submit a shipment status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their order, when the package is outside of Amazon Network visibility.

Parameters:

  • body (Hash)

    Request body containing the shipment status update data.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



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

def submit_shipment_status_updates(body, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates"

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

#submit_shipping_label_request(body, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Creates a shipping label for a purchase order and returns a transactionId for reference.

Parameters:

  • body (Hash)

    Request body containing one or more shipping labels data.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



56
57
58
59
60
# File 'lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb', line 56

def submit_shipping_label_request(body, rate_limit: 10.0)
  path = "/vendor/directFulfillment/shipping/v1/shippingLabels"

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