Class: Peddler::APIs::VendorOrdersV1

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

Overview

Selling Partner API for Retail Procurement Orders

The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.

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_purchase_order(purchase_order_number, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a purchase order based on the ‘purchaseOrderNumber` value that you specify.



80
81
82
83
84
# File 'lib/peddler/apis/vendor_orders_v1.rb', line 80

def get_purchase_order(purchase_order_number, rate_limit: 10.0)
  path = "/vendor/orders/v1/purchaseOrders/#{percent_encode(purchase_order_number)}"

  meter(rate_limit).get(path)
end

#get_purchase_orders(limit: nil, created_after: nil, created_before: nil, sort_order: nil, next_token: nil, include_details: nil, changed_after: nil, changed_before: nil, po_item_state: nil, is_po_changed: nil, purchase_order_state: nil, ordering_vendor_code: nil, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the ‘createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/peddler/apis/vendor_orders_v1.rb', line 51

def get_purchase_orders(limit: nil, created_after: nil, created_before: nil, sort_order: nil, next_token: nil,
  include_details: nil, changed_after: nil, changed_before: nil, po_item_state: nil, is_po_changed: nil,
  purchase_order_state: nil, ordering_vendor_code: nil, rate_limit: 10.0)
  path = "/vendor/orders/v1/purchaseOrders"
  params = {
    "limit" => limit,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
    "includeDetails" => include_details,
    "changedAfter" => changed_after,
    "changedBefore" => changed_before,
    "poItemState" => po_item_state,
    "isPOChanged" => is_po_changed,
    "purchaseOrderState" => purchase_order_state,
    "orderingVendorCode" => ordering_vendor_code,
  }.compact

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

#get_purchase_orders_status(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil, updated_after: nil, updated_before: nil, purchase_order_number: nil, purchase_order_status: nil, item_confirmation_status: nil, item_receive_status: nil, ordering_vendor_code: nil, ship_to_party_id: nil, rate_limit: 10.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/peddler/apis/vendor_orders_v1.rb', line 134

def get_purchase_orders_status(limit: nil, sort_order: nil, next_token: nil, created_after: nil,
  created_before: nil, updated_after: nil, updated_before: nil, purchase_order_number: nil,
  purchase_order_status: nil, item_confirmation_status: nil, item_receive_status: nil, ordering_vendor_code: nil,
  ship_to_party_id: nil, rate_limit: 10.0)
  path = "/vendor/orders/v1/purchaseOrdersStatus"
  params = {
    "limit" => limit,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "updatedAfter" => updated_after,
    "updatedBefore" => updated_before,
    "purchaseOrderNumber" => purchase_order_number,
    "purchaseOrderStatus" => purchase_order_status,
    "itemConfirmationStatus" => item_confirmation_status,
    "itemReceiveStatus" => item_receive_status,
    "orderingVendorCode" => ordering_vendor_code,
    "shipToPartyId" => ship_to_party_id,
  }.compact

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

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

Note:

This operation can make a static sandbox call.

Submits acknowledgements for one or more purchase orders.



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

def submit_acknowledgement(body, rate_limit: 10.0)
  path = "/vendor/orders/v1/acknowledgements"

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