This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a package of product instances.
You must pass the relevant Wix account ID in the header of the call. In the DIY flow, we recommend to pass the customer's sub-account ID instead of your main reseller account ID.
You may also pass a Wix site ID for each product in the body of the call. If you omit the site ID, a floating product instance is created.
When Wix customers purchase a specific paid service or product, Wix may offer
them time-limited free access to a different product. For example, customers
get a voucher for a free 1-year domain registration when purchasing any Wix
Premium plan. If you want to offer your customers the same benefit, create a
package containing the original product first. Then, create a second package
with the additional product. In the second Create Package call, pass the
instance ID of the original product as referenceProductInstanceId
. This way,
Wix doesn't charge you for the additional product. Make sure that the status
of the referenced product is either "PENDING"
or "ACTIVE"
. Note that you
can use each product instance only a single time as reference instance.
You need to pass a countryCode
to specify where customers can claim
vouchers that may come with a product. Contact the
Wix B2B sales team to get information about
vouchers and supported locations.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header.
function createPackageV2(
options: CreatePackageV2Options,
): Promise<CreatePackageResponse>;
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { packages } from "@wix/packages";
const wixClient = createClient({
modules: { packages },
auth: ApiKeyStrategy({
siteId: "MY-SITE-ID",
apiKey: "MY-API-KEY",
}),
});
async function createPackageV2(options) {
const response = await packages.createPackageV2(options);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a package.
You must pass the ID of the Wix account that the package belongs to in the header of the call. The call fails, if the package and Wix account don't match.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header.
function getPackage(_id: string): Promise<Package>;
Package ID.
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { packages } from "@wix/packages";
const wixClient = createClient({
modules: { packages },
auth: ApiKeyStrategy({
apiKey: "MY-API-KEY",
}),
});
async function getPackage(id) {
const response = await packages.getPackage(id);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of packages, given the provided paging, filtering, and sorting.
You must pass the ID of the Wix account that the packages belong to in the
header of the call. The call returns packages that belong to the parent
account, regardless if you pass the ID of a parent or sub-account. In case
you want to retrieve only packages that belong to a sub-account, you must
pass the sub-account ID as filter
in the query
object like this:
Query Packages runs with these defaults, which you can override:
createdDate
is sorted in DESC
ordercursorPaging.limit
is 100
By default pagingMetadata.cursors
are returned, unless you specifically pass
query.paging
.
The maximum for cursorPaging.limit
is 100
.
If you pass a cursor token that you have received in a previous Query Package response, passing additional sort or filter information results in an invalid cursor error. Since the received cursor token already holds all the needed information for sort and filter. Changing the sort and filter properties during the span of a cursor query isn't supported. But you can provide a different limit.
For field support for filters and sorting, see Query Packages: Supported Filters and Sorting.
To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header.
function queryPackages(): PackagesQueryBuilder;
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { packages } from "@wix/packages";
const wixClient = createClient({
modules: { packages },
auth: ApiKeyStrategy({
apiKey: "MY-API-KEY",
}),
});
async function queryPackages() {
const { items } = await packages.queryPackages().find();
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Unassigns a product instance from a site.
You must pass the ID of the Wix account that the product instance belongs to in the header of the call.
The product instance becomes floating and the customer immediately looses access to features included in the unassigned service. It's up to the reseller to decide whether unassigning a product instance affects the customer’s payment.
If an unassigned product instance is a requirement for another service, that service may not be available to the customer any longer. For example, if you unassign a Combo Plan
plan from a site, a previously connected domain is disconnected.
You can assign floating product instances to sites using the Assign Product Instance to Site method.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header.
function unassignProductInstanceFromSite(
instanceId: string,
options: UnassignProductInstanceFromSiteOptions,
): Promise<UnassignProductInstanceFromSiteResponse>;
ID of the product instance to unassign from a site.
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { packages } from "@wix/packages";
const wixClient = createClient({
modules: { packages },
auth: ApiKeyStrategy({
siteId: "MY-SITE-ID",
apiKey: "MY-API-KEY",
}),
});
async function unassignProductInstanceFromSite(instanceId, options) {
const response = await packages.unassignProductInstanceFromSite(
instanceId,
options,
);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates a package's external ID field.
function updatePackageExternalId(
identifiers: UpdatePackageExternalIdIdentifiers,
): Promise<UpdatePackageExternalIdResponse>;
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { packages } from "@wix/packages";
const wixClient = createClient({
modules: { packages },
auth: ApiKeyStrategy({
apiKey: "MY-API-KEY",
}),
});
async function updatePackageExternalId(identifiers) {
const response = await packages.updatePackageExternalId(identifiers);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.