Transfer location not appearing in header, and empty JSON response

From the guide here:

I should be able to use the following code to create a transfer:

var requestBody = {
  _links: {
    source: {
    destination: {
  amount: {
    currency: "USD",
    value: "225.00",

// For Dwolla API applications, an appToken can be used for this endpoint. (
  .post("transfers", requestBody)
  .then((res) => res.headers.get("location")); // => ''

However when doing this, the location header does not exist on the result. All I get is an empty JSON document with a status: 201.

How do I get the ID of the transfer I have just created? (In the sandbox UI, I can see the transfers are being created, so there’s nothing wrong with my request object)

Hi @aaronmboyd

The location header would not be returned in a JSON body, so an empty JSON with a 201 status is the expected behavior for a successful transfer.

You can find the id of the transfer in the location header itself. The code above looks to be from the docs, so you wouldn’t be able to create a successful transfer with it, being that the ids in it are attached to someone else’s account (a developer advocate’s).

You would need to create funding sources of your own to initiate a successful transfer.

Below are some resource on location headers and a screencast I did using our Postman Collection


Thanks for following up.

I’m not using the code verbatim from the documentation, I’m using my own verified funding sources. I know the transfers are being created because I can see them in the sandbox web login, and process them using the sandbox simulation.

My code is exactly the same, but the location header never appears using the same pattern in the documentation.

Is there something different I should be doing? For other patterns, for example the “create unverified customer” flow, which uses a location header return value, it works as documented. e.g. I have this code, and everything works as expected:

    const appToken: dwolla.Client = await getAppToken();
    const res: dwolla.Response = await"customers", customer);
    const customerURL = res.headers.get("location");

Any ideas what to try next?

Hi @aaronmboyd

What gets returned when you print customerURL in the console? In case it helps, here is an app we built which also gets the location header from a transfer.

The second example with customerURL is an example of mine that works perfectly.

I’m trying to get transfers to work the same. I have pretty much exactly the same code as in the app example you linked. The res.headers.get("location") for transfers is always undefined or empty.

If I log the dwolla.Response object res, all I see is:

  status: 201
  headers: {}
  body: {}

@kmoreira Could you please confirm the expected output from posting a new transfer? Are we just meant to get a 201 and then wait for the “customer_transfer_created” webhook event instead? I was hoping to get the ID straight from the post, but this doesn’t appear to be the case.

In fact, from my test suite, it appears that transfers take many seconds to appear in the sandbox backend after creation. Is this the case?

Hi @aaronmboyd – the expected output is for the transfer URL to be included in the location header as with other resource creation requests that return a 201 HTTP status code.

Would you be able to share some examples of transfers that aren’t displaying this? Is it occurring consistently with all transfers?

It may take up to a second or a few for the transfer to show up in Sandbox. In production it should be less than a second.

@shreya Every transfer I create does this. The dwolla.Response object is exactly as I posted above previously:

  status: 201
  headers: {}
  body: {}

Got it. Would you be able to share your code for creating a transfer and printing the Dwolla response? I wonder if you’re using JSON.stringify() during parsing the response/headers. This renders the headers output to {}.

Another thing could be the casing - Location vs location.

Thank you, I will check whether I’m parsing the response as JSON.stringify before retrieving the headers.

Thanks, the JSON.stringify was the problem!

Thanks for the update, Aaron!

Hi @shreya @spencer :

I’m having a similar issue as OP.

Here’s a snippet of the call:"transfers", transfer, headers).then((res) => {

                transfer_href = res.headers.get("location");
                debug = JSON.stringify(res);
                callback(null, null);

            }).catch(err => {

                error = JSON.stringify(err);
                callback(null, null);


Value in debug: "{\"status\":201,\"headers\":{},\"body\":\"\"}"
Value in transfer_href: null

(I did try using ...get("Location") as well as ...get("location") as recommended above, but with the exact same result)

Webhook received:


EDIT @shreya @spencer sorry I’m an idiot; for a particular reason, my console wasn’t logging appropriately. Everything’s worked out now!!

For anyone else who stumbles across this: JSON.stringify(…) does not capture the headers.

Hey @barrownicholas, no worries! Thanks for the update!