Due to business and technical requirements, all customers must have an associated billing address when they're first created. We've got this working great on the frontend and backend; however, there's currently no way to pass the address via the customerCustomerCreate
v2 SOAP method.
Is it possible to somehow extend this method to accept the following billing address fields?
- Street
- City
- State
- Zip
- Country
If so:
- How would I add these to the WSDL?
- How would I convert the submitted API data into an associated address? Is there some event I could observe?
Thanks!
Best Answer
I think the best approach would be to implement your own API method based on existing customer and address methods. You'll have to create a custom module.
Module structure:
etc/api.xml
etc/wsdl.xml
Model/Customer/Api.php
Model/Customer/Api/V2.php
And that's it. Code could use some minor tuning but it works. I did not include
etc/config.xml
as it's already a long answer and you can easily figure it out on your own.And finally the sample API call: