The Manage Funding Element allows users to enhance their shipping operations by enabling auto-funding and establishing funding rules tailored to their specific shipping volumes. This helps streamline shipping processes, ensuring adequate funds based on predefined criteria.
This can be used as a stand-alone Element and/or utilized within the Carrier Services Element.
import { ManageFunding, ElementsProvider } from '@shipengine/elements';
import { themeConfig } from '../themeConfig';
const tokenPath = '/path/to/token/endpoint';
const Foo = () => {
const getToken = useCallback(() => {
return fetch(tokenPath).then((res) => res.text());
}, []);
return (
<ElementsProvider
getToken={getToken}
themeConfig={themeConfig}
onError={handleError}
>
<ManageFunding.Element />
</ElementsProvider>
);
};// Creates a new instance of the Elements SDK.
const elements = new ElementsSDK(getToken, {
onError: (err: Error) => console.error(err),
themeConfig: themeConfig,
locale: 'en-US',
});
const manageFunding = elements.create('manageFunding');NOTE:
To access this Element, a seller must be onboarded with ShipEngine carrier account(s) and a valid payment method. These steps can be completed in the Onboarding Element.
| Args/Props | Description |
|---|---|
onRedirectToOnboarding | function, optional An optional callback that is triggered when the "Complete Onboarding" button is clicked. This button appears when a user who hasn't completed onboarding tries to access the Manage Funding Element, which requires an onboarded seller. We recommend using this callback to display the Onboarding Element. |