# Add Funding source using Plaid Token

**URL:** <https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151>\
**Category:** Funding Sources\
**Created:** [June 17, 2022, 6:57pm UTC](https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151 "2022-06-17T18:57:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heena](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@Heena](https://discuss.dwolla.com/u/Heena)\
**Post date:** [June 17, 2022, 6:57pm UTC](https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151/1 "2022-06-17T18:57:06Z")

</div>

Dear Support  
Please guide me about the following issue. I am trying to create funding source using Plaid Token using the CURL request attached below:

 ![image](https://global.discourse-cdn.com/dwolla/original/2X/2/2225ae72670f333fce39f06e8bd1d618b00b4b22.png)

But I am getting response (I have passed Customer Client Token as a Bearer):

```auto
stdClass Object
(
    [code] => InvalidScope
    [message] => Missing or invalid scopes for requested endpoint.
)

```

I also tried a request by using IAVToken, then I got following response:

```auto
stdClass Object
(
    [code] => InvalidAccessToken
    [message] => Invalid access token.
)

```

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![james](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/james/32/3524_2.png) [@james](https://discuss.dwolla.com/u/james)\
**Post date:** [June 21, 2022, 6:09pm UTC](https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151/2 "2022-06-21T18:09:30Z")

</div>

Hey, @Heena,

Thank you for reaching out!

I tried to look up some of these requests, and I was only able to find a few where `InvalidAccessToken` was returned. This is returned because the `Authorization` header did not contain a valid access token. Before sending a request to Dwolla, make sure that you have generated an [OAuth2 token](https://developers.dwolla.com/api-reference/authorization/application-authorization) that is subsequently supplied as an `Authorization` `Bearer` header.

As for `InvalidScope`, unfortunately, I was not able to find a request where this was returned in our logs; however, this has been known to happen in the past when the request body is not valid. For more information on the expected request body for creating a funding source via Plaid, I’d recommend checking out [this guide](https://developers.dwolla.com/guides/plaid/create-funding-source). Additionally, if you’d like to see a working example on create a Dwolla funding source using a Plaid token, we have an open-source project [dwolla-plaid-funding-source](https://github.com/Dwolla/integration-examples/tree/main/dwolla-plaid-funding-source) that should hopefully assist with this!

Finally, regarding the `InvalidScope` error, if you are able to send over the customer ID that this error is associated with as well as the approximate date/time that Dwolla sent this error to you, I can try to search in our logs again to see if I can find the specific request body that was sent.

Please let us know if you have any further questions!

Thanks,  
James

---

<div class="post-metadata">

**Author:** ![Heena](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@Heena](https://discuss.dwolla.com/u/Heena)\
**Post date:** [June 22, 2022, 1:10pm UTC](https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151/3 "2022-06-22T13:10:45Z")

</div>

Hi @james

Thank you for your reply. Let me try again and I will get back to you!!

---

<div class="post-metadata">

**Author:** ![Heena](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@Heena](https://discuss.dwolla.com/u/Heena)\
**Post date:** [June 23, 2022, 2:20pm UTC](https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151/4 "2022-06-23T14:20:30Z")

</div>

hi @james

I am able to create Funding Source using Plaid Token successfully. But the curl Response is empty from Dwolla side. Although Funding Source is added to my customer. Any suggestions regarding this?

I have got following response if I tried to send duplicate request, but not for First time request.

```auto
stdClass Object
(
    [code] => DuplicateResource
    [message] => Bank already exists: id=83abcb88-2c5a-4b7a-bc99-385ac771a0d6
    [_links] => stdClass Object
        (
            [about] => stdClass Object
                (
                    [href] => https://api-sandbox.dwolla.com/funding-sources/ ********-**** - ****-**** - ********
                    [type] => application/vnd.dwolla.v1.hal+json
                    [resource-type] => funding-source
                )

        )

)

```

---

<div class="post-metadata">

**Author:** ![james](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/james/32/3524_2.png) [@james](https://discuss.dwolla.com/u/james)\
**Post date:** [June 23, 2022, 6:38pm UTC](https://discuss.dwolla.com/t/add-funding-source-using-plaid-token/8151/5 "2022-06-23T18:38:01Z")

</div>

When a resource is created in Dwolla (i.e. HTTP status code `201 Created` is returned), the response body will be empty. To grab the newly-created resource, you will want to grab the `Location` header instead. Then, once you have the `Location` URL, you can call a `GET` request on it to grab the resource information.

As an example, let’s say that your application sent the following request to Dwolla:

```bash
POST https://api-sandbox.dwolla.com/customers/15e8df87-0bda-4fc9-8395-780aabe9ed92/funding-sources

Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer [YOUR OAUTH TOKEN HERE]
Content-Type: application/vnd.dwolla.v1.hal+json

{
  "routingNumber": "222222226",
  "accountNumber": "123456781",
  "type": "checking",
  "name": "Jane Doe - Checking"
}

...

HTTP/1.1 201 Created
Location: https://api-sandbox.dwolla.com/funding-sources/a72c694d-392e-4099-9872-d8fbbf1800a6

```

Now that you have the full URL for the created resource, you can execute a `GET` request on it:

```bash
GET https://api-sandbox.dwolla.com/funding-sources/a72c694d-392e-4099-9872-d8fbbf1800a6

Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer [YOUR OAUTH TOKEN HERE]
Content-Type: application/vnd.dwolla.v1.hal+json

... 

HTTP/1.1 200 OK
{
    "_links": { ... },
    "id": "a72c694d-392e-4099-9872-d8fbbf1800a6",
    "status": "unverified",
    "type": "bank",
    "bankAccountType": "checking",
    "name": "Jane Doe - Checking",
    "created": "2022-06-23T18:23:57.300Z",
    "removed": false,
    "channels": [
        "ach"
    ],
    "bankName": "SANDBOX TEST BANK",
    "fingerprint": "ea2f9562b698e1353d5c7e73b75dd5997de9a5329a7b7dd6f032a15352addec3"
}

```

For more information on these topics, I would recommend checking out our Developer Documentation on [creating a new funding source for a customer](https://developers.dwolla.com/api-reference/funding-sources/create-funding-source-for-customer#bank) and [retrieving a funding source](https://developers.dwolla.com/api-reference/funding-sources/retrieve#bank).

As for the error that you are seeing, when a funding source with the same account and routing number already exists _and is active_ for the specified customer, you will be unable to create a new funding source using the same values. Instead, you will either have to [remove the funding source](https://developers.dwolla.com/api-reference/funding-sources/remove) and then re-add it. Additionally, since you are integrating Plaid, you can choose to pair with a new bank, which should provide a different routing number, or you can select another account, such as a savings account versus a checking, which should provide a different account number.
