UNPKG

@beamimpact/web-sdk

Version:

The Beam SDK enables brands to connect with their customers over shared values, not transactional discounts, to build stronger loyalty. Our integration achieves this by allowing customers to (a) choose a nonprofit where the brand will donate part of their

836 lines 438 kB
/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ interface paths { "/chain/{chainId}/nonprofits": { get: { parameters: { path: { chainId: number; }; query: { /** Postal code used to find relevant nonprofits */ postalCode?: string; /** Country code used to find relevant nonprofits */ countryCode?: string; /** * For chains with more than one store, storeId. * If postal code and storeId are sent, storeId acts as fallback * if no local nonprofits are found near postal code. */ storeId?: number; /** Language code. */ lang?: "en" | "fr" | "de" | "es" | "it" | "pl" | "ja"; /** The type of view to fetch the config for */ widgetName: "select-nonprofit" | "redeem-transaction"; /** The version of the config */ version: string; }; }; responses: { /** List of all of the non-profits for the chain and their impact */ 200: { content: { "application/json": { chain: { name: string; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ logoUrl: string | null; /** * @description Image pre baked with partner logo next to Beam logo * @example https://cdn.beamimpact.com/logos/beam.png */ logoLockupUrl?: string | null; /** * @description A URL string, but can be null * @example https://beamimpact.com */ communityImpactUrl: string | null; donationTypeName: string | null; matchDonationTypeName: string | null; }; config: { web: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** @description Subtitle/description for the widget */ description: string; /** * @description The prefix promo description for the widget for web * @example At no extra cost, */ promoDescriptionPrefix?: string; /** * @description The promo description for the widget for web * @example choose your impact and 1% of your purchase will be donated. */ promoDescription?: string; /** * @description confirm button * @example Confirm free donation */ confirmButton?: string; /** * @description copy once confirm button is clicked * @example Confirmed! */ confirmedButton?: string; /** * @description collapsed button copy * @example Choose a nonprofit */ collapsedButton?: string; /** @description Remote config theme data as requested by the given widgetName & version query params */ theme?: { [key: string]: unknown; } | null; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; /** @description An object containing dynamic strings for the widget. These strings serve as templates and include dynamic variables that vary based on the widget type. */ dynamicStrings?: { [key: string]: string; } | null; /** @description An object containing additional static strings specific to each widget. These strings are unique to the widget and are not shared across different widgets. */ additionalStrings?: { [key: string]: string; } | null; /** @description Disables counter animation for cumulative-impact widget */ disableAnimation?: boolean; /** @description promo copy is sent in this object to be used in conditionally rendered UI components. This object serves as a repository for server-generated copy */ promo?: { /** @example Donations are 2x for Black History Month */ "promo-text-long": string; /** @example Donations are 2x */ "promo-text-short": string; /** * @description replaces cause copy * @example 2x boosting donations */ "promo-cause-alt-text": string; }; }; mobileWeb?: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** * @description Subtitle/description for the widget * @example choose your impact and 1% of your purchase will be donated. */ description: string; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; }; mobile: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** * @description Subtitle/description for the widget * @example choose your impact and 1% of your purchase will be donated. */ description: string; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; }; /** * @description determines if a chain can enable nonprofit deselection for the select-nonprofit widget * @default false */ enableNonprofitDeselection?: boolean; } & { web?: { /** @example Confirm */ redeemButtonText?: string; }; mobileWeb?: { /** @example Confirm */ redeemButtonText?: string; }; mobile?: { /** @example Confirm */ redeemButtonText?: string; }; }; /** @description The list of non-profits, sorted on server */ nonprofits: { imageUrl: Partial<string | null> & Partial<string | null>; nonprofit: { /** * @description Numeric ID * @example 1001 */ id: number; /** @example LA Regional Food Bank */ name: string; /** @example Food Security */ cause: string | null; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ causeIconUrl: string | null; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ causeIconSelectedUrl: string | null; /** * @description Hex code of the color for the nonprofit when it is selected * @example #000000 */ causeColor: string | null; extensibility?: { /** @description The cause icon for the extensibility widgets due to color scheme limitations */ causeIconUrl?: string | null; /** @description The cause selected icon for the extensibility widgets due to color scheme limitations */ causeIconSelectedUrl?: string | null; /** @description The cause selected icon with a background the post purchase extensibility widget due to color scheme limitations */ causeIconAndBackgroundUrl?: string | null; }; /** * @description A URL string * @example https://beamimpact.com */ website: string | null; /** @example Learn More */ websiteLinkText: string; /** * @description a label that can be used for location * @example Hawaii */ badge?: string; /** @description should include nonprofit in personal impact */ includeInPersonalImpact?: boolean; }; impact: { /** * @description The description of the funding * @example <b>Fund</b> 10 sewing machines... */ description: string | null; /** * @description The string representing the number of times the goal has been completed * @example <b>Funded</b> 2 times so far */ goalCompletionText: string; /** * @description The text next to the progress bar * @example 54% funded */ goalProgressText: string; /** * @description The progress towards the next goal completion * @example 41 */ goalProgressPercentage: number; }; promo?: { type?: string; isActive: boolean; /** * @description When a promo is active, the total amount donated is multiplied by this value. ex:\ (subtotal * donationAmount) * multiplier -> ($100 * 1%) * 2 = $2.00 donated * @example 2 */ multiplier: number | null; } | null; }[]; /** @description a site-specific identifier */ store: { id: number; }; /** @description regional store based on request query parameters */ region: { id: string | null; }; promos?: { validatedPromoCodes: { /** @description promoCodeId */ promoCodeId: string | null; promoCodeGroupId?: string | null; promoId?: number; /** * Format: date-time * @description ISO formatted date * @example 2023-04-19T03:23:59.301Z */ validatedAt: string; apply: boolean; }[]; }; /** @description Extensibility-related settings */ extensibility?: { /** * @description Whether to exclude B2B orders from reporting and from seeing Beam widgets * @example true */ excludeB2BOrders?: boolean; }; settings?: { excludeDonationsForRecurringTransactions: boolean; }; }; }; }; /** Standard error */ default: { content: { "application/json": { /** @description Beam code for the error, meant to be used programmatically */ code: string; /** @description A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization */ title: string; /** @description A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized */ detail: string; /** @description a JSON Pointer to the associated entity in the request document */ field?: string; /** @description A meta object containing non-standard meta-information about the error */ metadata?: { [key: string]: unknown; }; /** @description Whether the API or user can resend the request */ retryable?: boolean; } & { source: unknown; meta: unknown; }; }; }; }; }; }; "/chain/{chainId}/cumulativeImpact": { get: { parameters: { path: { /** The ID of the chain. Must be greater than 0 */ chainId: number; }; query: { /** Language code. */ lang?: "en" | "fr" | "de" | "es" | "it" | "pl" | "ja"; version: string; /** When set to true, draft themes are returned */ draftConfig?: boolean; }; }; responses: { /** Combined impact for all the causes the chain supports */ 200: { content: { "application/json": { /** * @description Numeric ID * @example 1001 */ id?: number; chain?: { name: string; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ logoUrl: string | null; /** * @description Image pre baked with partner logo next to Beam logo * @example https://cdn.beamimpact.com/logos/beam.png */ logoLockupUrl?: string | null; /** * @description A URL string, but can be null * @example https://beamimpact.com */ communityImpactUrl: string | null; donationTypeName: string | null; matchDonationTypeName: string | null; }; config?: { web: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** @description Subtitle/description for the widget */ description: string; /** * @description The prefix promo description for the widget for web * @example At no extra cost, */ promoDescriptionPrefix?: string; /** * @description The promo description for the widget for web * @example choose your impact and 1% of your purchase will be donated. */ promoDescription?: string; /** * @description confirm button * @example Confirm free donation */ confirmButton?: string; /** * @description copy once confirm button is clicked * @example Confirmed! */ confirmedButton?: string; /** * @description collapsed button copy * @example Choose a nonprofit */ collapsedButton?: string; /** @description Remote config theme data as requested by the given widgetName & version query params */ theme?: { [key: string]: unknown; } | null; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; /** @description An object containing dynamic strings for the widget. These strings serve as templates and include dynamic variables that vary based on the widget type. */ dynamicStrings?: { [key: string]: string; } | null; /** @description An object containing additional static strings specific to each widget. These strings are unique to the widget and are not shared across different widgets. */ additionalStrings?: { [key: string]: string; } | null; /** @description Disables counter animation for cumulative-impact widget */ disableAnimation?: boolean; /** @description promo copy is sent in this object to be used in conditionally rendered UI components. This object serves as a repository for server-generated copy */ promo?: { /** @example Donations are 2x for Black History Month */ "promo-text-long": string; /** @example Donations are 2x */ "promo-text-short": string; /** * @description replaces cause copy * @example 2x boosting donations */ "promo-cause-alt-text": string; }; }; mobileWeb?: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** * @description Subtitle/description for the widget * @example choose your impact and 1% of your purchase will be donated. */ description: string; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; }; mobile: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** * @description Subtitle/description for the widget * @example choose your impact and 1% of your purchase will be donated. */ description: string; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; }; /** * @description determines if a chain can enable nonprofit deselection for the select-nonprofit widget * @default false */ enableNonprofitDeselection?: boolean; }; /** @description The list of cumulative impacts */ impacts?: { /** * @description The summary of the cause * @example Days of daily hot meals */ summary?: string; /** * @description The unit that describes the values * @example Meals */ unit?: string; /** * @description The amount of impact in regards to the unit for that impact * @example 100 */ value?: number; }[]; }; }; }; /** Standard error */ default: { content: { "application/json": { /** @description Beam code for the error, meant to be used programmatically */ code: string; /** @description A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization */ title: string; /** @description A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized */ detail: string; /** @description a JSON Pointer to the associated entity in the request document */ field?: string; /** @description A meta object containing non-standard meta-information about the error */ metadata?: { [key: string]: unknown; }; /** @description Whether the API or user can resend the request */ retryable?: boolean; } & { source: unknown; meta: unknown; }; }; }; }; }; }; "/chainStores": { get: { responses: { /** A list of objects that contain both the id and custom store id for each store associated with the chain */ 200: { content: { "application/json": { stores: { id: number; customId: string; }[]; }; }; }; /** Standard error */ default: { content: { "application/json": { /** @description Beam code for the error, meant to be used programmatically */ code: string; /** @description A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization */ title: string; /** @description A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized */ detail: string; /** @description a JSON Pointer to the associated entity in the request document */ field?: string; /** @description A meta object containing non-standard meta-information about the error */ metadata?: { [key: string]: unknown; }; /** @description Whether the API or user can resend the request */ retryable?: boolean; } & { source: unknown; meta: unknown; }; }; }; }; }; }; "/chain/findEligibleNonprofitsForCart": { post: { responses: { /** List of all the non-profits for the given transaction and their impact. */ 200: { content: { "application/json": { chain: { name: string; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ logoUrl: string | null; /** * @description Image pre baked with partner logo next to Beam logo * @example https://cdn.beamimpact.com/logos/beam.png */ logoLockupUrl?: string | null; /** * @description A URL string, but can be null * @example https://beamimpact.com */ communityImpactUrl: string | null; donationTypeName: string | null; matchDonationTypeName: string | null; }; config: { web: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** @description Subtitle/description for the widget */ description: string; /** * @description The prefix promo description for the widget for web * @example At no extra cost, */ promoDescriptionPrefix?: string; /** * @description The promo description for the widget for web * @example choose your impact and 1% of your purchase will be donated. */ promoDescription?: string; /** * @description confirm button * @example Confirm free donation */ confirmButton?: string; /** * @description copy once confirm button is clicked * @example Confirmed! */ confirmedButton?: string; /** * @description collapsed button copy * @example Choose a nonprofit */ collapsedButton?: string; /** @description Remote config theme data as requested by the given widgetName & version query params */ theme?: { [key: string]: unknown; } | null; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; /** @description An object containing dynamic strings for the widget. These strings serve as templates and include dynamic variables that vary based on the widget type. */ dynamicStrings?: { [key: string]: string; } | null; /** @description An object containing additional static strings specific to each widget. These strings are unique to the widget and are not shared across different widgets. */ additionalStrings?: { [key: string]: string; } | null; /** @description Disables counter animation for cumulative-impact widget */ disableAnimation?: boolean; /** @description promo copy is sent in this object to be used in conditionally rendered UI components. This object serves as a repository for server-generated copy */ promo?: { /** @example Donations are 2x for Black History Month */ "promo-text-long": string; /** @example Donations are 2x */ "promo-text-short": string; /** * @description replaces cause copy * @example 2x boosting donations */ "promo-cause-alt-text": string; }; }; mobileWeb?: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** * @description Subtitle/description for the widget * @example choose your impact and 1% of your purchase will be donated. */ description: string; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; }; mobile: { /** * @description Header/title for the widget * @example Choose your impact */ title: string; /** * @description Subtitle/description for the widget * @example choose your impact and 1% of your purchase will be donated. */ description: string; /** * @description nonprofit Selected Header for select-nonprofit-cta widget * @example Your impact */ nonprofitSelectedHeader?: string; /** * @description nonprofit Unselected Header for select-nonprofit-cta widget * @example Make your purchase a force for good */ nonprofitUnselectedHeader?: string; }; /** * @description determines if a chain can enable nonprofit deselection for the select-nonprofit widget * @default false */ enableNonprofitDeselection?: boolean; } & { web?: { /** @example Confirm */ redeemButtonText?: string; }; mobileWeb?: { /** @example Confirm */ redeemButtonText?: string; }; mobile?: { /** @example Confirm */ redeemButtonText?: string; }; }; /** @description The list of non-profits, sorted on server */ nonprofits: { imageUrl: Partial<string | null> & Partial<string | null>; nonprofit: { /** * @description Numeric ID * @example 1001 */ id: number; /** @example LA Regional Food Bank */ name: string; /** @example Food Security */ cause: string | null; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ causeIconUrl: string | null; /** * @description URL including file extension, e.g., an image path * @example https://cdn.beamimpact.com/logos/beam.png */ causeIconSelectedUrl: string | null; /** * @description Hex code of the color for the nonprofit when it is selected * @example #000000 */ causeColor: string | null; extensibility?: { /** @description The cause icon for the extensibility widgets due to color scheme limitations */ causeIconUrl?: string | null; /** @description The cause selected icon for the extensibility widgets due to color scheme limitations */ causeIconSelectedUrl?: string | null; /** @description The cause selected icon with a background the post purchase extensibility widget due to color scheme limitations */ causeIconAndBackgroundUrl?: string | null; }; /** * @description A URL string * @example https://beamimpact.com */ website: string | null; /** @example Learn More */ websiteLinkText: string; /** * @description a label that can be used for location * @example Hawaii */ badge?: string; /** @description should include nonprofit in personal impact */ includeInPersonalImpact?: boolean; }; impact: { /** * @description The description of the funding * @example <b>Fund</b> 10 sewing machines... */ description: string | null; /** * @description The string representing the number of times the goal has been completed * @example <b>Funded</b> 2 times so far */ goalCompletionText: string; /** * @description The text next to the progress bar * @example 54% funded */ goalProgressText: string; /** * @description The progress towards the next goal completion * @example 41 */ goalProgressPercentage: number; }; promo?: { type?: string; isActive: boolean; /** * @description When a promo is active, the total amount donated is multiplied by this value. ex:\ (subtotal * donationAmount) * multiplier -> ($100 * 1%) * 2 = $2.00 donated * @example 2 */ multiplier: number | null; } | null; }[]; /** @description a site-specific identifier