getOfflineOrderPreview( )


Performs a dry run of a purchase and provides an order preview.

The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually created, the preview order's orderId and subscriptionId are displayed as a string of multiple zero characters (000000-0000). Tax is only calculated if the site has it configured.
If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then purchaseLimitExceeded will return as true.

To get a general price preview for a plan that's not buyer-specific, call Get Price Preview.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Orders
Learn more about app permissions.
Method Declaration
Copy
function getOfflineOrderPreview(
  planId: string,
  memberId: string,
  options: GetOfflineOrderPreviewOptions,
): Promise<GetOfflineOrderPreviewResponse>;
Method Parameters
planIdstringRequired

ID of the plan of the previewed order.


memberIdstringRequired

Member ID of the buyer the previewed order is for, from the Members API.


optionsGetOfflineOrderPreviewOptions

Options for previewing the offline order.

Returns
Return Type:Promise<GetOfflineOrderPreviewResponse>
JavaScript
import { orders } from "@wix/pricing-plans"; async function getOfflineOrderPreview(planId, memberId, options) { const response = await orders.getOfflineOrderPreview( planId, memberId, options, ); }
Errors
428Failed Precondition

There are 8 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?