using MAgento API v2 in .net, I try to add a customer to a shopping-cart but I receive the error "The customer's identifier is not valid or customer is not existed".
Customer with id 1 does exist in Magento!!
Magento server is 1.7.0.2.
customerCustomerEntity customerCustomerEntity = client.customerCustomerInfo(sessionId, 1, null);
shoppingCartCustomerEntity shoppingCartCustomerEntity = return new shoppingCartCustomerEntity()
{
confirmation = customerCustomerEntity.confirmation.ToString(),
customer_id = customerCustomerEntity.customer_id,
email = customerCustomerEntity.email,
firstname = customerCustomerEntity.firstname,
group_id = customerCustomerEntity.group_id,
lastname = customerCustomerEntity.lastname,
mode = "customer",
store_id = customerCustomerEntity.store_id,
website_id = customerCustomerEntity.website_id,
};
int shoppingCartId= client.shoppingCartCreate(sessionId, 1);
bool shoppingCartCustomerSetResult = client.shoppingCartCustomerSet(sessionId, shoppingCartId, shoppingCartCustomerEntity, 1);
Thanks
I ran into the same problem. There is no documentation anywhere to allude to the solution/fix. I have found it and feel it worthy to still answer this older question for others who come across.
If you are setting the customer id, you also need to set customer_idSpecified to TRUE.
Then it works.
In your code above it would be:
You can actually just set it to 'true' manually as well but since you have already pulled the customer entity.
Hopefully you've already found the solution as well.
Shane