4

I'm trying to create a customer using the Magento REST API.

I can use my token to retrieve/update data just fine, but for whatever reason I am unable to create an account, regardless of the permissions I set ("All" or "Custom with checked boxes").

Here is a screenshot of the Magento admin, if you notice, for whatever reason, Customers does not have a Create option and I cannot figure out why that is either, and may ultimately be why I am unable to use the POST /api/rest/customers call as outlined in the Magento documentation.

screenshot of the Magento admin

Any advice would be greatly appreciated. Thank you!

Siarhey Uchukhlebau
16.2k11 gold badges57 silver badges89 bronze badges
asked May 11, 2014 at 3:27

2 Answers 2

1

The reason the Create permission is missing is that it's not in the api2.xml file for the Mage_Customers module. The _create method that is needed is also missing.

You can add the following to a custom module's api2.xml file to add the missing create permission.

<config>
 <api2>
 <resources>
 <customer>
 <privileges>
 <admin>
 <create>1</create>
 </admin>
 </privileges>
 </customer>
 </resources>
 </api2>
</config>

You'll also need to add the missing _create method by extending the Mage_Customer_Model_Api2_Customer_Rest_Admin_V1 class.

Siarhey Uchukhlebau
16.2k11 gold badges57 silver badges89 bronze badges
answered Jul 6, 2015 at 14:29
1
  • If i try to get customer list using REST API i am getting error -> screenshot -> snag.gy/3PSxvm.jpg -> URL -> 127.0.0.1/anusthana/api/rest/customers. and if i try to get products its working -> screenshot -> snag.gy/sePpyw.jpg -> url 127.0.0.1/anusthana/api/rest/products, can i get help regard customer API error? @Siarhey Uchukhlebau Commented Oct 24, 2018 at 8:41
0

While developing a website we found that many "write" operations for REST APIs were not working very well. Our general solution was to use SOAP for writes and REST for reads, as REST is slightly faster than SOAP.

7ochem
7,61516 gold badges54 silver badges82 bronze badges
answered May 17, 2014 at 18:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.