Class: Peddler::APIs::VendorShipmentsV1

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

Overview

Vendor Shipments v1

The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.

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

#get_shipment_details(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil, shipment_confirmed_before: nil, shipment_confirmed_after: nil, package_label_created_before: nil, package_label_created_after: nil, shipped_before: nil, shipped_after: nil, estimated_delivery_before: nil, estimated_delivery_after: nil, shipment_delivery_before: nil, shipment_delivery_after: nil, requested_pick_up_before: nil, requested_pick_up_after: nil, scheduled_pick_up_before: nil, scheduled_pick_up_after: nil, current_shipment_status: nil, vendor_shipment_identifier: nil, buyer_reference_number: nil, buyer_warehouse_code: nil, seller_warehouse_code: nil, rate_limit: 10.0) ⇒ Peddler::Response

Returns the Details about Shipment, Carrier Details, status of the shipment, container details and other details related to shipment based on the filter parameters value that you specify.

Parameters:

  • limit (Integer) (defaults to: nil)

    The limit to the number of records returned. Default value is 50 records.

  • sort_order (String) (defaults to: nil)

    Sort in ascending or descending order by purchase order creation date.

  • next_token (String) (defaults to: nil)

    Used for pagination when there are more shipments than the specified result size limit.

  • created_after (String) (defaults to: nil)

    Get Shipment Details that became available after this timestamp will be included in the result. Must be in ISO 8601 format.

  • created_before (String) (defaults to: nil)

    Get Shipment Details that became available before this timestamp will be included in the result. Must be in ISO 8601 format.

  • shipment_confirmed_before (String) (defaults to: nil)

    Get Shipment Details by passing Shipment confirmed create Date Before. Must be in ISO 8601 format.

  • shipment_confirmed_after (String) (defaults to: nil)

    Get Shipment Details by passing Shipment confirmed create Date After. Must be in ISO 8601 format.

  • package_label_created_before (String) (defaults to: nil)

    Get Shipment Details by passing Package label create Date by buyer. Must be in ISO 8601 format.

  • package_label_created_after (String) (defaults to: nil)

    Get Shipment Details by passing Package label create Date After by buyer. Must be in ISO 8601 format.

  • shipped_before (String) (defaults to: nil)

    Get Shipment Details by passing Shipped Date Before. Must be in ISO 8601 format.

  • shipped_after (String) (defaults to: nil)

    Get Shipment Details by passing Shipped Date After. Must be in ISO 8601 format.

  • estimated_delivery_before (String) (defaults to: nil)

    Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format.

  • estimated_delivery_after (String) (defaults to: nil)

    Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format.

  • shipment_delivery_before (String) (defaults to: nil)

    Get Shipment Details by passing Shipment Delivery Date Before. Must be in ISO 8601 format.

  • shipment_delivery_after (String) (defaults to: nil)

    Get Shipment Details by passing Shipment Delivery Date After. Must be in ISO 8601 format.

  • requested_pick_up_before (String) (defaults to: nil)

    Get Shipment Details by passing Before Requested pickup date. Must be in ISO 8601 format.

  • requested_pick_up_after (String) (defaults to: nil)

    Get Shipment Details by passing After Requested pickup date. Must be in ISO 8601 format.

  • scheduled_pick_up_before (String) (defaults to: nil)

    Get Shipment Details by passing Before scheduled pickup date. Must be in ISO 8601 format.

  • scheduled_pick_up_after (String) (defaults to: nil)

    Get Shipment Details by passing After Scheduled pickup date. Must be in ISO 8601 format.

  • current_shipment_status (String) (defaults to: nil)

    Get Shipment Details by passing Current shipment status.

  • vendor_shipment_identifier (String) (defaults to: nil)

    Get Shipment Details by passing Vendor Shipment ID

  • buyer_reference_number (String) (defaults to: nil)

    Get Shipment Details by passing buyer Reference ID

  • buyer_warehouse_code (String) (defaults to: nil)

    Get Shipping Details based on buyer warehouse code. This value should be same as 'shipToParty.partyId' in the Shipment.

  • seller_warehouse_code (String) (defaults to: nil)

    Get Shipping Details based on vendor warehouse code. This value should be same as 'sellingParty.partyId' in the Shipment.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/peddler/apis/vendor_shipments_v1.rb', line 91

def get_shipment_details(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil,
  shipment_confirmed_before: nil, shipment_confirmed_after: nil, package_label_created_before: nil,
  package_label_created_after: nil, shipped_before: nil, shipped_after: nil, estimated_delivery_before: nil,
  estimated_delivery_after: nil, shipment_delivery_before: nil, shipment_delivery_after: nil,
  requested_pick_up_before: nil, requested_pick_up_after: nil, scheduled_pick_up_before: nil,
  scheduled_pick_up_after: nil, current_shipment_status: nil, vendor_shipment_identifier: nil,
  buyer_reference_number: nil, buyer_warehouse_code: nil, seller_warehouse_code: nil, rate_limit: 10.0)
  cannot_sandbox!

  path = "/vendor/shipping/v1/shipments"
  params = {
    "limit" => limit,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "shipmentConfirmedBefore" => shipment_confirmed_before,
    "shipmentConfirmedAfter" => shipment_confirmed_after,
    "packageLabelCreatedBefore" => package_label_created_before,
    "packageLabelCreatedAfter" => package_label_created_after,
    "shippedBefore" => shipped_before,
    "shippedAfter" => shipped_after,
    "estimatedDeliveryBefore" => estimated_delivery_before,
    "estimatedDeliveryAfter" => estimated_delivery_after,
    "shipmentDeliveryBefore" => shipment_delivery_before,
    "shipmentDeliveryAfter" => shipment_delivery_after,
    "requestedPickUpBefore" => requested_pick_up_before,
    "requestedPickUpAfter" => requested_pick_up_after,
    "scheduledPickUpBefore" => scheduled_pick_up_before,
    "scheduledPickUpAfter" => scheduled_pick_up_after,
    "currentShipmentStatus" => current_shipment_status,
    "vendorShipmentIdentifier" => vendor_shipment_identifier,
    "buyerReferenceNumber" => buyer_reference_number,
    "buyerWarehouseCode" => buyer_warehouse_code,
    "sellerWarehouseCode" => seller_warehouse_code,
  }.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)

    A request to submit shipment confirmation.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



24
25
26
27
28
# File 'lib/peddler/apis/vendor_shipments_v1.rb', line 24

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

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

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

Submits one or more shipment request for vendor Orders.

Parameters:

  • body (Hash)

    A request to submit shipment request.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



35
36
37
38
39
40
41
# File 'lib/peddler/apis/vendor_shipments_v1.rb', line 35

def submit_shipments(body, rate_limit: 10.0)
  cannot_sandbox!

  path = "/vendor/shipping/v1/shipments"

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