sp_api_clients 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +161 -0
- data/LICENSE +21 -0
- data/README.md +284 -0
- data/lib/amazon_sp_clients/adapter_loader.rb +28 -0
- data/lib/amazon_sp_clients/api_client.rb +309 -0
- data/lib/amazon_sp_clients/api_error.rb +37 -0
- data/lib/amazon_sp_clients/api_response.rb +54 -0
- data/lib/amazon_sp_clients/configuration.rb +144 -0
- data/lib/amazon_sp_clients/marketplaces.rb +63 -0
- data/lib/amazon_sp_clients/middlewares/raise_error.rb +166 -0
- data/lib/amazon_sp_clients/session.rb +124 -0
- data/lib/amazon_sp_clients/sp_fba_inventory.rb +8 -0
- data/lib/amazon_sp_clients/sp_feeds_2021.rb +8 -0
- data/lib/amazon_sp_clients/sp_fulfillment_outbound_2020.rb +8 -0
- data/lib/amazon_sp_clients/sp_listings_items_2021.rb +8 -0
- data/lib/amazon_sp_clients/sp_orders_v0.rb +8 -0
- data/lib/amazon_sp_clients/sp_reports_2021.rb +8 -0
- data/lib/amazon_sp_clients/sp_tokens_2021.rb +8 -0
- data/lib/amazon_sp_clients/sp_vdf_inventory_v1.rb +8 -0
- data/lib/amazon_sp_clients/sp_vdf_orders_v1.rb +8 -0
- data/lib/amazon_sp_clients/sp_vdf_shipping_v1.rb +8 -0
- data/lib/amazon_sp_clients/sp_vendor_invoices.rb +8 -0
- data/lib/amazon_sp_clients/sp_vendor_orders.rb +8 -0
- data/lib/amazon_sp_clients/sp_vendor_transaction_status.rb +8 -0
- data/lib/amazon_sp_clients/sp_vendors_shipments.rb +8 -0
- data/lib/amazon_sp_clients/token_exchange_auth.rb +82 -0
- data/lib/amazon_sp_clients/uploader.rb +77 -0
- data/lib/amazon_sp_clients/v2/api.rb +43 -0
- data/lib/amazon_sp_clients/v2/apis/fba_inventory.rb +80 -0
- data/lib/amazon_sp_clients/v2/apis/feeds_2021.rb +86 -0
- data/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb +184 -0
- data/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb +144 -0
- data/lib/amazon_sp_clients/v2/apis/orders_v0.rb +165 -0
- data/lib/amazon_sp_clients/v2/apis/reports_2021.rb +117 -0
- data/lib/amazon_sp_clients/v2/apis/tokens_2021.rb +25 -0
- data/lib/amazon_sp_clients/v2/apis/vdf_inventory_v1.rb +26 -0
- data/lib/amazon_sp_clients/v2/apis/vdf_orders_v1.rb +61 -0
- data/lib/amazon_sp_clients/v2/apis/vdf_shipping_v1.rb +139 -0
- data/lib/amazon_sp_clients/v2/apis/vendor_invoices.rb +25 -0
- data/lib/amazon_sp_clients/v2/apis/vendor_orders.rb +106 -0
- data/lib/amazon_sp_clients/v2/apis/vendor_transaction_status.rb +25 -0
- data/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb +120 -0
- data/lib/amazon_sp_clients/v2/apis.rb +82 -0
- data/lib/amazon_sp_clients/v2/client.rb +198 -0
- data/lib/amazon_sp_clients/v2/config.rb +85 -0
- data/lib/amazon_sp_clients/v2/credentials.rb +91 -0
- data/lib/amazon_sp_clients/v2/documents.rb +115 -0
- data/lib/amazon_sp_clients/v2/error_mapper.rb +235 -0
- data/lib/amazon_sp_clients/v2/errors.rb +117 -0
- data/lib/amazon_sp_clients/v2/lwa.rb +100 -0
- data/lib/amazon_sp_clients/v2/rdt.rb +104 -0
- data/lib/amazon_sp_clients/v2/token.rb +39 -0
- data/lib/amazon_sp_clients/v2.rb +33 -0
- data/lib/amazon_sp_clients/version.rb +3 -0
- data/lib/amazon_sp_clients.rb +69 -0
- data/lib/sp_api_clients.rb +6 -0
- data/sp_api_clients.gemspec +53 -0
- data/vendor/fba_inventory/lib/sp_fba_inventory/api/fba_inventory_api.rb +289 -0
- data/vendor/fba_inventory/lib/sp_fba_inventory.rb +12 -0
- data/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb +367 -0
- data/vendor/feeds_2021/lib/sp_feeds_2021.rb +12 -0
- data/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb +845 -0
- data/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb +12 -0
- data/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb +480 -0
- data/vendor/listings_items_2021/lib/sp_listings_items_2021.rb +12 -0
- data/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb +593 -0
- data/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb +83 -0
- data/vendor/orders_v0/lib/sp_orders_v0.rb +13 -0
- data/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb +530 -0
- data/vendor/reports_2021/lib/sp_reports_2021.rb +12 -0
- data/vendor/tokens_2021/lib/sp_tokens_2021/api/tokens_api.rb +77 -0
- data/vendor/tokens_2021/lib/sp_tokens_2021.rb +12 -0
- data/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api/update_inventory_api.rb +83 -0
- data/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb +12 -0
- data/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api/vendor_orders_api.rb +217 -0
- data/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb +12 -0
- data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/customer_invoices_api.rb +152 -0
- data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_api.rb +264 -0
- data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_labels_api.rb +208 -0
- data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb +14 -0
- data/vendor/vendor_invoices/lib/sp_vendor_invoices/api/vendor_payments_api.rb +77 -0
- data/vendor/vendor_invoices/lib/sp_vendor_invoices.rb +12 -0
- data/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb +323 -0
- data/vendor/vendor_orders/lib/sp_vendor_orders.rb +12 -0
- data/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb +75 -0
- data/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb +12 -0
- data/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb +337 -0
- data/vendor/vendors_shipments/lib/sp_vendors_shipments.rb +12 -0
- metadata +321 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Selling Partner API for Retail Procurement Orders
|
|
3
|
+
|
|
4
|
+
#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: lib/generator (bundle exec rake generate)
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
module AmazonSpClients
|
|
12
|
+
module SpVendorOrders
|
|
13
|
+
class VendorOrdersApi
|
|
14
|
+
attr_accessor :api_client
|
|
15
|
+
|
|
16
|
+
def initialize(session)
|
|
17
|
+
@api_client = AmazonSpClients::ApiClient.new(session)
|
|
18
|
+
end
|
|
19
|
+
# Returns a purchase order based on the `purchaseOrderNumber` value 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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
20
|
+
# @param purchase_order_number The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code.
|
|
21
|
+
# @param [Hash] opts the optional parameters
|
|
22
|
+
# @return [GetPurchaseOrderResponse]
|
|
23
|
+
def get_purchase_order(purchase_order_number, opts = {})
|
|
24
|
+
data = get_purchase_order_with_http_info(purchase_order_number, opts)
|
|
25
|
+
return data
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns a purchase order based on the `purchaseOrderNumber` value 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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
29
|
+
# @param purchase_order_number The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code.
|
|
30
|
+
# @param [Hash] opts the optional parameters
|
|
31
|
+
# @return [Array<(GetPurchaseOrderResponse)>] GetPurchaseOrderResponse data, response status code and response headers
|
|
32
|
+
def get_purchase_order_with_http_info(purchase_order_number, opts = {})
|
|
33
|
+
if @api_client.config.debugging
|
|
34
|
+
@api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_purchase_order ...'
|
|
35
|
+
end
|
|
36
|
+
# verify the required parameter 'purchase_order_number' is set
|
|
37
|
+
if @api_client.config.client_side_validation && purchase_order_number.nil?
|
|
38
|
+
fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling VendorOrdersApi.get_purchase_order"
|
|
39
|
+
end
|
|
40
|
+
# resource path
|
|
41
|
+
local_var_path = '/vendor/orders/v1/purchaseOrders/{purchaseOrderNumber}'.sub('{' + 'purchaseOrderNumber' + '}', purchase_order_number.to_s)
|
|
42
|
+
|
|
43
|
+
# query parameters
|
|
44
|
+
query_params = opts[:query_params] || {}
|
|
45
|
+
|
|
46
|
+
# header parameters
|
|
47
|
+
header_params = opts[:header_params] || {}
|
|
48
|
+
# HTTP header 'Accept' (if needed)
|
|
49
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
50
|
+
|
|
51
|
+
# form parameters
|
|
52
|
+
form_params = opts[:form_params] || {}
|
|
53
|
+
|
|
54
|
+
# http body (model)
|
|
55
|
+
post_body = opts[:body]
|
|
56
|
+
|
|
57
|
+
return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
|
|
58
|
+
|
|
59
|
+
auth_names = opts[:auth_names] || []
|
|
60
|
+
data = @api_client.call_api(:GET, local_var_path,
|
|
61
|
+
:header_params => header_params,
|
|
62
|
+
:query_params => query_params,
|
|
63
|
+
:form_params => form_params,
|
|
64
|
+
:body => post_body,
|
|
65
|
+
:auth_names => auth_names,
|
|
66
|
+
:return_type => return_type)
|
|
67
|
+
|
|
68
|
+
if @api_client.config.debugging
|
|
69
|
+
@api_client.config.logger.debug "API called: VendorOrdersApi#get_purchase_order\nData: #{data.inspect}"
|
|
70
|
+
end
|
|
71
|
+
return data
|
|
72
|
+
end
|
|
73
|
+
# 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. **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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
74
|
+
# @param [Hash] opts the optional parameters
|
|
75
|
+
# @option opts [Integer] :limit The limit to the number of records returned. Default value is 100 records.
|
|
76
|
+
# @option opts [DateTime] :created_after Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
|
|
77
|
+
# @option opts [DateTime] :created_before Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
|
|
78
|
+
# @option opts [String] :sort_order Sort in ascending or descending order by purchase order creation date.
|
|
79
|
+
# @option opts [String] :next_token Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
|
|
80
|
+
# @option opts [String] :include_details When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
|
|
81
|
+
# @option opts [DateTime] :changed_after Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
82
|
+
# @option opts [DateTime] :changed_before Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
83
|
+
# @option opts [String] :po_item_state Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
|
|
84
|
+
# @option opts [String] :is_po_changed When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
|
|
85
|
+
# @option opts [String] :purchase_order_state Filters purchase orders based on the purchase order state.
|
|
86
|
+
# @option opts [String] :ordering_vendor_code Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
|
|
87
|
+
# @return [GetPurchaseOrdersResponse]
|
|
88
|
+
def get_purchase_orders(opts = {})
|
|
89
|
+
data = get_purchase_orders_with_http_info(opts)
|
|
90
|
+
return data
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# 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. **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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @option opts [Integer] :limit The limit to the number of records returned. Default value is 100 records.
|
|
96
|
+
# @option opts [DateTime] :created_after Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
|
|
97
|
+
# @option opts [DateTime] :created_before Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
|
|
98
|
+
# @option opts [String] :sort_order Sort in ascending or descending order by purchase order creation date.
|
|
99
|
+
# @option opts [String] :next_token Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
|
|
100
|
+
# @option opts [String] :include_details When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
|
|
101
|
+
# @option opts [DateTime] :changed_after Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
102
|
+
# @option opts [DateTime] :changed_before Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
103
|
+
# @option opts [String] :po_item_state Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
|
|
104
|
+
# @option opts [String] :is_po_changed When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
|
|
105
|
+
# @option opts [String] :purchase_order_state Filters purchase orders based on the purchase order state.
|
|
106
|
+
# @option opts [String] :ordering_vendor_code Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
|
|
107
|
+
# @return [Array<(GetPurchaseOrdersResponse)>] GetPurchaseOrdersResponse data, response status code and response headers
|
|
108
|
+
def get_purchase_orders_with_http_info(opts = {})
|
|
109
|
+
if @api_client.config.debugging
|
|
110
|
+
@api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_purchase_orders ...'
|
|
111
|
+
end
|
|
112
|
+
if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
|
|
113
|
+
fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
|
|
114
|
+
end
|
|
115
|
+
if @api_client.config.client_side_validation && opts[:'po_item_state'] && !['Cancelled'].include?(opts[:'po_item_state'])
|
|
116
|
+
fail ArgumentError, 'invalid value for "po_item_state", must be one of Cancelled'
|
|
117
|
+
end
|
|
118
|
+
if @api_client.config.client_side_validation && opts[:'purchase_order_state'] && !['New', 'Acknowledged', 'Closed'].include?(opts[:'purchase_order_state'])
|
|
119
|
+
fail ArgumentError, 'invalid value for "purchase_order_state", must be one of New, Acknowledged, Closed'
|
|
120
|
+
end
|
|
121
|
+
# resource path
|
|
122
|
+
local_var_path = '/vendor/orders/v1/purchaseOrders'
|
|
123
|
+
|
|
124
|
+
# query parameters
|
|
125
|
+
query_params = opts[:query_params] || {}
|
|
126
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
127
|
+
query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
|
|
128
|
+
query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
|
|
129
|
+
query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
|
130
|
+
query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
|
|
131
|
+
query_params[:'includeDetails'] = opts[:'include_details'] if !opts[:'include_details'].nil?
|
|
132
|
+
query_params[:'changedAfter'] = opts[:'changed_after'] if !opts[:'changed_after'].nil?
|
|
133
|
+
query_params[:'changedBefore'] = opts[:'changed_before'] if !opts[:'changed_before'].nil?
|
|
134
|
+
query_params[:'poItemState'] = opts[:'po_item_state'] if !opts[:'po_item_state'].nil?
|
|
135
|
+
query_params[:'isPOChanged'] = opts[:'is_po_changed'] if !opts[:'is_po_changed'].nil?
|
|
136
|
+
query_params[:'purchaseOrderState'] = opts[:'purchase_order_state'] if !opts[:'purchase_order_state'].nil?
|
|
137
|
+
query_params[:'orderingVendorCode'] = opts[:'ordering_vendor_code'] if !opts[:'ordering_vendor_code'].nil?
|
|
138
|
+
|
|
139
|
+
# header parameters
|
|
140
|
+
header_params = opts[:header_params] || {}
|
|
141
|
+
# HTTP header 'Accept' (if needed)
|
|
142
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'payload'])
|
|
143
|
+
|
|
144
|
+
# form parameters
|
|
145
|
+
form_params = opts[:form_params] || {}
|
|
146
|
+
|
|
147
|
+
# http body (model)
|
|
148
|
+
post_body = opts[:body]
|
|
149
|
+
|
|
150
|
+
return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
|
|
151
|
+
|
|
152
|
+
auth_names = opts[:auth_names] || []
|
|
153
|
+
data = @api_client.call_api(:GET, local_var_path,
|
|
154
|
+
:header_params => header_params,
|
|
155
|
+
:query_params => query_params,
|
|
156
|
+
:form_params => form_params,
|
|
157
|
+
:body => post_body,
|
|
158
|
+
:auth_names => auth_names,
|
|
159
|
+
:return_type => return_type)
|
|
160
|
+
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug "API called: VendorOrdersApi#get_purchase_orders\nData: #{data.inspect}"
|
|
163
|
+
end
|
|
164
|
+
return data
|
|
165
|
+
end
|
|
166
|
+
# 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. **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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @option opts [Integer] :limit The limit to the number of records returned. Default value is 100 records.
|
|
169
|
+
# @option opts [String] :sort_order Sort in ascending or descending order by purchase order creation date.
|
|
170
|
+
# @option opts [String] :next_token Used for pagination when there are more purchase orders than the specified result size limit.
|
|
171
|
+
# @option opts [DateTime] :created_after Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
172
|
+
# @option opts [DateTime] :created_before Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
173
|
+
# @option opts [DateTime] :updated_after Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
174
|
+
# @option opts [DateTime] :updated_before Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
175
|
+
# @option opts [String] :purchase_order_number Provides purchase order status for the specified purchase order number.
|
|
176
|
+
# @option opts [String] :purchase_order_status Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
|
|
177
|
+
# @option opts [String] :item_confirmation_status Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
|
|
178
|
+
# @option opts [String] :item_receive_status Filters purchase orders based on the purchase order's item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
|
|
179
|
+
# @option opts [String] :ordering_vendor_code Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
|
|
180
|
+
# @option opts [String] :ship_to_party_id Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders.
|
|
181
|
+
# @return [GetPurchaseOrdersStatusResponse]
|
|
182
|
+
def get_purchase_orders_status(opts = {})
|
|
183
|
+
data = get_purchase_orders_status_with_http_info(opts)
|
|
184
|
+
return data
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# 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. **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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
188
|
+
# @param [Hash] opts the optional parameters
|
|
189
|
+
# @option opts [Integer] :limit The limit to the number of records returned. Default value is 100 records.
|
|
190
|
+
# @option opts [String] :sort_order Sort in ascending or descending order by purchase order creation date.
|
|
191
|
+
# @option opts [String] :next_token Used for pagination when there are more purchase orders than the specified result size limit.
|
|
192
|
+
# @option opts [DateTime] :created_after Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
193
|
+
# @option opts [DateTime] :created_before Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
194
|
+
# @option opts [DateTime] :updated_after Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
195
|
+
# @option opts [DateTime] :updated_before Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
|
196
|
+
# @option opts [String] :purchase_order_number Provides purchase order status for the specified purchase order number.
|
|
197
|
+
# @option opts [String] :purchase_order_status Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
|
|
198
|
+
# @option opts [String] :item_confirmation_status Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
|
|
199
|
+
# @option opts [String] :item_receive_status Filters purchase orders based on the purchase order's item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
|
|
200
|
+
# @option opts [String] :ordering_vendor_code Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
|
|
201
|
+
# @option opts [String] :ship_to_party_id Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders.
|
|
202
|
+
# @return [Array<(GetPurchaseOrdersStatusResponse)>] GetPurchaseOrdersStatusResponse data, response status code and response headers
|
|
203
|
+
def get_purchase_orders_status_with_http_info(opts = {})
|
|
204
|
+
if @api_client.config.debugging
|
|
205
|
+
@api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_purchase_orders_status ...'
|
|
206
|
+
end
|
|
207
|
+
if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
|
|
208
|
+
fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
|
|
209
|
+
end
|
|
210
|
+
if @api_client.config.client_side_validation && opts[:'purchase_order_status'] && !['OPEN', 'CLOSED'].include?(opts[:'purchase_order_status'])
|
|
211
|
+
fail ArgumentError, 'invalid value for "purchase_order_status", must be one of OPEN, CLOSED'
|
|
212
|
+
end
|
|
213
|
+
if @api_client.config.client_side_validation && opts[:'item_confirmation_status'] && !['ACCEPTED', 'PARTIALLY_ACCEPTED', 'REJECTED', 'UNCONFIRMED'].include?(opts[:'item_confirmation_status'])
|
|
214
|
+
fail ArgumentError, 'invalid value for "item_confirmation_status", must be one of ACCEPTED, PARTIALLY_ACCEPTED, REJECTED, UNCONFIRMED'
|
|
215
|
+
end
|
|
216
|
+
if @api_client.config.client_side_validation && opts[:'item_receive_status'] && !['NOT_RECEIVED', 'PARTIALLY_RECEIVED', 'RECEIVED'].include?(opts[:'item_receive_status'])
|
|
217
|
+
fail ArgumentError, 'invalid value for "item_receive_status", must be one of NOT_RECEIVED, PARTIALLY_RECEIVED, RECEIVED'
|
|
218
|
+
end
|
|
219
|
+
# resource path
|
|
220
|
+
local_var_path = '/vendor/orders/v1/purchaseOrdersStatus'
|
|
221
|
+
|
|
222
|
+
# query parameters
|
|
223
|
+
query_params = opts[:query_params] || {}
|
|
224
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
225
|
+
query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
|
226
|
+
query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
|
|
227
|
+
query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
|
|
228
|
+
query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
|
|
229
|
+
query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
|
|
230
|
+
query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
|
|
231
|
+
query_params[:'purchaseOrderNumber'] = opts[:'purchase_order_number'] if !opts[:'purchase_order_number'].nil?
|
|
232
|
+
query_params[:'purchaseOrderStatus'] = opts[:'purchase_order_status'] if !opts[:'purchase_order_status'].nil?
|
|
233
|
+
query_params[:'itemConfirmationStatus'] = opts[:'item_confirmation_status'] if !opts[:'item_confirmation_status'].nil?
|
|
234
|
+
query_params[:'itemReceiveStatus'] = opts[:'item_receive_status'] if !opts[:'item_receive_status'].nil?
|
|
235
|
+
query_params[:'orderingVendorCode'] = opts[:'ordering_vendor_code'] if !opts[:'ordering_vendor_code'].nil?
|
|
236
|
+
query_params[:'shipToPartyId'] = opts[:'ship_to_party_id'] if !opts[:'ship_to_party_id'].nil?
|
|
237
|
+
|
|
238
|
+
# header parameters
|
|
239
|
+
header_params = opts[:header_params] || {}
|
|
240
|
+
# HTTP header 'Accept' (if needed)
|
|
241
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
242
|
+
|
|
243
|
+
# form parameters
|
|
244
|
+
form_params = opts[:form_params] || {}
|
|
245
|
+
|
|
246
|
+
# http body (model)
|
|
247
|
+
post_body = opts[:body]
|
|
248
|
+
|
|
249
|
+
return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
|
|
250
|
+
|
|
251
|
+
auth_names = opts[:auth_names] || []
|
|
252
|
+
data = @api_client.call_api(:GET, local_var_path,
|
|
253
|
+
:header_params => header_params,
|
|
254
|
+
:query_params => query_params,
|
|
255
|
+
:form_params => form_params,
|
|
256
|
+
:body => post_body,
|
|
257
|
+
:auth_names => auth_names,
|
|
258
|
+
:return_type => return_type)
|
|
259
|
+
|
|
260
|
+
if @api_client.config.debugging
|
|
261
|
+
@api_client.config.logger.debug "API called: VendorOrdersApi#get_purchase_orders_status\nData: #{data.inspect}"
|
|
262
|
+
end
|
|
263
|
+
return data
|
|
264
|
+
end
|
|
265
|
+
# 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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
266
|
+
# @param body Submits acknowledgements for one or more purchase orders from a vendor.
|
|
267
|
+
# @param [Hash] opts the optional parameters
|
|
268
|
+
# @return [SubmitAcknowledgementResponse]
|
|
269
|
+
def submit_acknowledgement(body, opts = {})
|
|
270
|
+
data = submit_acknowledgement_with_http_info(body, opts)
|
|
271
|
+
return data
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# 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 preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
275
|
+
# @param body Submits acknowledgements for one or more purchase orders from a vendor.
|
|
276
|
+
# @param [Hash] opts the optional parameters
|
|
277
|
+
# @return [Array<(SubmitAcknowledgementResponse)>] SubmitAcknowledgementResponse data, response status code and response headers
|
|
278
|
+
def submit_acknowledgement_with_http_info(body, opts = {})
|
|
279
|
+
if @api_client.config.debugging
|
|
280
|
+
@api_client.config.logger.debug 'Calling API: VendorOrdersApi.submit_acknowledgement ...'
|
|
281
|
+
end
|
|
282
|
+
# verify the required parameter 'body' is set
|
|
283
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
284
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling VendorOrdersApi.submit_acknowledgement"
|
|
285
|
+
end
|
|
286
|
+
# resource path
|
|
287
|
+
local_var_path = '/vendor/orders/v1/acknowledgements'
|
|
288
|
+
|
|
289
|
+
# query parameters
|
|
290
|
+
query_params = opts[:query_params] || {}
|
|
291
|
+
|
|
292
|
+
# header parameters
|
|
293
|
+
header_params = opts[:header_params] || {}
|
|
294
|
+
# HTTP header 'Accept' (if needed)
|
|
295
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
296
|
+
# HTTP header 'Content-Type'
|
|
297
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
298
|
+
|
|
299
|
+
# form parameters
|
|
300
|
+
form_params = opts[:form_params] || {}
|
|
301
|
+
|
|
302
|
+
# http body (model)
|
|
303
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
|
304
|
+
|
|
305
|
+
return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
|
|
306
|
+
|
|
307
|
+
auth_names = opts[:auth_names] || []
|
|
308
|
+
data = @api_client.call_api(:POST, local_var_path,
|
|
309
|
+
:header_params => header_params,
|
|
310
|
+
:query_params => query_params,
|
|
311
|
+
:form_params => form_params,
|
|
312
|
+
:body => post_body,
|
|
313
|
+
:auth_names => auth_names,
|
|
314
|
+
:return_type => return_type)
|
|
315
|
+
|
|
316
|
+
if @api_client.config.debugging
|
|
317
|
+
@api_client.config.logger.debug "API called: VendorOrdersApi#submit_acknowledgement\nData: #{data.inspect}"
|
|
318
|
+
end
|
|
319
|
+
return data
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Selling Partner API for Retail Procurement Orders
|
|
3
|
+
|
|
4
|
+
#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: lib/generator (bundle exec rake generate)
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
# APIs
|
|
12
|
+
require_relative './sp_vendor_orders/api/vendor_orders_api'
|
data/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Selling Partner API for Retail Procurement Transaction Status
|
|
3
|
+
|
|
4
|
+
#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: lib/generator (bundle exec rake generate)
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
module AmazonSpClients
|
|
12
|
+
module SpVendorTransactionStatus
|
|
13
|
+
class VendorTransactionApi
|
|
14
|
+
attr_accessor :api_client
|
|
15
|
+
|
|
16
|
+
def initialize(session)
|
|
17
|
+
@api_client = AmazonSpClients::ApiClient.new(session)
|
|
18
|
+
end
|
|
19
|
+
# Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | 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 than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
20
|
+
# @param transaction_id The GUID provided by Amazon in the 'transactionId' field in response to the post request of a specific transaction.
|
|
21
|
+
# @param [Hash] opts the optional parameters
|
|
22
|
+
# @return [GetTransactionResponse]
|
|
23
|
+
def get_transaction(transaction_id, opts = {})
|
|
24
|
+
data = get_transaction_with_http_info(transaction_id, opts)
|
|
25
|
+
return data
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | 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 than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
29
|
+
# @param transaction_id The GUID provided by Amazon in the 'transactionId' field in response to the post request of a specific transaction.
|
|
30
|
+
# @param [Hash] opts the optional parameters
|
|
31
|
+
# @return [Array<(GetTransactionResponse)>] GetTransactionResponse data, response status code and response headers
|
|
32
|
+
def get_transaction_with_http_info(transaction_id, opts = {})
|
|
33
|
+
if @api_client.config.debugging
|
|
34
|
+
@api_client.config.logger.debug 'Calling API: VendorTransactionApi.get_transaction ...'
|
|
35
|
+
end
|
|
36
|
+
# verify the required parameter 'transaction_id' is set
|
|
37
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
38
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling VendorTransactionApi.get_transaction"
|
|
39
|
+
end
|
|
40
|
+
# resource path
|
|
41
|
+
local_var_path = '/vendor/transactions/v1/transactions/{transactionId}'.sub('{' + 'transactionId' + '}', transaction_id.to_s)
|
|
42
|
+
|
|
43
|
+
# query parameters
|
|
44
|
+
query_params = opts[:query_params] || {}
|
|
45
|
+
|
|
46
|
+
# header parameters
|
|
47
|
+
header_params = opts[:header_params] || {}
|
|
48
|
+
# HTTP header 'Accept' (if needed)
|
|
49
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
50
|
+
|
|
51
|
+
# form parameters
|
|
52
|
+
form_params = opts[:form_params] || {}
|
|
53
|
+
|
|
54
|
+
# http body (model)
|
|
55
|
+
post_body = opts[:body]
|
|
56
|
+
|
|
57
|
+
return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
|
|
58
|
+
|
|
59
|
+
auth_names = opts[:auth_names] || []
|
|
60
|
+
data = @api_client.call_api(:GET, local_var_path,
|
|
61
|
+
:header_params => header_params,
|
|
62
|
+
:query_params => query_params,
|
|
63
|
+
:form_params => form_params,
|
|
64
|
+
:body => post_body,
|
|
65
|
+
:auth_names => auth_names,
|
|
66
|
+
:return_type => return_type)
|
|
67
|
+
|
|
68
|
+
if @api_client.config.debugging
|
|
69
|
+
@api_client.config.logger.debug "API called: VendorTransactionApi#get_transaction\nData: #{data.inspect}"
|
|
70
|
+
end
|
|
71
|
+
return data
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Selling Partner API for Retail Procurement Transaction Status
|
|
3
|
+
|
|
4
|
+
#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: lib/generator (bundle exec rake generate)
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
# APIs
|
|
12
|
+
require_relative './sp_vendor_transaction_status/api/vendor_transaction_api'
|