The client token API request requires an action
as well as a link
which points to the Customer that identifies the end-user performing the action within the drop-in component. The action
is a string that contains a granular permission for the Customer performing the action within a drop-in component. Note: This endpoint requires application authorization.
POST https://api.dwolla.com/client-tokens
customer
performing the action within the drop-in component.// Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-node
var requestBody = {
_links: {
customer: {
href:
"https://api-sandbox.dwolla.com/customers/707177c3-bf15-4e7e-b37c-55c3898d9bf4",
},
},
action: "customer.update",
};
dwolla.post("/client-tokens", requestBody).then((res) => res.body.token); // => '4adF858jPeQ9RnojMHdqSD2KwsvmhO7Ti7cI5woOiBGCpH5krY'
Client tokens are required during the configuration of drop-in components. There may be multiple isolated functions within a single drop-in flow that each require granularly scoped client-tokens for that specific action. For this reason, it is recommended that you set up a server-side endpoint for fetching client-tokens which the dwolla-web library can make HTTP calls to as needed throughout the lifecycle of a drop-in component. Check out Step 2 of our guide for more details on setting up a server-side endpoint for generating client tokens.
Check out the table below for the paramaters required during configuration.
sandbox
or production
token: (req) => Promise.resolve(dwollaAPIToken(req, {blah: "abcd"}))
tokenUrl: "tokenUrl"
<script>
dwolla.configure({
environment: "sandbox",
styles: "/styles/update-custom.css",
tokenUrl: "/tokenUrl",
// token: (req) => Promise.resolve(dwollaAPIToken(req, {blah: "abcd"})),
success: (res) => Promise.resolve(res),
error: (err) => Promise.resolve(err),
});
</script>
Use sandbox environment to test API requests.
All funds transfers made using the Dwolla Platform are performed by a financial institution partner, and any funds held in a Dwolla Balance are held by a financial institution partner. Learn more about our financial institution partners.