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.
Component | Component Name | Possible Actions |
---|---|---|
Create a Receive-only User | dwolla-customer-create | customer.create |
Create an Unverified Customer | dwolla-customer-create | customer.create |
Upgrade an Unverified Customer | dwolla-customer-update | customer.read customer.update |
Create a personal Verified Customer | dwolla-personal-vcr | customer.create customer.read customer.update customer.documents.create |
Create a business Verified Customer | dwolla-business-vcr | customer.create customer.read customer.update customer.documents.create businessclassifications.read |
Create Beneficial Owners | dwolla-beneficial-owners | beneficialowners.create beneficialowners.read beneficialowners.update beneficialowners.delete beneficialownership.read beneficialownership.certify beneficialowner.documents.create customer.read customer.update |
Document upload for a Customer or Beneficial Owner | dwolla-document-upload | customer.read customer.documents.create customer.documents.read beneficialowners.read beneficialowner.documents.create |
Create a Funding Source | dwolla-funding-source-create | customer.fundingsources.create customer.microdeposits.create |
Verify Micro Deposits | dwolla-micro-deposits-verify | customer.fundingsources.read, customer.microdeposits.verify |
Display a Verified Customer’s Balance | dwolla-balance-display | customer.fundingsources.read |
Pay-in | dwolla-payin | customer.fundingsources.read customer.transfers.send |
POST https://api.dwolla.com/client-tokens
Parameter | Required | Type | Description |
---|---|---|---|
action | yes | object | A granular permission for the Customer performing an action within a drop-in component. Reference the client token actions to learn more. |
_links | yes | object | A _links JSON object that contains a link to the desired customer performing the action within the drop-in component. |
POST https://api-sandbox.dwolla.com/client-tokens
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/json
Authorization: Bearer {{token}}
{
"action": "customer.update”,
"_links": {
“customer”: {
“href”: “https://api-sandbox.dwolla.com/customers/{{customerId}}”
}
}
}
...
{
"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.
Parameter | Type | Description |
---|---|---|
environment | string | Acceptable values of: sandbox or production |
styles | string | Optional. A relative or absolute URL linking to a hosted stylesheet containing component styles. |
token | function | A function that gets called by the component for fetching client-tokens as needed throughout the flow. Example usage: token: (req) => Promise.resolve(dwollaAPIToken(req, {blah: "abcd"})) |
tokenUrl | function | A URL pointing to a server-side endpoint that can be used to generate client-token. Example usage: tokenUrl: "tokenUrl" |
success | function | A function that gets called upon a successful request from the Component. |
error | function | A function that gets called when an error occurs in the Component. |
<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>
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.