Hi Sophie,
Version 2
Yes, confirmed.
Yes, see below. In my code you’ll see variables - these variables are string values unless the required field calls for an integer. I just ran the code below and got this error: {“error_message”: “The input field ‘shipping_address[street1]’ was not expected.”, “param”: null}
I also have to use the “endpoint” because it says new users can only post 2 links. But the endpoint used was the endpoint used in the example above.
put_order = HTTParty.post(endpoint,
:basic_auth => auth,
:body => {
:cart => cart,
:shipping_address => {
“street1” => street1,
:street2 => street2,
:zip => zip_code,
:state => state,
:name => name,
:city => city,
:country => country,
:email => "alex@roadreadywheels.com",
:phone => phone_number,
:fax => “”
},
:billing_address => {
:company => “”,
:street1 => street1,
:street2 => street2,
:zip => zip_code,
:state => state,
:name => name,
:city => city,
:country => country,
:email => "alex@roadreadywheels.com",
:phone => phone_number,
:fax => “”
},
:order_id => order_id,
:status => “new”,
:product_amount => product_amount,
:shipping_amount => shipping_amount,
:tax_amount => tax_amount,
:discount_amount => 0.0,
:grand_total => grand_total,
:lines => {
:product => {
:sku => ‘560-8075’,
:name => ‘malibu wheel’
},
:cart_orderitem_id => order_id,
:item_price => product_amount,
:selected_option => “”,
:option_price => “”,
:total_price => grand_total,
:product_name => ‘560-8075’,
:quantity => 2
}
})