How to create a customer via post REST API

4 0 1

In postman, I want to create a customer by post to this url:


  "customer": {
    "first_name": "Steve",
    "last_name": "Lastnameson",
    "email": "",
    "phone": "+15142546011",
    "verified_email": true,
    "addresses": [
        "address1": "123 Oak St",
        "city": "Ottawa",
        "province": "ON",
        "phone": "555-1212",
        "zip": "123 ABC",
        "last_name": "Lastnameson",
        "first_name": "Mother",
        "country": "CA"
    "password": "newpass",
    "password_confirmation": "newpass",
    "send_email_welcome": false


Instead, I got something like this. I expect it just creates a customer directly



            <a href=";destination_uuid=b4eda884-65f5-4297-b09f-341ec310ab64&amp;nonce=27ced0ba04537fa341d5f2e7b5bd3f72&amp;;response_type=code&amp;scope=openid+email+profile&amp;state=fdc99206a6c218ad88be11250366a45b&amp;ui_locales=en&amp;ux=shop">Continue</a>
        <script type="text/javascript">
      window.location = "https:\/\/\/oauth\/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c\u0026destination_uuid=b4eda884-65f5-4297-b09f-341ec310ab64\u0026nonce=27ced0ba04537fa341d5f2e7b5bd3f72\\u0026response_type=code\u0026scope=openid+email+profile\u0026state=fdc99206a6c218ad88be11250366a45b\u0026ui_locales=en\u0026ux=shop";


1 Like
Shopify Partner
1838 170 528

The admin API will always redirect to login page if cookies are sent along in a POST request. That's documented somewhere.


You need to clear your cookies from the Postman session which are held in Chrome. I don't use Postman so I can't give you specific instructions how to approach this but you can read up here or Google how to do it.


Better solution, switch to Insomnia (and read this little gem written by Shopify) and live happily ever after.


Best wishes!

I turn coffee in to code - since 1998