Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Rich Borek commented on What customer fields could be edited through the PUT /admin/customers/#{id}.json?

$
0
0

Hey 7Spikes,

I've been working extensively with this API recently and I will tell you that managing addresses is "Rocket Science" as they are structured in the API they are not individually addressable objects like Order Transactions or Fulfillments which make them a bit of a pain to work with.  On a good note however I have successfully achieved what you are looking to do and here is the proper format for the Post to get them to look as you want.

{"customer": {"id": 284362701,"first_name": "tester","last_name": "test","email": "info@softuni.bg","addresses":
     [
      {"address1": "tester","address2": "sdfsdfsdf","city": "sf","company": "test","country": "Bulgaria","id": 348340049,"phone": "565465634","province": "sofia","zip": "6000","default": false
      }
      {"address1": "tester 2","address2": "sdfsdfsdf","city": "sf","company": "test second address","country": "Bulgaria","id": 348340049,"phone": "565465634","province": "sofia","zip": "6000","default": false
      }
    ]
  }
}

UPDATE

After posting this I decided to take a look at my code that was updating addresses and found that I need to insert my shoe into my mouth because the API is now exposed for updating addresses.  Shopify is continually updating their API and BIG THUMBS UP GUYS THIS WAS LONG OVERDUE...

check out the documentation here CustomerAddress - Shopify API - Developer Resources


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>