# Can Dwolla be integrated into a Wix site?

**URL:** <https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842>\
**Category:** General\
**Created:** [June 6, 2020, 7:21pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842 "2020-06-06T19:21:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scholar\_Bridge](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/scholar_bridge/32/2446_2.png) [@Scholar\_Bridge](https://discuss.dwolla.com/u/Scholar_Bridge)\
**Post date:** [June 6, 2020, 7:21pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/1 "2020-06-06T19:21:19Z")

</div>

If it cannot, can it be integrated with Squarespace or other third party site builder services?

Thanks,  
Anthony

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [June 8, 2020, 2:53pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/2 "2020-06-08T14:53:32Z")

</div>

Hi Anthony – Yes! As long as you have a back-end server that can make calls to the Dwolla API. you should be able to integrate it into your site built by any of those third party site builder services!

Hope that helps! Let us know if you come across any questions!

---

<div class="post-metadata">

**Author:** ![bksmittie](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@bksmittie](https://discuss.dwolla.com/u/bksmittie)\
**Post date:** [May 19, 2021, 8:36pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/3 "2021-05-19T20:36:07Z")

</div>

Hi. I am working with Wix and they have installed dwolla-v2 on the backend. Their tech people installed the node for my website.

But I keep getting an error when I put my page together.

This is the code I have in my on my webpage. But I keep getting an error of (Unexpected token N in JSON at position 4). Can you assist? This is my first time doing this and I don’t think I’m doing it right.

```
  <div class="container">
    <div class="container-sm">
        <h3>Create Customer</h3>
        <div class="orange-border">
            <dwolla-customer-create terms="https://docs.dwolla.com/" privacy="https://developers.dwolla.com/">
            </dwolla-customer-create>
        </div>
    </div>
    <div class="container-sm">
        <div class="code-container">
          
        </div>
    </div>
</div>
</div>

```

 ![samplepage](https://global.discourse-cdn.com/dwolla/original/2X/8/8c5f67c50c076c57af896551f982215523cb4019.png)

---

<div class="post-metadata">

**Author:** ![kmoreira](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/kmoreira/32/2718_2.png) [@kmoreira](https://discuss.dwolla.com/u/kmoreira)\
**Post date:** [May 20, 2021, 12:50pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/4 "2021-05-20T12:50:54Z")

</div>

@bksmittie

It looks like you have your `Client` variable commented out.

---

<div class="post-metadata">

**Author:** ![bksmittie](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@bksmittie](https://discuss.dwolla.com/u/bksmittie)\
**Post date:** [May 20, 2021, 9:32pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/5 "2021-05-20T21:32:37Z")

</div>

Thanks…Yes I tried uncommenting this out, but it didn’t work. I can put in a backend .js module to run on the backend in Wix. I’m trying to see what code I need to have run here to make this work. I believe the token is not getting through, but just trying to figure this out.

The backend.js code for the page I have is the following:

const dwolla = require(“dwolla-v2”);

// Navigate to [https://dashboard.dwolla.com/applications](https://dashboard.dwolla.com/applications) (production) or [https://dashboard-sandbox.dwolla.com/applications](https://dashboard-sandbox.dwolla.com/applications) (Sandbox) for your application key and secret.

const appKey = “my app key here”;  
const appSecret = “my secret key here”;

const client = new dwolla.Client({  
key: appKey,  
secret: appSecret,  
environment: “sandbox”, // optional - defaults to production  
});

client.post("/tokenUrl", function (req, res) {  
generateClientTokenWithBody(req.body).then((clientTokenRes) =\> {  
console.log(clientTokenRes);  
res.send({ token: clientTokenRes.token });  
});  
});

function generateClientTokenWithBody(body) {  
const url = `/client-tokens`;  
return dwolla  
.post(url, body)  
.then((response) =\> {  
return response.body;  
})  
.catch((error) =\> {  
return error;  
});  
}

---

<div class="post-metadata">

**Author:** ![kmoreira](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/kmoreira/32/2718_2.png) [@kmoreira](https://discuss.dwolla.com/u/kmoreira)\
**Post date:** [May 20, 2021, 9:53pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/6 "2021-05-20T21:53:47Z")

</div>

@bksmittie

Have you tried putting in your key and secret in the `appKey` and `appSecret` values?

Can you also share further information on what you mean by “I am working with Wix and they have installed dwolla-v2 on the backend.“

---

<div class="post-metadata">

**Author:** ![kmoreira](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/kmoreira/32/2718_2.png) [@kmoreira](https://discuss.dwolla.com/u/kmoreira)\
**Post date:** [May 25, 2021, 6:41pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/8 "2021-05-25T18:41:33Z")

</div>

Hi @bksmittie

The reason why I asked is because an errors can occur when your key and secret doesn’t match your environment.

Since the code you shared looks to be in the Sandbox env, if the key and secret is to your production, then this will cause an error.

If you want to use the sandbox environment, make sure you’re using your sandbox key + secret, and for production environment, production key + secret

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [May 25, 2021, 8:19pm UTC](https://discuss.dwolla.com/t/can-dwolla-be-integrated-into-a-wix-site/5842/9 "2021-05-25T20:19:12Z")

</div>

Hey @bksmittie – it looks like you’re using a [tokenUrl instead of a single client-token](https://developers.dwolla.com/guides/drop-ins/generate-client-token#setup-a-token-endpoint-server-side) for the non-flow component you’re using above for adding an Unverified Customer. Perhaps that could be why you’re getting the above error.

Would you be able to share your configuration code? It should look like the following -

```auto
<script>
  dwolla.configure({
    environment: "sandbox",
    styles: "/styles/create.css",
    token: () => Promise.resolve(`{{ token }}`),
    success: (res) => Promise.resolve(res),
    error: (err) => Promise.resolve(err),
  });
</script>
```
