0

Using \Magento\Customer\Api\Data\CustomerRepository Save method we can create single customer with the attributes in \Magento\Customer\Api\Data\CustomerInterfacewith single API request.

But how can we create multiple customers at a time with single API request.

If i send multiple customers objects in a single request its giving error expecting the \Magento\Customer\Api\Data\CustomerInterface attributes.

So how can i create API with \Magento\Customer\Api\Data\CustomerRepository Save method with array of \Magento\Customer\Api\Data\CustomerInterface attributes

asked Oct 6, 2015 at 10:34

1 Answer 1

0

You have 2 option.

  • Send many request
  • Create service that gets list of customers and save it use Customer Repository
answered Oct 6, 2015 at 11:44
7
  • When i use first option its giving error, expecting \Magento\Customer\Api\Data\CustomerInterface attributes. For second option please provide example which works Commented Oct 6, 2015 at 11:56
  • what is the importance of KEY keyword in api, example github.com/magento/magento2/blob/develop/app/code/Magento/… compared to other attributes which do not have KEY keyword Commented Oct 6, 2015 at 12:25
  • gist.github.com/kandy/dd6592508c5774d9235d Commented Oct 6, 2015 at 12:38
  • you are calling customer request api each time for the each customer, but i want to send multiple customers in a single request Commented Oct 7, 2015 at 7:11
  • Magento 2 don't have this possibility, but you create simple module for this Commented Oct 7, 2015 at 8:02

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.