getAccountBySecondaryId( )


Retrieves the loyalty account of the specified site contact or member.

The getAccountBySecondaryId() function returns a Promise that resolves to the specified loyalty account when it is retrieved.

This function gets a loyalty account using either a customer's contact ID or member ID. You can also get an account using the loyalty account ID with the getAccount() function.

Note: Only visitors with Manage Loyalty permissions can retrieve a loyalty account.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Method Declaration
Copy
function getAccountBySecondaryId(
  options: GetAccountBySecondaryIdOptions,
): Promise<GetAccountBySecondaryIdResponse>;
Method Parameters
optionsGetAccountBySecondaryIdOptions

ID of the customer to retrieve loyalty account for.

Returns
Return Type:Promise<GetAccountBySecondaryIdResponse>
JavaScript
import { accounts } from "@wix/loyalty"; async function getAccountBySecondaryId(options) { const response = await accounts.getAccountBySecondaryId(options); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?