0

In our Webstore, a user can select a buyer account (from a list of accounts from the Account-Contact relationships) to create a webcart. But it looks like it's not allowed if the user's contact is not directly related to the Account (??). I got the following error:

ConnectApi.ConnectApiException: Argument: '{Account Id}' - You can't buy for this account.

The webcart is created successfully if the owner is directly related to the account.

Here's the sample code:

ConnectApi.CartInput cartInput = new ConnectApi.CartInput();
cartInput.effectiveAccountId = {related account Id};
cartInput.name = 'Some cart';
cartInput.type= ConnectApi.CartType.Cart;
ConnectApi.CommerceCart.createCart(storeId, cartInput);

Am I missing something? I can't find any doc regarding the direct contact limitation. If this is indeed a limitation, is there a way around this?

Cheers!

1 Answer 1

0

Found it! Apparently, I need to add the Contact-Account Buy access to the External Managed Accounts.

https://help.salesforce.com/articleView?id=sf.b2b_comm_lex_external_managed_accounts.htm&type=5

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .