> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: previewOfflineOrder(planId: string, buyerId: string, options: PreviewOfflineOrderOptions) # Method package: wixPricingPlansBackend # Method menu location: wixPricingPlansBackend --> Checkout --> previewOfflineOrder # Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/checkout/preview-offline-order.md # Method Description: Provides a preview of an offline order as if it was purchased. The `previewOfflineOrder()` function returns a Promise that resolves to a temporary preview of the offline order. 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's `_id` and `subscriptionId` properties are displayed as a string of multiple zero characters (`000000-0000`). If [taxes are configured for the site](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection), taxes are applied to the preview. If not, the `tax` previews as `null`. You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. 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`. This function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [previewPrice()](wix-pricing-plans-backend/checkout/preview-price) function. > **Note**: Only those with the **Manage Pricing Plans** and **Manage Subscriptions** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions/roles) > can preview offline orders. You can override the permissions by setting the function's `suppressAuth` > option to `true`. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Preview an offline order as if it was purchased, bypassing permission checks ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { checkout } from 'wix-pricing-plans-backend'; /* Sample planId value: '7251b9e9-3852-4e9f-958e-af630f039802' * * Sample buyerId value: '4c47c608-cfa8-4037-93ac-738f09560ed3' * * Sample options value: * { * startDate: new Date('July 17, 2022 10:00:00'), * suppressAuth: true * } */ export const myPreviewOfflineOrderFunction = webMethod(Permissions.Anyone, async (planId, buyerId, options) => { try { const preview = await checkout.previewOfflineOrder(planId, buyerId, options); const maxReached = preview.purchaseLimitExceeded; const orderPricing = preview.order.pricing; return preview; } catch (error) { console.error(error); } }); /* Promise resolves to: * * { * "order": { * "_id": "00000000-0000-0000-0000-000000000000", * "planId": "7251b9e9-3852-4e9f-958e-af630f039802", * "subscriptionId": "00000000-0000-0000-0000-000000000000", * "buyer": { * "memberId": "4c47c608-cfa8-4037-93ac-738f09560ed3", * "contactId": "4c47c608-cfa8-4037-93ac-738f09560ed3" * }, * "priceDetails": { * "subtotal": "0", * "discount": "0", * "total": "0", * "planPrice": "0", * "currency": "USD", * "singlePaymentUnlimited": true * }, * "pricing": { * "singlePaymentUnlimited": true, * "prices": [ * { * "duration": { * "cycleFrom": 1, * "numberOfCycles": 1 * }, * "price": { * "subtotal": "0", * "discount": "0", * "total": "0", * "currency": "USD" * } * } * ] * }, * "type": "OFFLINE", * "orderMethod": "UNKNOWN", * "status": "ACTIVE", * "lastPaymentStatus": "PAID", * "startDate": "2022-07-17T10:00:00.000Z", * "pausePeriods": [], * "planName": "Family Cooking", * "planDescription": "Weekly delivery of home cooking recipes and time-saving tips", * "planPrice": "0", * "_createdDate": "2022-07-13T04:54:23.503Z", * "_updatedDate": "2022-07-13T04:54:23.503Z" * }, * "purchaseLimitExceeded": false * } */ ``` ---