Is there anyway to create a customer programmatically like you can with a WordPress user. Obviously the WooCommerce user shares some of the same WordPress user fields, there there is additional content that would need to be set like Billing / Postal address.
Has anyone achieved this before? I can't find anything in the WooCommerce API / functions list on their website.
EDIT: Just found this: http://docs.woothemes.com/wc-apidocs/function-wc_create_new_customer.html
But how can I then provide other field details (like addresses).
WooCommerce customer is essentially a WordPress user with extra metadata. So once the user is created you can add metadata to it by using update_user_meta
function. Navigate to Users -> All Users, edit one of the users and then scroll down to see the fields.
Made up code given below to give you the gist of how it works.
$user_id = wc_create_new_customer( $email, $username, $password );
update_user_meta( $user_id, "billing_first_name", 'God' );
update_user_meta( $user_id, "billing_last_name", 'Almighty' );
.... more fields
Here is the full list of billing and shipping fields
Billing
Shipping