export type CreateApiMerchantIdLiasettingsAccountIdSetomnichannelexperienceArgs = {merchantId: string, accountId: string, country?: string | undefined, lsfType?: string | undefined, pickupTypes?: Array | undefined}; export type CreateApiMerchantIdLiasettingsAccountIdSetomnichannelexperienceOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sets the omnichannel experience for the specified country. Only supported for merchants whose POS data provider is trusted to enable the corresponding experience. For more context, see these help articles [about LFP](https://support.google.com/merchants/answer/7676652) and [how to get started](https://support.google.com/merchants/answer/7676578) with it. * * POST /{merchantId}/liasettings/{accountId}/setomnichannelexperience */ export const createApiMerchantIdLiasettingsAccountIdSetomnichannelexperience = async (args: CreateApiMerchantIdLiasettingsAccountIdSetomnichannelexperienceArgs, options?: CreateApiMerchantIdLiasettingsAccountIdSetomnichannelexperienceOptions) => { const {baseUrl = "https://shoppingcontent.googleapis.com/content/v2.1", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.country != null) query.append("country", String(args.country)) if (args.lsfType != null) query.append("lsfType", String(args.lsfType)) for (const item of args.pickupTypes ?? []) query.append("pickupTypes", String(item)) if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.merchantId))}/liasettings/${encodeURIComponent(String(args.accountId))}/setomnichannelexperience${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };