How do I create an instance of an entity with all its fields attached? I am trying to create an instance of 'commerce_customer_profile' entity with all the extra fields of the customers address.

I am doing this inside a FeedsProcessor that will import users and their addresses from Magento.

I don't want to have to create a fake $form_state array and then use field_attach_submit() as it doesn't seem right to me.

The only other way I have found so far is:

$billing_profile = commerce_customer_profile_new('billing', $entity-&gt;uid);
commerce_customer_profile_save($billing_profile);
$full_billing_profile = commerce_customer_profile_load($billing_profile-&gt;profile_id);


$entity is the current user being created.

Which will then give me an empty instance of the new entity ready to populate and save but again it doesn't feel right.

Any help appreciated.
for nodes we can do below codes to load all fields and display formatters aplyed on them:

$node = node_load($nid);
field_attach_prepare_view('node', array($node-&gt;nid =&gt; $node), 'teaser');
$fields = field_attach_view('node', $node, 'teaser'); 


similar way should be exists for commerce