Class: Peddler::API::VendorDirectFulfillmentOrders20211228

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb

Overview

Selling Partner API for Direct Fulfillment Orders

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

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

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_order(purchase_order_number, rate_limit: 10.0) ⇒ Hash

Note:

This operation can make a dynamic sandbox call.

Returns purchase order information for the purchaseOrderNumber that you specify.

Parameters:

  • purchase_order_number (String)

    The order identifier for the purchase order that you want. Formatting Notes: alpha-numeric code.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



66
67
68
69
70
# File 'lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb', line 66

def get_order(purchase_order_number, rate_limit: 10.0)
  path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}"

  meter(rate_limit).get(path)
end

#get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil, next_token: nil, include_details: "true", rate_limit: 10.0) ⇒ Hash

Note:

This operation can make a dynamic sandbox call.

Returns a list of purchase orders created during the time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific order.

Parameters:

  • ship_from_party_id (String) (defaults to: nil)

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

  • status (String) (defaults to: nil)

    Returns only the purchase orders that match the specified status. If not specified, the result will contain orders that match any status.

  • limit (Integer) (defaults to: nil)

    The limit to the number of purchase orders returned.

  • created_after (String)

    Purchase 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)

    Purchase 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 the list in ascending or descending order 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.

  • include_details (String) (defaults to: "true")

    When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb', line 42

def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil,
  next_token: nil, include_details: "true", rate_limit: 10.0)
  path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders"
  params = {
    "shipFromPartyId" => ship_from_party_id,
    "status" => status,
    "limit" => limit,
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "sortOrder" => sort_order,
    "nextToken" => next_token,
    "includeDetails" => include_details,
  }.compact

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

#submit_acknowledgement(body, rate_limit: 10.0) ⇒ Hash

Note:

This operation can make a dynamic sandbox call.

Submits acknowledgements for one or more purchase orders.

Parameters:

  • body (Hash)

    The request body containing the acknowledgement to an order

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



78
79
80
81
82
# File 'lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb', line 78

def submit_acknowledgement(body, rate_limit: 10.0)
  path = "/vendor/directFulfillment/orders/2021-12-28/acknowledgements"

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