Class: AmzSpApi::VendorDirectFulfillmentOrdersApiModel::VendorOrdersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VendorOrdersApi

Returns a new instance of VendorOrdersApi.



16
17
18
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#get_order(purchase_order_number, opts = {}) ⇒ Order

Returns purchase order information for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • purchase_order_number

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

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



23
24
25
26
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 23

def get_order(purchase_order_number, opts = {})
  data, _status_code, _headers = get_order_with_http_info(purchase_order_number, opts)
  data
end

#get_order_with_http_info(purchase_order_number, opts = {}) ⇒ Array<(Order, Integer, Hash)>

Returns purchase order information for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • purchase_order_number

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

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Order, Integer, Hash)>)

    Order data, response status code and response headers



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 32

def get_order_with_http_info(purchase_order_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_order ...'
  end
  # verify the required parameter 'purchase_order_number' is set
  if @api_client.config.client_side_validation && purchase_order_number.nil?
    fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling VendorOrdersApi.get_order"
  end
  # resource path
  local_var_path = '/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/{purchaseOrderNumber}'.sub('{' + 'purchaseOrderNumber' + '}', purchase_order_number.to_s)

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Order' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VendorOrdersApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orders(created_after, created_before, opts = {}) ⇒ OrderList

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. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • created_after

    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

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

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ship_from_party_id (String)

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

  • :status (String)

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

  • :limit (Integer)

    The limit to the number of purchase orders returned.

  • :sort_order (String)

    Sort the list in ascending or descending order by order creation date.

  • :next_token (String)

    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)

    When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned. (default to true)

Returns:



84
85
86
87
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 84

def get_orders(created_after, created_before, opts = {})
  data, _status_code, _headers = get_orders_with_http_info(created_after, created_before, opts)
  data
end

#get_orders_with_http_info(created_after, created_before, opts = {}) ⇒ Array<(OrderList, Integer, Hash)>

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. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • created_after

    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

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

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ship_from_party_id (String)

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

  • :status (String)

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

  • :limit (Integer)

    The limit to the number of purchase orders returned.

  • :sort_order (String)

    Sort the list in ascending or descending order by order creation date.

  • :next_token (String)

    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)

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

Returns:

  • (Array<(OrderList, Integer, Hash)>)

    OrderList data, response status code and response headers



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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 100

def get_orders_with_http_info(created_after, created_before, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_orders ...'
  end
  # verify the required parameter 'created_after' is set
  if @api_client.config.client_side_validation && created_after.nil?
    fail ArgumentError, "Missing the required parameter 'created_after' when calling VendorOrdersApi.get_orders"
  end
  # verify the required parameter 'created_before' is set
  if @api_client.config.client_side_validation && created_before.nil?
    fail ArgumentError, "Missing the required parameter 'created_before' when calling VendorOrdersApi.get_orders"
  end
  if @api_client.config.client_side_validation && opts[:'status'] && !['NEW', 'SHIPPED', 'ACCEPTED', 'CANCELLED'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of NEW, SHIPPED, ACCEPTED, CANCELLED'
  end
  if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
    fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = '/vendor/directFulfillment/orders/2021-12-28/purchaseOrders'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'createdAfter'] = created_after
  query_params[:'createdBefore'] = created_before
  query_params[:'shipFromPartyId'] = opts[:'ship_from_party_id'] if !opts[:'ship_from_party_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
  query_params[:'includeDetails'] = opts[:'include_details'] if !opts[:'include_details'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'pagination', 'orders'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'OrderList' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VendorOrdersApi#get_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_acknowledgement(body, opts = {}) ⇒ TransactionId

Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



163
164
165
166
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 163

def submit_acknowledgement(body, opts = {})
  data, _status_code, _headers = submit_acknowledgement_with_http_info(body, opts)
  data
end

#submit_acknowledgement_with_http_info(body, opts = {}) ⇒ Array<(TransactionId, Integer, Hash)>

Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(TransactionId, Integer, Hash)>)

    TransactionId data, response status code and response headers



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/vendor-direct-fulfillment-orders-api-model/api/vendor_orders_api.rb', line 172

def submit_acknowledgement_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VendorOrdersApi.submit_acknowledgement ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling VendorOrdersApi.submit_acknowledgement"
  end
  # resource path
  local_var_path = '/vendor/directFulfillment/orders/2021-12-28/acknowledgements'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'TransactionId' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VendorOrdersApi#submit_acknowledgement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end