> 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 # CreateLoyaltyImportFileUrl # Package: accounts # Namespace: LoyaltyImports # Method link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/accounts/imports/create-loyalty-import-file-url.md ## Permission Scopes: Manage Loyalty: SCOPE.DC-LOYALTY.MANAGE-LOYALTY ## Introduction Creates a URL for uploading a loyalty import file. This method is the first step in the loyalty import process. It returns a file path and an upload URL, which you'll use in subsequent steps of the import process. --- ## REST API ### Schema ``` Method: createLoyaltyImportFileUrl Description: Creates a URL for uploading a loyalty import file. This method is the first step in the loyalty import process. It returns a file path and an upload URL, which you'll use in subsequent steps of the import process. URL: https://www.wixapis.com/v1/loyalty-imports/wixmp-upload-url Method: POST Return type: CreateLoyaltyImportFileUrlResponse - name: filePath | type: string | description: Path where the file will be stored. - name: uploadUrl | type: string | description: URL for uploading the loyalty import file. ``` ### Examples ### Create Loyalty import file url ```curl curl -X POST \ 'https://www.wixapis.com/_api/loyalty-imports/v1/loyalty-imports/wixmp-upload-url' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{}' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.accounts.LoyaltyImports.createLoyaltyImportFileUrl() Description: Creates a URL for uploading a loyalty import file. This method is the first step in the loyalty import process. It returns a file path and an upload URL, which you'll use in subsequent steps of the import process. Return type: PROMISE - name: filePath | type: string | description: Path where the file will be stored. - name: uploadUrl | type: string | description: URL for uploading the loyalty import file. ``` ### Examples ### createLoyaltyImportFileUrl ```javascript import { imports } from '@wix/loyalty'; async function createLoyaltyImportFileUrl() { const response = await imports.createLoyaltyImportFileUrl(); }; ``` ### createLoyaltyImportFileUrl (with elevated permissions) ```javascript import { imports } from '@wix/loyalty'; import { auth } from '@wix/essentials'; async function myCreateLoyaltyImportFileUrlMethod() { const elevatedCreateLoyaltyImportFileUrl = auth.elevate(imports.createLoyaltyImportFileUrl); const response = await elevatedCreateLoyaltyImportFileUrl(); } ``` ### createLoyaltyImportFileUrl (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { imports } from '@wix/loyalty'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { imports }, // Include the auth strategy and host as relevant }); async function createLoyaltyImportFileUrl() { const response = await myWixClient.imports.createLoyaltyImportFileUrl(); }; ``` ---