Dwolla Drop-in Components Part ll: Upgrading an Unverified Customer
Published: 2020-12-15 16:11:02

Because an Unverified Customer has basic capabilities in the Dwolla ecosystem, there may be instances where this customer type will need to be upgraded—like if your Unverified Customer needs to send more than $5,000 per week. Upgrading an Unverified Customer to a Verified Customer will give them the ability to increase their transaction limits. For more information on the difference between an Unverified and Verified Customer, visit our docs on [concepts](https://developers.dwolla.com/concepts/customer-types#customer-types). 

Prior to using this low-code drop-in, make sure you have created an Unverified Customer, using our [`Create an Unverified Customer`](https://dev.to/dwolla/dwolla-drop-in-components-low-code-components-for-integrating-a-payment-api-2ija) drop-in, by specifying the `firstName`, `lastName` and `email` parameters. 

Visit Part l of the `Dwolla Drop-in Component Series` if you haven’t already created an Unverified Customer type for more clarity.

```
POST https://api-sandbox.dwolla.com/customers
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/json
Authorization: Bearer {{token}}

{
    "firstName": "Unverified",
    "lastName": "Customer",
    "email": "unverifiedCustomer@email.com"
}

HTTP/1.1 201 Created
Location: https://api-sandbox.dwolla.com/customers/fc451a7a-ae30-4404-aB95-e3553fcd733f


```

For additional information on creating an Unverified Customer, check out our [developer documentation](https://docs.dwolla.com/#create-a-customer).

## Upgrade an Unverified Customer

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/egleieufxmdc3xvjf2z8.png)

The steps for this component assume that you have already integrated the Dwolla Drop-in library. Please view the `Getting Started` section on [Part l](https://dev.to/dwolla/dwolla-drop-in-components-low-code-components-for-integrating-a-payment-api-2ija) of this blog series if you have not done so already.

#### 1. Generate a Client Token
```
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}}”
    }
  }
}
```

#### 2. Configure the Dwolla Object <br>```
<script src="https://cdn.dwolla.com/v2/dwolla-web.js"></script>
<script>
   dwolla.configure({
     environment: "sandbox",
     styles: "/main.css",
     token: () => Promise.resolve("your_token"),
     success: (res) => alert(res),
     error: (err) => alert(err)
   });
</script>

<div class="customer">
  <dwolla-customer-update 
      customerId="customerId"
      firstName=”firstName”
      lastName=”lastName”
      email=”email”
      terms=”https://www.yourterms.com”
      privacy=”https://www.yourprivacy.com”>       
  </dwolla-customer-update >
</div>

```

### Solutions for Possible Errors

1. Invalid Token
Make sure that the token generated was copied + pasted correctly. If you are using the sandbox to test out this drop-in component, your token can be generated in the “Applications Tab” found after login. Tokens are valid for 60 minutes.

2. customerId
A missing or invalid customerId will trigger an error as one is required to upgrade an Unverified Customer. You can find your customerId in the [sandbox](https://accounts-sandbox.dwolla.com/login) after customer creation.

### Styling
By default, the elements within your specified container are responsive to any change and screen size. Dwolla also allows you to customize the styling of your components by providing a stylesheet to dwolla.configure containing the attributes found here.

### Try It Out and Join the Discussion
Check out our [open-source project](https://github.com/Dwolla/drop-ins-examples) and visit our [discussion forum](https://discuss.dwolla.com/) for help or questions regarding our drop-in components. This is the first version of our low-code solution, and updates as well as additional components will be released in the future in order to make the integration of our programmable payments infrastructure faster and easier to use.

Check out the next component [Create a Personal Verified Customer](https://dev.to/dwolla/dwolla-drop-in-components-part-lll-create-a-personal-verified-customer-1fpe).