The Referred Friend API allows you to manage referred friends in your referral program on your Wix site. With this API, you can create, retrieve, update, and delete referred friends, as well as query for specific referred friends based on various criteria.
With the Referred Friend API, you can:
It's important to note the following points before starting to code:
SIGN_UP_COMPLETED
, ACTIONS_COMPLETED
).To use the Friends API, install the @wix/referral
package using npm or Yarn:
npm install @wix/referral
or
yarn add @wix/referral
Then import { friends }
from @wix/referral
:
import { friends } from "@wix/referral";
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a new referred friend or returns an existing entity if it already exists.
This method must be called with a member identity.
A referral code must be provided either in the request or via scope.
The member must be eligible to become a referred friend.
function createReferredFriend(
options: CreateReferredFriendOptions,
): Promise<CreateReferredFriendResponse>;
import { friends } from "@wix/referral";
async function createReferredFriend(options) {
const response = await friends.createReferredFriend(options);
}
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.