I've been working with shopify's RESTful api to add customers to my store via my app. the Documentation has been helpful, and adding a simple customer was easy. however, when I add the "addresses" field the code completely stops working and the server responds with: {"errors":{"addresses":"expected Hash to be a array"}}. I've literally copied the code from here: https://docs.shopify.com/api/customer#create in the create a new user section, and just fired a post request off to the server with that json. Obviously, addresses is getting an array ("addresses":[{"bla":"bla"}] ). Any ideas what might be going on? here is the full json I am sending off:
{"customer":{
"accepts_marketing":true,
"created_at":"2015-03-27T08:34:22-04:00",
"email":"bing@email.com",
"first_name":"Brenda",
"id":371908881,
"last_name":"Bing",
"last_order_id":null,
"multipass_identifier":null,
"note":"",
"orders_count":0,
"state":"disabled",
"total_spent":"0.00",
"updated_at":"2015-03-27T08:34:22-04:00",
"verified_email":true,
"tags":"",
"last_order_name":null,
"default_address":{"address1":"65 parton ave.",
"address2":"",
"city":"boontown",
"company":"bingify.com",
"country":"United States",
"first_name":"Brenda",
"id":445415685,
"last_name":"Bing",
"phone":"1234567890",
"province":"Alabama",
"zip":"13564",
"name":"Brenda Bing",
"province_code":"AL",
"country_code":"US",
"country_name":"United States",
"default":true},
"addresses": [
{
"address1": "123 Oak St",
"city": "Ottawa",
"province": "ON",
"phone": "555-1212",
"zip": "123 ABC",
"last_name": "Lastnameson",
"first_name": "Mother",
"country": "CA"
}
]
}}