amz_sp_api icon indicating copy to clipboard operation
amz_sp_api copied to clipboard

AmzSpApi::OrdersApiModel::GetOrderResponse payload?

Open jheathco opened this issue 2 years ago • 3 comments

Are attributes supposed to be accessible for get_order?

I see that get_order returns a AmzSpApi::OrdersApiModel::GetOrderResponse object, but then you've got to access the payload member which appears to be a simple hash requiring order.payload[:BuyerInfo] type access, rather than using order.payload.buyer_info.

Is this intended?

jheathco avatar Apr 21 '23 19:04 jheathco

Are you not getting any order attributes in the response? There should be a large bit of data that comes with the successful response. When I've gotten good responses, they've included necessary attributes. If you can show the response here, that would be helpful. Thanks!

WebDeverDan avatar Apr 21 '23 19:04 WebDeverDan

I'm getting them, but thought I wouldn't have to do order.payload[:BuyerInfo] - assumed I'd be able to do order.buyer_info.

jheathco avatar Apr 22 '23 00:04 jheathco

I'm getting them, but thought I wouldn't have to do order.payload[:BuyerInfo] - assumed I'd be able to do order.buyer_info.

This is how I'm fetching buyer email from the response: amazon_order.dig('BuyerInfo', 'BuyerEmail')

cassio-maletich avatar Apr 25 '23 19:04 cassio-maletich