Class: Peddler::API::VendorOrdersV1
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::API::VendorOrdersV1
- Defined in:
- lib/peddler/api/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
Instance Method Summary collapse
-
#get_purchase_order(purchase_order_number, rate_limit: 10.0) ⇒ Hash
Returns a purchase order based on the
purchaseOrderNumber
value that you specify. -
#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) ⇒ Hash
Returns a list of purchase orders created or changed during the time frame that you specify.
-
#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) ⇒ Hash
Returns purchase order statuses based on the filters that you specify.
-
#submit_acknowledgement(body, rate_limit: 10.0) ⇒ Hash
Submits acknowledgements for one or more purchase orders.
Methods inherited from Peddler::API
#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #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) ⇒ Hash
This operation can make a static sandbox call.
Returns a purchase order based on the purchaseOrderNumber
value that you specify.
81 82 83 84 85 |
# File 'lib/peddler/api/vendor_orders_v1.rb', line 81 def get_purchase_order(purchase_order_number, rate_limit: 10.0) path = "/vendor/orders/v1/purchaseOrders/#{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) ⇒ Hash
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.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/peddler/api/vendor_orders_v1.rb', line 52 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) ⇒ Hash
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.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/peddler/api/vendor_orders_v1.rb', line 135 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) ⇒ Hash
This operation can make a static sandbox call.
Submits acknowledgements for one or more purchase orders.
93 94 95 96 97 |
# File 'lib/peddler/api/vendor_orders_v1.rb', line 93 def submit_acknowledgement(body, rate_limit: 10.0) path = "/vendor/orders/v1/acknowledgements" meter(rate_limit).post(path, body:) end |