Class: WalmartApIs::FbaInventoryApi
- Defined in:
- lib/walmart_ap_is/apis/fba_inventory_api.rb
Overview
FbaInventoryApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#add_inventory(x_amzn_idempotency_token, body) ⇒ ApiResponse
TODO: type endpoint description here token/requestId provided with each call to ensure idempotency.
-
#create_inventory_item(body) ⇒ ApiResponse
TODO: type endpoint description here.
-
#delete_inventory_item(seller_sku, marketplace_id) ⇒ ApiResponse
TODO: type endpoint description here for querying the specified seller SKU inventory summaries.
-
#get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil) ⇒ ApiResponse
TODO: type endpoint description here for the inventory aggregation level.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from WalmartApIs::BaseApi
Instance Method Details
#add_inventory(x_amzn_idempotency_token, body) ⇒ ApiResponse
TODO: type endpoint description here token/requestId provided with each call to ensure idempotency.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/walmart_ap_is/apis/fba_inventory_api.rb', line 49 def add_inventory(x_amzn_idempotency_token, body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/fba/inventory/v4/items/inventory', Server::DEFAULT1) .header_param(new_parameter(x_amzn_idempotency_token, key: 'x-amzn-idempotency-token') .is_required(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(APIHelper.method(:json_serialize)) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#create_inventory_item(body) ⇒ ApiResponse
TODO: type endpoint description here
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/walmart_ap_is/apis/fba_inventory_api.rb', line 12 def create_inventory_item(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/fba/inventory/v4/items', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(APIHelper.method(:json_serialize)) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#delete_inventory_item(seller_sku, marketplace_id) ⇒ ApiResponse
TODO: type endpoint description here for querying the specified seller SKU inventory summaries. the marketplace for which the sellerSku is to be deleted.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/walmart_ap_is/apis/fba_inventory_api.rb', line 90 def delete_inventory_item(seller_sku, marketplace_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/fba/inventory/v4/items/{sellerSku}', Server::DEFAULT1) .template_param(new_parameter(seller_sku, key: 'sellerSku') .is_required(true) .should_encode(true)) .query_param(new_parameter(marketplace_id, key: 'marketplaceId') .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil) ⇒ ApiResponse
TODO: type endpoint description here for the inventory aggregation level. the inventory aggregation level. ID for the marketplace for which to return inventory summaries. inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inven time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned SKUs for which to return inventory summaries. You may specify up to 50 SKUs. for querying the specified seller SKU inventory summaries. the response of your previous request. The string token will expire 30 seconds after being crea
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/walmart_ap_is/apis/fba_inventory_api.rb', line 146 def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/fba/inventory/v4/summaries', Server::DEFAULT1) .query_param(new_parameter(granularity_type, key: 'granularityType') .is_required(true)) .query_param(new_parameter(granularity_id, key: 'granularityId') .is_required(true)) .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds') .is_required(true)) .query_param(new_parameter(details, key: 'details')) .query_param(new_parameter(start_date_time, key: 'startDateTime')) .query_param(new_parameter(seller_skus, key: 'sellerSkus')) .query_param(new_parameter(seller_sku, key: 'sellerSku')) .query_param(new_parameter(next_token, key: 'nextToken')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |