You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AmzSpApi.configure do |config|
config.refresh_token = "Token generated from generate token button in my app for united states region"
config.client_id = "Cleint id of app"
config.client_secret = "Client secret of app"
# either use these:
config.aws_access_key_id = "Access Key Id From users page in aws console"
config.aws_secret_access_key = "Access secret that generates when we first create an access key"
config.region = 'na' // because my refresh token is generated in US region
config.timeout = 20 # seconds
# config.debugging = true
# optional lambdas for caching LWA access token instead of requesting it each time, e.g.:
config.save_access_token = -> (access_token_key, token) do
Rails.cache.write("SPAPI-TOKEN-#{access_token_key}", token[:access_token], expires_in: token[:expires_in] - 60)
end
config.get_access_token = -> (access_token_key) { Rails.cache.read("SPAPI-TOKEN-#{access_token_key}") }
end
begin
api = AmzSpApi::FulfillmentOutboundApiModel::FbaOutboundApi.new(AmzSpApi::SpApiClient.new)
p api.list_all_fulfillment_orders.payload
rescue AmzSpApi::ApiError => e
puts "Exception when calling SP-API: #{e}"
end
end
The text was updated successfully, but these errors were encountered:
@mreinsch @ericcj
The text was updated successfully, but these errors were encountered: